Skip to content

Conversation

@navneetrai
Copy link
Member

Resolves #36

This pull request improves the robustness and user experience of the mentions feature in the comment editor. The most important changes are focused on safer handling of mention data, simplifying the popup UI for suggestions, and ensuring consistent data formats in both frontend and backend code.

Frontend: Robustness and UI improvements

  • Ensured that the mentions and content variables in commentions.js are always safely initialized to prevent runtime errors and unexpected behavior when rendering the editor. [1] [2]
  • Replaced the Tippy.js popup for mention suggestions with a custom, styled, and directly positioned div, improving reliability and simplifying the UI logic. The new popup is easier to maintain and better integrated with Alpine.js. [1] [2]
  • Improved cleanup of the mention suggestion popup by directly removing the popup element from the DOM on exit or when pressing Escape, reducing possible memory leaks and UI glitches.

Frontend: Data handling and code simplification

  • Removed the unused insertMention function and simplified the mention insertion logic to handle mention attributes more robustly and avoid edge-case errors. Also, ensured that items passed to the suggestion component are always arrays.

Backend: Consistent mention data

  • Updated the mentions() method in HasMentions.php to always return a collection, even if mentionables is empty, ensuring consistent data format for the frontend and preventing possible errors. [1] [2]

@navneetrai navneetrai self-assigned this Sep 7, 2025
@bjornvb
Copy link

bjornvb commented Oct 27, 2025

Can anyone help me how I can get this pr with composer instead of last version to test if this is fixing the issue with "noxoua-activity-log" plugin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Conflict on editor

3 participants