Conversation
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
cubic analysis
No issues found across 57 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Linked issue analysis
Linked issue: PRODUCT-1689: Address remaining editor docs review feedback
| Status | Acceptance criteria | Notes |
|---|---|---|
| ❌ | Use "ProseMirror document" instead of current wording when describing the tree walk (compose-react-email.mdx) | No docs changes to compose-react-email.mdx |
| ❌ | Unknown nodes should be described as rendered as `null`, not "skipped" (compose-react-email.mdx) | No docs change to describe unknown nodes as null |
| ❌ | Fix wording: "rendered in parallel from the final React" (compose-react-email.mdx) | No wording change found in compose-react-email.mdx |
| ✅ | `BubbleMenu`: rename `excludeNodes`/`excludeMarks` to clarify API intent | Renamed to hideWhenActiveNodes/hideWhenActiveMarks |
| ✅ | Unify ButtonBubbleMenu, LinkBubbleMenu, ImageBubbleMenu into a single BubbleMenu with configurable trigger/shouldShow | Unified variants under ui/bubble-menu and added triggers |
| ❌ | `EmailMark` example should import an actual TipTap mark (email-mark.mdx) | No changes to email-mark.mdx found in diffs |
| ❌ | `EmailNode` example should use an actual existing TipTap node (email-node.mdx) | No changes to email-node.mdx found in diffs |
commit: |
b862c88 to
1f4b2c4
Compare
| <BubbleMenu.Default excludeNodes={['button']} excludeMarks={['link']} /> | ||
| <LinkBubbleMenu.Default /> | ||
| <ButtonBubbleMenu.Default /> | ||
| <BubbleMenu.Default |
gabrielmfern
left a comment
There was a problem hiding this comment.
left some comments, but I don't think any of them would be blockers, just worried about the e.getAttribute parts
| { | ||
| "name": "@react-email/editor", | ||
| "version": "0.0.0-experimental.37", | ||
| "version": "0.0.0-experimental.38", |
There was a problem hiding this comment.
might need a new version bump now
|
|
||
| export type ShouldShowFn = (params: ShouldShowParams) => boolean; | ||
|
|
||
| export const bubbleMenuTriggers = { |
There was a problem hiding this comment.
this API is delicious, great work here!
| return false; | ||
| } | ||
| } | ||
| if (view.dom.classList.contains('dragging')) { |
There was a problem hiding this comment.
is this dragging thing from tiptap or from us?
| excludeNodes = [], | ||
| excludeMarks = [], | ||
| shouldShow, | ||
| pluginKey = 'bubbleMenu', |
There was a problem hiding this comment.
this should be a new PluginKey, no?
| const linkHref = useEditorState({ | ||
| editor, | ||
| selector: ({ editor: e }) => | ||
| (e?.getAttributes('link').href as string) ?? '', |
There was a problem hiding this comment.
does this only run for the link selected? did we test it on the examples?
| export interface BubbleMenuContextValue { | ||
| editor: Editor; | ||
| isEditing: boolean; | ||
| setIsEditing: (value: boolean) => void; |
There was a problem hiding this comment.
is this ever called with true? I couldn't find in the PR
| return; | ||
| } | ||
| setInputValue(displayHref); | ||
| const currentHref = (editor.getAttributes('button').href as string) ?? ''; |
There was a problem hiding this comment.
same as what I said for the link
Summary
BubbleMenucomponent with configurableshouldShowtriggersexcludeNodes/excludeMarkstohideWhenActiveNodes/hideWhenActiveMarksfor claritybubbleMenuTriggershelper withtextSelection,node,nodeWithoutSelectionfactory functionsbubble-menu/with prefixed namesAddresses API/component improvements from PRODUCT-1689.
Test plan
Summary by cubic
Unifies all editor bubble menus into a single
BubbleMenuwithshouldShowtriggers and a shared context. Consolidates styles, updatesEmailEditor, examples, and exports to address PRODUCT-1689.Refactors
bubbleMenuTriggers(textSelection,node,nodeWithoutSelection; paramname) with dragging guard.BubbleMenuRootnow takesshouldShow,pluginKey,hideWhenActiveNodes,hideWhenActiveMarks; resets editing on hide.isEditing,setIsEditing) and moved variants toui/bubble-menu/*; newBubbleMenu.*namespace (LinkDefault,ButtonDefault,ImageDefault) and prefixed exports.bubble-menu.css; removed variant CSS and updatedui/themes/default.css.EmailEditorto the unified API; bumped@react-email/editorto0.0.0-experimental.38.Migration
excludeNodes→hideWhenActiveNodes,excludeMarks→hideWhenActiveMarks(inBubbleMenu.DefaultandEmailEditor’sbubbleMenuconfig).LinkBubbleMenu*/ButtonBubbleMenu*/ImageBubbleMenu*→BubbleMenuLink*,BubbleMenuButton*,BubbleMenuImage*(or useBubbleMenu.*).bubble-menu.cssor rely onui/themes/default.css.Written for commit 1f4b2c4. Summary will update on new commits.