Mind map leaf comment popover needs styling fix #151
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_whiteboard#151
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When adding a comment to a mind map leaf node, the comment popover shows broken/inconsistent styling. The popover appears with default dark styling that does not match the rest of the comment UI in the whiteboard.
Expected
The comment popover on mind map leaves should match the standard comment popover look used elsewhere on the canvas.
Actual
The popover renders with mismatched dark styling.
Repro
Screenshot
Implementation Spec
Root cause
There are two parallel comment-popover implementations in the whiteboard, and the mind-map one does not match the canvas one:
Standard comment popover (sticky notes, shapes, frames, comment markers):
crates/hero_whiteboard_ui/static/web/js/whiteboard/comments.jsbuilds the popover from CSS classes (.comment-popover,.comment-popover-header,.comment-popover-title,.comment-body,.comment-new-textarea,.comment-btn) defined incrates/hero_whiteboard_ui/static/web/css/whiteboard.css. These pick up the active theme via--wb-toolbar-bg,--wb-border,--wb-text,--wb-primary, etc.Mind-map node comment popover:
crates/hero_whiteboard_ui/static/web/js/whiteboard/mindmap.jsshowCommentPopupbuilds its own DOM with hardcoded inlinestyle.cssTextthat pulls from a different theme namespace (mindmap-comment-bg,mindmap-comment-border,mindmap-comment-text,mindmap-comment-accent). In the default dark theme these resolve to#1a1d21,#495057,#e0e0e0— the dark broken look in the screenshot. Save/Remove buttons use hardcoded#007AFF/#495057instead of.comment-btnstyles.Fix: rebuild the mind-map popup using the same
.comment-popoverCSS classes the rest of the canvas uses.Files to Modify
crates/hero_whiteboard_ui/static/web/js/whiteboard/mindmap.js— rewriteshowCommentPopupto use shared CSS classes, removing inlinestyle.cssTextstrings that readmindmap-comment-*tokens. Preserve all behavior (Save/Remove/close, click-outside, Esc, positioning,WhiteboardSync.onUpdatecalls).crates/hero_whiteboard_ui/static/web/css/whiteboard.css— add a.comment-hintclass for the "Supports markdown" hint.Implementation Plan
Step 1: Re-theme mind-map comment popup
Files:
mindmap.js,whiteboard.csscomment-popover; drop inline background/border/padding/box-shadow/max-width. Keep only positional inline styles (position,left,top,z-index).<div class="comment-popover-header"><span class="comment-popover-title">Comment</span><button class="comment-close-btn" id="mm-comment-close">×</button></div>.<div class="comment-body" style="padding:8px 12px;">.class="comment-new-textarea", drop inline styles. Keep placeholder + pre-filled value.class="comment-hint"(new CSS rule).<button class="comment-btn delete">Remove</button>and<button class="comment-btn submit">Save</button>.stageBox,transform.point), the wrapper idmm-comment-popup, the close-button idmm-comment-close, and all event handlers unchanged socloseCommentPopup/_commentOutsideHandlerkeep working.Add to
whiteboard.css(next to existing.comment-popoverrules):Dependencies: none
Acceptance Criteria
nodeData.comment, re-renders the mind map, broadcasts the update.nodeData.comment, removes the 💬 indicator on next render, broadcasts the update.Notes
The
mindmap-comment-bgtoken is also used for the node text edit input (separate from the comment popup). Leave those theme tokens in place for this issue — only the comment popup changes.Validation
cargo check --workspacecargo test --workspace --libImplementation summary
Changes
crates/hero_whiteboard_ui/static/web/js/whiteboard/mindmap.js— rewroteshowCommentPopupto build the popup from the shared.comment-popover/.comment-popover-header/.comment-popover-title/.comment-close-btn/.comment-body/.comment-new-textarea/.comment-hint/.comment-btn submit/.comment-btn deleteclasses used by the rest of the canvas. Removed the hardcoded inlinestyle.cssTextstrings and the reads ofmindmap-comment-bg/mindmap-comment-border/mindmap-comment-text/mindmap-comment-accent/mindmap-placeholder-texttheme tokens for the popup chrome. Removed hardcoded button colors#007AFF/#495057. Preserved positioning math, themm-comment-popup/mm-comment-closeids, the click-outside handler, and the Save / Remove behavior (renderMindmap(group)+WhiteboardSync.onUpdate(group)).crates/hero_whiteboard_ui/static/web/css/whiteboard.css— added one rule: for the "Supports markdown. Links: text" hint.The
mindmap-comment-*theme tokens were left intact inthemes.jsbecause they are still used by the mind-map node-edit input (a separate widget from the comment popup).Validation
cargo check --workspace: passcargo test --workspace --lib: pass (matches CI)Notes
This is a UI-only change — the visual outcome should be confirmed in the browser by opening a board, creating a mind map, right-clicking a node, and choosing Add Comment. The popover should now match the look of comment popovers on sticky notes / shapes / frames / standalone canvas comment markers, and should re-theme correctly when the whiteboard theme changes.