iachat/app
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
..
actions chore: Avoid contact inboxes getting deleted (#10612) 2024-12-26 16:17:38 +05:30
assets chore: Update styles in settings pages (#11070) 2025-03-18 14:40:02 -07:00
builders feat: Instagram Inbox using Instagram Business Login (#11054) 2025-04-08 10:47:41 +05:30
channels fix: Move contact events to account stream rather than individual user stream (#11082) 2025-03-13 17:46:48 -07:00
controllers fix: Removing repetitive name parameter in AgentsController (#11259) 2025-04-09 08:53:13 +05:30
dashboards feat: Ability to delete account for administrators (#1874) 2025-04-03 10:41:39 +05:30
dispatchers feat(ee): Add Captain features (#10665) 2025-01-14 16:15:47 -08:00
drops feat: Add the support for custom attributes in message variables (#8511) 2023-12-08 14:13:35 -08:00
fields feat: setup captain limits (#10713) 2025-01-23 01:23:18 +05:30
finders chore(refactor): Improve conversation permission filtering (#11166) 2025-03-31 19:30:02 -07:00
helpers feat: Added the ability to create Instagram channel (#11182) 2025-04-03 13:57:14 +05:30
javascript fix: Prevent mentions menu from triggering on reply mode change (#11264) 2025-04-09 15:25:46 +05:30
jobs feat: Instagram Inbox using Instagram Business Login (#11054) 2025-04-08 10:47:41 +05:30
listeners chore: Ignore notification when assignee is nil (#11105) 2025-03-18 20:14:19 -07:00
mailboxes fix: Process non-image inline attachments as regular attachments (#10998) 2025-02-28 13:33:48 -08:00
mailers feat: Instagram reauthorization (#11221) 2025-04-03 14:30:48 +05:30
models feat: Instagram Inbox using Instagram Business Login (#11054) 2025-04-08 10:47:41 +05:30
policies chore: Clean up report & knowledge base policies (#11234) 2025-04-03 16:00:32 -07:00
presenters chore: Update the precision of the updated_at timestamp in conversation model (#10875) 2025-02-10 20:22:11 -08:00
services feat: Instagram Inbox using Instagram Business Login (#11054) 2025-04-08 10:47:41 +05:30
views chore: Clean up report & knowledge base policies (#11234) 2025-04-03 16:00:32 -07:00
workers fix: Capture delivery errors to avoid false positives (#8790) 2024-01-26 14:22:18 +04:00