Uh oh!
There was an error while loading. Please reload this page.
improvement(rich-md-editor): stabilize bubble-menu plugin key + comment cleanup - #5158
Conversation
… move inline rationale into TSDoc
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryLow Risk Overview Also extracts Reviewed by Cursor Bugbot for commit 27901e4. Configure here. |
waleedlatif1
commented
Jun 20, 2026
@cursor review |
waleedlatif1
commented
Jun 20, 2026
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit e3e702a. Configure here.
Greptile SummaryThis PR hardens the bubble menu's
Confidence Score: 5/5Safe to merge — the only behavioral change is the PluginKey stabilization, which is a correct fix, and the rest is comment migration with no logic touched. The No files require special attention. Important Files Changed
Sequence Diagram%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant User
participant EditorDOM as Editor DOM
participant Window
participant BubbleMenu as BubbleMenu Component
participant Plugin as ProseMirror Plugin
User->>EditorDOM: mousedown
EditorDOM->>BubbleMenu: "onPointerDown sets isPointerDownRef=true"
Note over Plugin: shouldShow returns false
User->>Window: mouseup
Window->>BubbleMenu: onPointerUp
BubbleMenu->>BubbleMenu: "isPointerDownRef=false"
alt has formattable selection
BubbleMenu->>Plugin: setMeta(key, show)
BubbleMenu->>Plugin: setMeta(key, updatePosition)
Plugin->>User: bubble menu anchored at selection
end
User->>Window: blur
Window->>BubbleMenu: "onWindowBlur sets isPointerDownRef=false"
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant User
participant EditorDOM as Editor DOM
participant Window
participant BubbleMenu as BubbleMenu Component
participant Plugin as ProseMirror Plugin
User->>EditorDOM: mousedown
EditorDOM->>BubbleMenu: "onPointerDown sets isPointerDownRef=true"
Note over Plugin: shouldShow returns false
User->>Window: mouseup
Window->>BubbleMenu: onPointerUp
BubbleMenu->>BubbleMenu: "isPointerDownRef=false"
alt has formattable selection
BubbleMenu->>Plugin: setMeta(key, show)
BubbleMenu->>Plugin: setMeta(key, updatePosition)
Plugin->>User: bubble menu anchored at selection
end
User->>Window: blur
Window->>BubbleMenu: "onWindowBlur sets isPointerDownRef=false"
Reviews (3): Last reviewed commit: "docs(rich-md-editor): preserve bubble re..." | Re-trigger Greptile |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Greptile SummaryThis PR hardens the bubble menu's
Confidence Score: 5/5Safe to merge — the only behavioral change is swapping The
Important Files Changed
Sequence Diagram%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant User
participant DOM
participant BubbleMenu
participant ProseMirror
User->>DOM: mousedown (drag start)
DOM->>BubbleMenu: "onPointerDown → isPointerDownRef = true"
Note over BubbleMenu: shouldShow returns false (pointer is down)
User->>DOM: mouseup (drag end)
DOM->>BubbleMenu: onPointerUp
BubbleMenu->>BubbleMenu: hasFormattableSelection()?
alt has selection
BubbleMenu->>ProseMirror: setMeta(bubbleMenuKey, 'show')
BubbleMenu->>ProseMirror: setMeta(bubbleMenuKey, 'updatePosition')
Note over ProseMirror: bubbleMenuKey is stable (useState lazy-init)
ProseMirror->>BubbleMenu: plugin receives both metas
BubbleMenu->>User: toolbar visible + anchored
else no selection
Note over BubbleMenu: toolbar stays hidden
end
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant User
participant DOM
participant BubbleMenu
participant ProseMirror
User->>DOM: mousedown (drag start)
DOM->>BubbleMenu: "onPointerDown → isPointerDownRef = true"
Note over BubbleMenu: shouldShow returns false (pointer is down)
User->>DOM: mouseup (drag end)
DOM->>BubbleMenu: onPointerUp
BubbleMenu->>BubbleMenu: hasFormattableSelection()?
alt has selection
BubbleMenu->>ProseMirror: setMeta(bubbleMenuKey, 'show')
BubbleMenu->>ProseMirror: setMeta(bubbleMenuKey, 'updatePosition')
Note over ProseMirror: bubbleMenuKey is stable (useState lazy-init)
ProseMirror->>BubbleMenu: plugin receives both metas
BubbleMenu->>User: toolbar visible + anchored
else no selection
Note over BubbleMenu: toolbar stays hidden
end
Reviews (2): Last reviewed commit: "improvement(rich-md-editor): stabilize t..." | Re-trigger Greptile |
Uh oh!
There was an error while loading. Please reload this page.
waleedlatif1
commented
Jun 20, 2026
@cursor review |
waleedlatif1
commented
Jun 20, 2026
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 27901e4. Configure here.
Summary
PluginKey(useStatelazy-init instead ofuseMemo, which React may recompute and breaksetMeta-based reveal)//comments across the rich-markdown-editor files (per style guide: TSDoc only)Follow-up polish on top of the rich markdown editor work merged in #5148. No behavior change beyond the plugin-key stability hardening.
Type of Change
Testing
setMetareveal and the agent-lock editability test)Checklist