-
Notifications
You must be signed in to change notification settings - Fork 8
feat(editor): add @everyone mention support #572
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: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -18,7 +18,7 @@ export default Node.create<MentionOptions>({ | |||||||||||
| return { | ||||||||||||
| HTMLAttributes: {}, | ||||||||||||
| renderLabel({ node }) { | ||||||||||||
| const isMention = node.attrs.id.startsWith('did:'); | ||||||||||||
| const isMention = node.attrs.id.startsWith('did:') || node.attrs.id.startsWith('ad4m://'); | ||||||||||||
| return `${isMention ? '@' : '#'}${node.attrs.label ?? node.attrs.id}`; | ||||||||||||
|
Comment on lines
+21
to
22
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Guard Line 21 assumes Proposed fix renderLabel({ node }) {
- const isMention = node.attrs.id.startsWith('did:') || node.attrs.id.startsWith('ad4m://');
- return `${isMention ? '@' : '#'}${node.attrs.label ?? node.attrs.id}`;
+ const id = typeof node.attrs.id === 'string' ? node.attrs.id : '';
+ const isMention = id.startsWith('did:') || id.startsWith('ad4m://');
+ return `${isMention ? '@' : '#'}${node.attrs.label ?? id}`;
},📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||
| }, | ||||||||||||
| suggestion: { | ||||||||||||
|
|
||||||||||||
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.
🧩 Analysis chain
🏁 Script executed:
Repository: coasys/flux
Length of output: 96
🏁 Script executed:
Repository: coasys/flux
Length of output: 1106
🏁 Script executed:
Repository: coasys/flux
Length of output: 2920
🏁 Script executed:
Repository: coasys/flux
Length of output: 37
🏁 Script executed:
Repository: coasys/flux
Length of output: 98
🏁 Script executed:
Repository: coasys/flux
Length of output: 3396
🏁 Script executed:
Repository: coasys/flux
Length of output: 2573
🏁 Script executed:
Repository: coasys/flux
Length of output: 665
🏁 Script executed:
Repository: coasys/flux
Length of output: 984
🏁 Script executed:
Repository: coasys/flux
Length of output: 464
🏁 Script executed:
# Look at the full mention.ts to understand the complete flow cat -n packages/flux-editor/src/mention.tsRepository: coasys/flux
Length of output: 5138
🏁 Script executed:
Repository: coasys/flux
Length of output: 3684
🏁 Script executed:
Repository: coasys/flux
Length of output: 912
🏁 Script executed:
Repository: coasys/flux
Length of output: 783
🏁 Script executed:
Repository: coasys/flux
Length of output: 18215
🏁 Script executed:
Repository: coasys/flux
Length of output: 105
🏁 Script executed:
Repository: coasys/flux
Length of output: 297
🏁 Script executed:
Repository: coasys/flux
Length of output: 299
🏁 Script executed:
Repository: coasys/flux
Length of output: 1443
🏁 Script executed:
Repository: coasys/flux
Length of output: 37
🏁 Script executed:
Repository: coasys/flux
Length of output: 39
🏁 Script executed:
Repository: coasys/flux
Length of output: 37
🏁 Script executed:
Repository: coasys/flux
Length of output: 986
🏁 Script executed:
Repository: coasys/flux
Length of output: 37
Gate
@everyonesuggestion behind an explicit permission/capability check in the editor.Lines 303–307 expose
ad4m://everyoneto all users unconditionally in the suggestion list. The mention plugin accepts any mention with thead4m://prefix without validation. Ensure this capability is restricted based on user permissions—at minimum in the backend when processing messages, and preferably also in the UI suggestion layer to prevent users from attempting unsupported mentions.🤖 Prompt for AI Agents