-
Notifications
You must be signed in to change notification settings - Fork 965
feat: Add user mention functionality to incident comments #4649
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
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
@Kiryous may I ask your help with reviewing the UI part here? 🙏🏼 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
CommentMention
table 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.py
to handle tagged users in comments with proper transaction management - Added
CommentMentionDto
interface and updatedAuditEvent
type 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/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. ![]() |
}: IncidentCommentInputProps) { | ||
const [mentionModuleReady, setMentionModuleReady] = useState(false); | ||
|
||
useEffect(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@skynetigor , I had to resort to some script tag voodoo to get quill-mention working. Regular imports were just throwing "Cannot resolve module" errors no matter what I tried. What worked is.. Manually adding the script onto the DOM, setting window.Quill first and then the loading order.
I've done all the requested changes. PTAL |
@hemangsk could you please record a video how it works and attach to the PR? |
@skynetigor Here's a screengrab of the feature: Screen.Recording.2025-05-13.at.12.10.25.AM.mov |
@skynetigor , Here's a screenrecording after the quill-mention integration (the last video was of original implementation without quill mention): quillmention.mov |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check the comment on quill-mention.js lib
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pushing a minified version of the lib to public is not a sustainable way forward. Let's handle it the proper way, I can help resolve issues if any with bundler.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Kiryous Agreed, The problem right now is that after installing quill-mention via npm
npm i quill-mention --save
When I try to use it with :
import "quill-mention/autoregister";
or
import {Mention, MentionBlot} from "quill-mention";
Quill.register({ "blots/mention": MentionBlot, "modules/mention": Mention });
The application fails to compile with the error Module not found: Can't resolve 'quill-mention/autoregister'
, and I can confirm that autoregister definitely exists in node_modules folder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Kiryous I've described the issue above, it'll be really great if you could provide some help or direction on how to resolve it. A straightforward npm installation and import of quill-mention is not working atm.
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