feat: Add user mention functionality to incident comments#4649
feat: Add user mention functionality to incident comments#4649Kiryous merged 8 commits intokeephq:mainfrom
Conversation
|
@hemangsk is attempting to deploy a commit to the KeepHQ Team on Vercel. A member of the Team first needs to authorize it. |
d2bdd19 to
8c758a1
Compare
|
@greptile |
|
@Kiryous may I ask your help with reviewing the UI part here? 🙏🏼 |
There was a problem hiding this comment.
PR Summary
Added user mention functionality to incident comments, including a new CommentMention table and UI components for handling @mentions in the activity feed.
- Added new
CommentMentiontable with proper indexes and foreign key constraints in/keep/api/models/db/migrations/2025-04-29-15-21_1b12e6d6ad1f.py - Implemented mention dropdown UI with keyboard navigation in
/keep-ui/app/(keep)/incidents/[id]/activity/ui/IncidentActivityComment.tsx - Added mention highlighting and user data fetching in
/keep-ui/app/(keep)/incidents/[id]/activity/ui/IncidentActivityItem.tsx - Modified
/keep/api/routes/incidents.pyto handle tagged users in comments with proper transaction management - Added
CommentMentionDtointerface and updatedAuditEventtype in/keep-ui/entities/alerts/model/types.ts
💡 (1/5) You can manually trigger the bot by mentioning @greptileai in a comment!
9 file(s) reviewed, 9 comment(s)
Edit PR Review Bot Settings | Greptile
keep-ui/app/(keep)/incidents/[id]/activity/ui/IncidentActivityItem.tsx
Outdated
Show resolved
Hide resolved
keep-ui/app/(keep)/incidents/[id]/activity/ui/IncidentActivityComment.tsx
Outdated
Show resolved
Hide resolved
keep-ui/app/(keep)/incidents/[id]/activity/ui/IncidentActivityComment.tsx
Outdated
Show resolved
Hide resolved
keep-ui/app/(keep)/incidents/[id]/activity/ui/IncidentActivityComment.tsx
Outdated
Show resolved
Hide resolved
keep/api/models/db/migrations/versions/2025-04-29-15-21_1b12e6d6ad1f.py
Outdated
Show resolved
Hide resolved
tests/e2e_tests/incidents_alerts_tests/test_mentions_in_incident_comments.py
Show resolved
Hide resolved
|
Hey! |
|
@skynetigor Thanks for the review! I'll get right on it |
1ea6e5a to
c8507ad
Compare
|
@skynetigor , I've updated the MR with quill-mention package and here's the comment box in action.
|
keep-ui/app/(keep)/incidents/[id]/activity/ui/IncidentCommentInput.tsx
Outdated
Show resolved
Hide resolved
Kiryous
left a comment
There was a problem hiding this comment.
Please check the comment on quill-mention.js lib
|
@Kiryous @skynetigor is this done? |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
|
@hemangsk hey! Please merge my PR into your branch and I have a few more important comments for you a bit later today. |
|
@Kiryous Done 👍 |
There was a problem hiding this comment.
PR Summary
(updates since last review)
Added user mention functionality to incident comments with backend support and UI components.
- Added
extractTaggedUsersutility in/keep-ui/app/(keep)/incidents/[id]/activity/lib/extractTaggedUsers.tsto parse mentions from Quill editor content - Potential XSS vulnerability in
/keep-ui/app/(keep)/incidents/[id]/activity/ui/IncidentActivityItem.tsxdue to unsanitized HTML rendering - Added proper mention handling in
/keep/api/routes/incidents.pywith CommentMention model integration - Empty merge migration in
/keep/api/models/db/migrations/versions/2025-05-19-18-48_90e3eababbf0.pyneeds review - Empty root
package.jsonfile needs to be addressed
17 file(s) reviewed, 14 comment(s)
Edit PR Review Bot Settings | Greptile
keep-ui/app/(keep)/incidents/[id]/activity/lib/extractTaggedUsers.ts
Outdated
Show resolved
Hide resolved
keep-ui/app/(keep)/incidents/[id]/activity/ui/IncidentActivityItem.tsx
Outdated
Show resolved
Hide resolved
keep-ui/app/(keep)/incidents/[id]/activity/ui/IncidentActivityItem.tsx
Outdated
Show resolved
Hide resolved
keep-ui/app/(keep)/incidents/[id]/activity/ui/IncidentActivityComment.tsx
Outdated
Show resolved
Hide resolved
keep/api/models/db/migrations/versions/2025-05-19-18-48_90e3eababbf0.py
Outdated
Show resolved
Hide resolved
keep/api/models/db/migrations/versions/2025-05-19-20-54_combined_commentmention.py
Show resolved
Hide resolved
tests/e2e_tests/incidents_alerts_tests/test_mentions_in_incident_comments.py
Outdated
Show resolved
Hide resolved
tests/e2e_tests/incidents_alerts_tests/test_mentions_in_incident_comments.py
Outdated
Show resolved
Hide resolved
keep-ui/app/(keep)/incidents/[id]/activity/ui/IncidentActivityItem.tsx
Outdated
Show resolved
Hide resolved
keep-ui/app/(keep)/incidents/[id]/activity/ui/IncidentActivityItem.tsx
Outdated
Show resolved
Hide resolved
keep-ui/app/(keep)/incidents/[id]/activity/lib/extractTaggedUsers.ts
Outdated
Show resolved
Hide resolved
keep-ui/app/(keep)/incidents/[id]/activity/ui/IncidentActivityItem.tsx
Outdated
Show resolved
Hide resolved
|
@Kiryous , I've pushed an update and all the changes are now done Regarding #4649 (comment) I added the usage of IncidentActivity 96b35b5 Please let me know if that's alright or should we tackle it differently? |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4649 +/- ##
===========================================
- Coverage 46.14% 30.87% -15.28%
===========================================
Files 165 93 -72
Lines 17428 11051 -6377
===========================================
- Hits 8043 3412 -4631
+ Misses 9385 7639 -1746 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
🚂 Fantastic work @hemangsk! Your very first PR to keep has been merged! 🎉🥳 You've just taken your first step into open-source, and we couldn't be happier to have you onboard. 🙌 For any support, feel free to reach out on the community: https://slack.keephq.dev. Happy coding! 👩💻👨💻 |

Added proper support for @mentions in incident comments. Created a dedicated CommentMention model with relationships to AlertAudit.
Closes #2187
📑 Description
✅ Checks
ℹ Additional Information
/claim #2187