chatwoot/app/javascript/dashboard
Shivam Mishra b75ea7a762
feat: Use resolved contacts as base relation for filtering (#12520)
This PR has two changes to speed up contact filtering

### Updated Base Relation

Update the `base_relation` to use resolved contacts scope to improve
perf when filtering conversations. This narrows the search space
drastically, and what is usually a sequential scan becomes a index scan
for that `account_id`

ref: https://github.com/chatwoot/chatwoot/pull/9347
ref: https://github.com/chatwoot/chatwoot/pull/7175/

Result: https://explain.dalibo.com/plan/c8a8gb17f0275fgf#plan


## Selective filtering in Compose New Conversation

We also cost of filtering in compose new conversation dialog by reducing
the search space based on the search candidate. For instance, a search
term that obviously can’t be a phone, we exclude that from the filter.
Similarly we skip name lookups for email-shaped queries.

Removing the phone number took the query times from 50 seconds to under
1 seconds

### Comparison

1. Only Email: https://explain.dalibo.com/plan/h91a6844a4438a6a 
2. Email + Name: https://explain.dalibo.com/plan/beg3aah05ch9ade0
3. Email + Name + Phone:
https://explain.dalibo.com/plan/c8a8gb17f0275fgf
2025-09-25 15:26:44 +05:30
..
api feat: Add the frontend support for MFA (#12372) 2025-09-18 21:16:06 +05:30
assets chore: Improve layout styles (#12025) 2025-07-30 13:49:27 -07:00
components fix: Inbox delete confirmation fails due to whitespace (#12498) 2025-09-23 22:20:43 +05:30
components-next feat: Use resolved contacts as base relation for filtering (#12520) 2025-09-25 15:26:44 +05:30
composables feat: Add support for labels in automations (#11658) 2025-09-18 14:17:54 +05:30
constants chore: Enable flexible whatsapp onboarding (Manual + Embedded Signup) options (#12344) 2025-09-15 19:59:56 +05:30
helper feat: Add UI to manage web widget allowed domains (#12495) 2025-09-24 16:46:19 +05:30
i18n feat: Add UI to manage web widget allowed domains (#12495) 2025-09-24 16:46:19 +05:30
mixins chore: Default file limits for private notes and reset attachment on mode switch (#12310) 2025-08-27 11:56:07 +05:30
modules feat(ee): Setup advanced, performant message search (#12193) 2025-08-28 10:10:28 +05:30
routes feat: Add UI to manage web widget allowed domains (#12495) 2025-09-24 16:46:19 +05:30
store feat: Update meta debounce max wait (#12493) 2025-09-23 13:57:17 +05:30
App.vue feat: Agent language settings (#11222) 2025-09-09 14:27:36 +05:30
featureFlags.js feat: SAML feedback changes [CW-5666] (#12511) 2025-09-24 16:07:07 +05:30