-
-
Notifications
You must be signed in to change notification settings - Fork 264
feat: Add @mention support in comments and descriptions with email notifications #382
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
Open
owaisrizvi97
wants to merge
11
commits into
kanbn:main
Choose a base branch
from
owaisrizvi97:local-mention-implementation
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat: Add @mention support in comments and descriptions with email notifications #382
owaisrizvi97
wants to merge
11
commits into
kanbn:main
from
owaisrizvi97:local-mention-implementation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…tifications Implements user mentions in card comments and descriptions using TipTap editor, with automatic email notifications sent to mentioned workspace members. Key Changes: - Created shared MentionSuggestion module for reusable mention UI components - Added lightweight CommentEditor component with @mention autocomplete - Updated Comment component to use TipTap editor with mention support - Implemented fire-and-forget email notification system for mentions - Added mention-notification email template - Created utility functions for extracting mentions from HTML Technical Details: - Uses existing TipTap Mention extension for autocomplete functionality - Email sending never blocks comment creation (fire-and-forget pattern) - Respects NEXT_PUBLIC_DISABLE_EMAIL environment variable - Excludes self-mentions from notifications - No database schema changes required (mentions stored in HTML) Files Added: - apps/web/src/components/MentionSuggestion.tsx - apps/web/src/components/CommentEditor.tsx - packages/api/src/utils/mentions.ts - packages/email/src/templates/mention-notification.tsx - docs/feature-mention-notifications.md Files Modified: - apps/web/src/components/Editor.tsx - apps/web/src/views/card/components/Comment.tsx - apps/web/src/views/card/components/NewCommentForm.tsx - apps/web/src/views/card/index.tsx - packages/api/src/routers/card.ts - packages/email/src/sendEmail.tsx - packages/db/src/repository/card.repo.ts - packages/db/src/repository/workspace.repo.ts Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
Author
|
@hjball required your review please. This is extremely important functionality needed atm for our organization |
Contributor
|
What features/functionality are not covered by my PR? @owaisrizvi97 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Adds user @mention functionality to card comments and descriptions with automatic email notifications. Users can now tag teammates using
@autocomplete in both comment threads and card descriptions, triggering instant email notifications to mentioned members.Features
Frontend
@in comments or descriptions to see workspace member suggestionsMentionSuggestionmodule for consistent mention UIContentEditablefor display mode to avoid initializing TipTap instances for every commentBackend
Email Template
"{name} mentioned you in {cardTitle}"Architecture Decisions
Editor.tsxto eliminate code duplication<span data-type="mention" data-id="...">elementsFiles Changed
New Files
apps/web/src/components/MentionSuggestion.tsx- Shared mention UI componentsapps/web/src/components/CommentEditor.tsx- Lightweight TipTap editor for commentspackages/api/src/utils/mentions.ts- Mention parsing and email dispatch utilitiespackages/email/src/templates/mention-notification.tsx- Email templateapps/web/src/utils/mentions.test.ts- Unit tests for mention parsingdocs/feature-mention-notifications.md- Feature documentationModified Files
apps/web/src/components/Editor.tsx- Now imports from shared MentionSuggestion moduleapps/web/src/views/card/components/Comment.tsx- Uses CommentEditor for editing, TipTap Editor for displayapps/web/src/views/card/components/NewCommentForm.tsx- Replacedreact-contenteditablewith CommentEditorapps/web/src/views/card/index.tsx- Passes workspace members to comment componentspackages/api/src/routers/card.ts- Triggers mention emails in create/update operationspackages/email/src/sendEmail.tsx- Registered MENTION_NOTIFICATION templatepackages/db/src/repository/card.repo.ts- AddedgetCardNotificationContextquerypackages/db/src/repository/workspace.repo.ts- AddedgetMembersWithEmailsByPublicIdsqueryBackward Compatibility
NEXT_PUBLIC_DISABLE_EMAIL)Testing
Automated
mentions.test.ts)Manual Testing Checklist
@in comment → suggestion popup appearsNEXT_PUBLIC_DISABLE_EMAIL=true→ no emails sentEnvironment Variables
No new environment variables required. Uses existing SMTP configuration:
SMTP_HOST,SMTP_PORT,SMTP_USER,SMTP_PASSWORDEMAIL_FROMNEXT_PUBLIC_DISABLE_EMAIL(optional - disables all emails)NEXT_PUBLIC_BASE_URL(required for card URLs in emails)Performance Impact
ContentEditablewithdisabled={true}for rendered comments instead of full TipTap instancesSecurity
Documentation
See
docs/feature-mention-notifications.mdfor: