[PR #5944] [MERGED] Comment mentions #6597

Closed
opened 2026-02-05 10:36:23 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/BookStackApp/BookStack/pull/5944
Author: @ssddanbrown
Created: 12/8/2025
Status: Merged
Merged: 12/18/2025
Merged by: @ssddanbrown

Base: developmentHead: comment_mentions


📝 Commits (10+)

  • 50540e2 Lexical: Created mention node, started mention service, split comment editor out
  • 9bf9ae9 Mentions: Added new endpoint, Built editor list display
  • 1e768ce Lexical: Changed mention to be a decorator node
  • 147ff00 JS: Swapped livereload lib for esbuild livereload setup
  • e2f91c2 Comment Mentions: Added keyboard nav, worked on design
  • 221c6c7 Comment Mentions: Added core back-end logic
  • 4f76047 Merge branch 'development' into comment_mentions
  • 48cdaab Comment Mentions: Added tests to cover back-end functionality
  • 3d9aba7 Mentions: Added coverage for mentions search endpoint
  • 90fc02c Esbuild & Mentions: Updated interaction stability and build system

📊 Changes

48 files changed (+1184 additions, -124 deletions)

View changed files

app/Activity/Models/MentionHistory.php (+20 -0)
app/Activity/Notifications/Handlers/CommentMentionNotificationHandler.php (+85 -0)
app/Activity/Notifications/Messages/CommentMentionNotification.php (+37 -0)
📝 app/Activity/Notifications/NotificationManager.php (+3 -0)
app/Activity/Tools/MentionParser.php (+28 -0)
📝 app/App/Providers/AppServiceProvider.php (+2 -0)
📝 app/Config/database.php (+2 -1)
📝 app/Config/setting-defaults.php (+1 -0)
📝 app/Settings/UserNotificationPreferences.php (+6 -1)
📝 app/Users/Controllers/UserSearchController.php (+37 -1)
📝 app/Util/HtmlDescriptionFilter.php (+1 -1)
database/migrations/2025_12_15_140219_create_mention_history_table.php (+31 -0)
📝 dev/build/esbuild.mjs (+45 -8)
dev/build/livereload.js (+35 -0)
📝 lang/en/notifications.php (+2 -0)
📝 lang/en/preferences.php (+1 -0)
📝 lang/en/settings.php (+2 -0)
📝 package-lock.json (+0 -64)
📝 package.json (+4 -6)
📝 resources/js/components/page-comment.ts (+2 -2)

...and 28 more files

📄 Description

Related to #560.

Todo

  • Finish off editor UI.
  • Address remaining todos in code changes
  • Add lookup for users
    • Limit to those with ability to create/update comments for now.
  • Back-end comment parsing
  • Notification on mention
  • Notification preferences - Add option for comment mentions.
  • Test cases for back-end functionality.
    • Add test to cover new user search endpoint.
  • Stress-test & fix editor/front-end behaviour
  • Dark mode test
  • Chromium test

Considerations

  • How do we handle mention changes on comment updates.
    • We're tracking mentions via the database, and only mention if a new mention is added, so we don't notify for prior mentions (even if a notification was not sent before).
  • Do we need rate limiting to prevent spam like page update notifications.
    • Avoid for now, but should be able to track/add via history system if found to be needed upon user feedback.
  • Are these useful if we don't opt-in users to them by default?
    • We will opt in those with notification permissions by default. Add extra further consideration for admin-level user notification management in future.

Doc Updates

  • Update advisory - Anyone with comment create/update will technically be able to access a list of system users.
  • Update advisory - Any users with a "Receive & manage notifications" role permission will be opted-in to comment mention notifications by default.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/BookStackApp/BookStack/pull/5944 **Author:** [@ssddanbrown](https://github.com/ssddanbrown) **Created:** 12/8/2025 **Status:** ✅ Merged **Merged:** 12/18/2025 **Merged by:** [@ssddanbrown](https://github.com/ssddanbrown) **Base:** `development` ← **Head:** `comment_mentions` --- ### 📝 Commits (10+) - [`50540e2`](https://github.com/BookStackApp/BookStack/commit/50540e23a1c2f97182799a5c163b3c67ea0ebad8) Lexical: Created mention node, started mention service, split comment editor out - [`9bf9ae9`](https://github.com/BookStackApp/BookStack/commit/9bf9ae9c371904c770f1ecdbab6c024aec4a9937) Mentions: Added new endpoint, Built editor list display - [`1e768ce`](https://github.com/BookStackApp/BookStack/commit/1e768ce33f0aebc3af717ada38fa42222c6e6137) Lexical: Changed mention to be a decorator node - [`147ff00`](https://github.com/BookStackApp/BookStack/commit/147ff00c7a5f326ae4a321fe21d89873d27b0d0a) JS: Swapped livereload lib for esbuild livereload setup - [`e2f91c2`](https://github.com/BookStackApp/BookStack/commit/e2f91c2bbbc3b4de1c8576b7cc64f905314debc7) Comment Mentions: Added keyboard nav, worked on design - [`221c6c7`](https://github.com/BookStackApp/BookStack/commit/221c6c7e9f5f03dd1f5f1cef7ed10e3af4f43e46) Comment Mentions: Added core back-end logic - [`4f76047`](https://github.com/BookStackApp/BookStack/commit/4f760479c37b50c4c88d926fcf0cc5995411cb34) Merge branch 'development' into comment_mentions - [`48cdaab`](https://github.com/BookStackApp/BookStack/commit/48cdaab690bbe1cd91436b5aa0fc281ce9a9d8bd) Comment Mentions: Added tests to cover back-end functionality - [`3d9aba7`](https://github.com/BookStackApp/BookStack/commit/3d9aba7b1f3185345ac58a51127ac32e8b669a50) Mentions: Added coverage for mentions search endpoint - [`90fc02c`](https://github.com/BookStackApp/BookStack/commit/90fc02c57f891145bee681234106f8fd6d357cc1) Esbuild & Mentions: Updated interaction stability and build system ### 📊 Changes **48 files changed** (+1184 additions, -124 deletions) <details> <summary>View changed files</summary> ➕ `app/Activity/Models/MentionHistory.php` (+20 -0) ➕ `app/Activity/Notifications/Handlers/CommentMentionNotificationHandler.php` (+85 -0) ➕ `app/Activity/Notifications/Messages/CommentMentionNotification.php` (+37 -0) 📝 `app/Activity/Notifications/NotificationManager.php` (+3 -0) ➕ `app/Activity/Tools/MentionParser.php` (+28 -0) 📝 `app/App/Providers/AppServiceProvider.php` (+2 -0) 📝 `app/Config/database.php` (+2 -1) 📝 `app/Config/setting-defaults.php` (+1 -0) 📝 `app/Settings/UserNotificationPreferences.php` (+6 -1) 📝 `app/Users/Controllers/UserSearchController.php` (+37 -1) 📝 `app/Util/HtmlDescriptionFilter.php` (+1 -1) ➕ `database/migrations/2025_12_15_140219_create_mention_history_table.php` (+31 -0) 📝 `dev/build/esbuild.mjs` (+45 -8) ➕ `dev/build/livereload.js` (+35 -0) 📝 `lang/en/notifications.php` (+2 -0) 📝 `lang/en/preferences.php` (+1 -0) 📝 `lang/en/settings.php` (+2 -0) 📝 `package-lock.json` (+0 -64) 📝 `package.json` (+4 -6) 📝 `resources/js/components/page-comment.ts` (+2 -2) _...and 28 more files_ </details> ### 📄 Description Related to #560. ### Todo - [x] Finish off editor UI. - [x] Address remaining todos in code changes - [x] Add lookup for users - [x] Limit to those with ability to create/update comments for now. - [x] Back-end comment parsing - [x] Notification on mention - [x] Notification preferences - Add option for comment mentions. - [x] Test cases for back-end functionality. - [x] Add test to cover new user search endpoint. - [x] Stress-test & fix editor/front-end behaviour - [x] Dark mode test - [x] Chromium test ### Considerations - How do we handle mention changes on comment updates. - We're tracking mentions via the database, and only mention if a new mention is added, so we don't notify for prior mentions (even if a notification was not sent before). - Do we need rate limiting to prevent spam like page update notifications. - Avoid for now, but should be able to track/add via history system if found to be needed upon user feedback. - Are these useful if we don't opt-in users to them by default? - We will opt in those with notification permissions by default. Add extra further consideration for admin-level user notification management in future. ### Doc Updates - Update advisory - Anyone with comment create/update will technically be able to access a list of system users. - Update advisory - Any users with a "Receive & manage notifications" role permission will be opted-in to comment mention notifications by default. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-05 10:36:23 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#6597