iachat/app/javascript/dashboard
Sivin Varghese 7343e53659
fix: Variable search item not showing after braces/commas (#11864)
# Pull Request Template

## Description

This PR fixes an issue where typing variables, like `{{contact.name}}`,
caused the variable list to miss showing `contact.name`. The search key
in this case became `contact.name}},` which didn't match any available
options. The logic in `VariableList.vue` only checked the part after the
last comma and didn’t fully sanitize the input.

**Solution**
Updated `searchKey` to remove all {} and commas for accurate matching.

Fixes
[CW-4574](https://linear.app/chatwoot/issue/CW-4574/i-dont-see-an-option-for-contactname-it-shows-initially-but-it-doesnt)

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)

## How Has This Been Tested?

### Loom video

https://www.loom.com/share/fc86e53853ad49e6acf6de57ebbd8fcb?sid=6702f896-d1a3-4c5a-9eb7-b96b5ed91531


## Checklist:

- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my code
- [x] I have commented on my code, particularly in hard-to-understand
areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [x] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream
modules
2025-07-03 19:39:36 +05:30
..
api feat: notion OAuth setup (#11765) 2025-06-26 19:16:06 +05:30
assets chore: Remove older UI (#11720) 2025-07-01 09:43:44 +05:30
components fix: Variable search item not showing after braces/commas (#11864) 2025-07-03 19:39:36 +05:30
components-next chore: Remove older UI (#11720) 2025-07-01 09:43:44 +05:30
composables feat: Voice channel creation Flow (#11775) 2025-06-25 14:21:03 -07:00
constants feat: Add rich text support for widget welcome tagline (#11666) 2025-06-05 14:13:46 -05:00
helper fix: Variable search item not showing after braces/commas (#11864) 2025-07-03 19:39:36 +05:30
i18n feat: Add the ability to mention team in private message (#11758) 2025-07-02 19:57:59 +05:30
mixins chore: fix circleci on vite build (#10214) 2024-10-07 15:27:41 +05:30
modules chore: Remove older UI (#11720) 2025-07-01 09:43:44 +05:30
routes chore: Disable drag on macro item when preview is open (#11847) 2025-07-02 11:59:15 +05:30
store feat: Voice channel creation Flow (#11775) 2025-06-25 14:21:03 -07:00
App.vue chore: Remove older UI (#11720) 2025-07-01 09:43:44 +05:30
featureFlags.js feat: Instagram Inbox using Instagram Business Login (#11054) 2025-04-08 10:47:41 +05:30