iachat/app/javascript/dashboard/components/widgets/conversation
Sivin Varghese 70a65e2c34
fix: Prevent mentions menu from triggering on reply mode change (#11264)
# Pull Request Template

## Description

**Issue:** When typing "@" in reply mode and then switching to private
note mode, the user mentions menu remains visible and cannot be
dismissed.

**Cause:** The Prose Mirror suggestion plugin for "@" was active in both
reply modes (normal and private). When triggered in normal reply mode
and then switching to private note mode, the menu would remain open and
couldn't be dismissed.

**Solution**
```
createSuggestionPlugin({
  trigger: '@',
  showMenu: showUserMentions,
  searchTerm: mentionSearchKey,
  isAllowed: () => props.isPrivate, // Only allow @ mentions in private note mode
}),
```
1. By setting `isAllowed: () => props.isPrivate`, the @ mention trigger
will only activate when in private note mode
2. In normal reply mode, the plugin won't activate at all since
`isAllowed` returns false
3. This prevents the menu from being triggered in the wrong context and
fix the scenario where the menu gets stuck.

## Type of change

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

## How Has This Been Tested?

### Loom video

**Before**

https://www.loom.com/share/5333f0c6498d4a9ea4d220b1de1b608c?sid=1425f24f-2c6f-4ff5-aab3-23c3203d2e05

**After**

https://www.loom.com/share/9f183c76d6a94b618a7c2aaed280b780?sid=19ef08b8-2b70-434b-ad5a-267410212e11

## Checklist:

- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my code
- [ ] 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-04-09 15:25:46 +05:30
..
advancedFilterItems feat: Add support for frontend filtering of conversations (#11111) 2025-03-24 19:39:04 -07:00
bubble chore: Update buttons in dashboard (#11145) 2025-03-31 17:21:32 -07:00
components chore: Update buttons in conversation screens - 2 (#11134) 2025-03-21 21:54:54 +05:30
contextMenu fix: Usability issues in conversation card context menu (#10971) 2025-02-25 16:48:04 +05:30
conversation chore: Update buttons in dashboard (#11145) 2025-03-31 17:21:32 -07:00
conversationBulkActions chore: Update buttons in conversation screens - 2 (#11134) 2025-03-21 21:54:54 +05:30
conversationCardComponents chore(v4): Update colors (#10700) 2025-01-16 15:27:23 +05:30
EmptyState feat: update colors for v4 (#10660) 2025-01-15 17:13:03 +05:30
helpers chore: Migrate all instances of old vuelidate to new v2 syntax [CW-3274] (#9623) 2024-07-30 15:08:22 +05:30
linear chore: Update buttons in dashboard (#11145) 2025-03-31 17:21:32 -07:00
specs chore: fix circleci on vite build (#10214) 2024-10-07 15:27:41 +05:30
WhatsappTemplates chore: Update buttons in conversation screens - 2 (#11134) 2025-03-21 21:54:54 +05:30
AvailabilityStatusBadge.vue feat: Eslint rules (#9839) 2024-08-05 14:02:16 +05:30
CannedResponse.vue style: apply fixes for eslint issues [cw-3590] (#10210) 2024-10-03 15:02:12 +05:30
ChatFilter.vue feat: Dark Mode (#7471) 2023-07-21 22:10:25 +05:30
ConversationBasicFilter.vue chore: Update chat list header UI (#10573) 2024-12-12 10:12:07 +05:30
ConversationBox.vue feat: update colors for v4 (#10660) 2025-01-15 17:13:03 +05:30
ConversationCard.vue feat: Support bigger font size in dashboard (#10974) 2025-02-27 12:10:33 +05:30
ConversationHeader.vue chore: Update buttons in conversation screens - 2 (#11134) 2025-03-21 21:54:54 +05:30
ConversationSidebar.vue feat: Support bigger font size in dashboard (#10974) 2025-02-27 12:10:33 +05:30
EmailTranscriptModal.vue chore: Remove old buttons from Vue2 design (#11159) 2025-03-31 17:51:38 -07:00
FilterItem.vue chore: Update chat list header UI (#10573) 2024-12-12 10:12:07 +05:30
Message.vue feat: Add RTL Support to Widget (#11022) 2025-03-21 09:39:03 -07:00
MessagePreview.vue chore: Repalce message formatter mixin with useMessageFormatter [CW-3470] (#9986) 2024-08-27 08:06:51 +05:30
MessageSignatureMissingAlert.vue chore: Update buttons in conversation screens - 2 (#11134) 2025-03-21 21:54:54 +05:30
MessagesView.vue chore: Reply window fixes (#11242) 2025-04-04 13:03:41 +05:30
MoreActions.vue feat: update colors for v4 (#10660) 2025-01-15 17:13:03 +05:30
OnboardingFeatureCard.vue feat: Vite + vue 3 💚 (#10047) 2024-10-02 00:36:30 -07:00
OnboardingView.vue feat: Vite + vue 3 💚 (#10047) 2024-10-02 00:36:30 -07:00
PriorityMark.vue chore(v4): Update colors (#10700) 2025-01-16 15:27:23 +05:30
ReplyBox.vue feat: Instagram Inbox using Instagram Business Login (#11054) 2025-04-08 10:47:41 +05:30
ReplyEmailHead.vue chore: Update styles in settings pages (#11070) 2025-03-18 14:40:02 -07:00
ReplyToMessage.vue chore: Update buttons in conversation screens - 2 (#11134) 2025-03-21 21:54:54 +05:30
ShopifyOrderItem.vue feat(apps): Shopify Integration (#11101) 2025-03-19 15:37:55 -07:00
ShopifyOrdersList.vue feat(apps): Shopify Integration (#11101) 2025-03-19 15:37:55 -07:00
TagAgents.vue fix: Prevent mentions menu from triggering on reply mode change (#11264) 2025-04-09 15:25:46 +05:30
VariableList.vue style: apply fixes for eslint issues [cw-3590] (#10210) 2024-10-03 15:02:12 +05:30