Floating toolbar shows leading divider when there are no per-type props or only lock #163
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#163
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?
Two related divider bugs in the floating selection toolbar:
The divider visibility logic in
selection_toolbar.js(_showPropsGroupand the equivalent for comments) should hide the divider whenever the trailing group is empty. Currently it only checks visibility, not whetherpropsElhas any children.Spec
Root cause
DOM:
[Lock] [divider] [propsEl]. The divider's visibility is coupled topropsElvia_showPropsGroup(visible)(lines 107–110), which toggles both together. Two symptoms:_renderForNodeswitch has nocase 'emoji'— falls throughdefault, leavespropsElempty.update()calls_showPropsGroup(true)regardless. Result: stray divider + empty props. (Same applies to any renderer that early-returns or adds nothing — drawing, calendar without state, kanban, mindmap, group.)_showLockGroup(!allComments)), but_renderCommentpopulatespropsElandupdate()calls_showPropsGroup(true). Result: leading divider with no Lock before it.Both bugs are one design defect: divider visibility coupled to props only, not to the joint condition
Lock visible AND props non-empty.Files to Modify
crates/hero_whiteboard_ui/static/web/js/whiteboard/selection_toolbar.js— only file.Implementation Plan
Step 1 — decouple the divider from
propsEl_showPropsGroup(visible)toggles ONLYpropsEl.style.display. Drop the divider toggle._updateDivider():_updateDivider()at every site that currently mutates Lock-or-props visibility:update()after the props branch resolves (both single-unlocked and multi-/locked paths).showConnector()after_renderConnector(id)+_showPropsGroup(true).refresh()after re-renderingcachedNode.hide()after_showPropsGroup(false).Resulting behavior:
propsEl: Lock visible, propsEl visible butchildren.length === 0→ divider hidden.Acceptance Criteria
What NOT to break
_clearProps()'s call to_closeOpenPopover().is-visibleclass toggling viashow()/hide().reposition()depending onshow()being called first._showLockGroup(false)for comment and connector modes.setColor()/activeColorSetterlifecycle in_clearProps().Done
Commit
b5c9f32ondevelopment. _showPropsGroup now toggles only propsEl; a new _updateDivider() helper checks Lock-visible AND props-visible AND props-non-empty, and is called from hide(), tail of update(), refresh() (node path), and showConnector().cargo check --workspace: pass