Floating toolbar dropdown items use hardcoded blue and chevron has no margin #164
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#164
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 styling bugs in the floating selection toolbars dropdowns (font family list, font size presets, kanban column color, alignment, etc.):
Selected item color is hardcoded blue. The
is-selectedstate on dropdown items usesvar(--wb-primary)which resolves to the same blue regardless of the active whiteboard theme. Other selected/active states in the app respect theme accent colors. Either route through a theme-aware token or define--wb-primaryper theme.The dropdown trigger chevron has no left margin — the
bi-chevron-downicon sits flush against the trigger label/value text. Add a small gap (e.g. 4-6px margin-left on the chevron, or gap on the parent flex container) so the trigger reads cleanly.Fix both in
selection_toolbar.css. Sweep the trigger DOM inselection_toolbar.jsif needed to ensure the chevron is consistently the last child with the right class.Spec
Root cause
Bug 1 (selected dropdown items always blue):
--wb-primaryis set per-theme by_applyChromePaletteinthemes.js(~L426) fromtheme['shape-stroke'] || theme['selection-color']. But for the two default themes:shape-stroke = #007AFF(blue)shape-stroke = #0062cc(still blue)So even with theme switching wired correctly, both default themes resolve to blue. The accent should be a dedicated token, not piggybacked on
shape-stroke.Bug 2 (chevron has no breathing room):
The font-size picker chevron (
_buildSizePickerstepper) has.wb-pt-size-steppers { margin-left: 4px; }between input and the chevron buttons. The chevron glyph centered inside a 16px button reads as flush against the input value because the input only has 6px right-padding. Net visual gap is too tight.Files to Modify
crates/hero_whiteboard_ui/static/web/js/whiteboard/themes.js— add anaccentfield per built-in theme;_applyChromePalettereads it.crates/hero_whiteboard_ui/static/web/css/selection_toolbar.css— bump the size-picker gap.Implementation Plan
Step 1 — themes.js: dedicated accent per theme
Add
accentto each built-in theme entry inBUILTIN_THEMES:#007AFF#0062cc#64ffda#f59e0b#6366f1In
_applyChromePalette(~L426), change:to:
No CSS-variable rename needed;
--wb-primarycontinues to drive every existing rule and now genuinely differs per theme. The--wb-primary-textluma computation already in_applyChromePalettekeeps text readable on any accent.Step 2 — selection_toolbar.css: chevron gap
Replace
.wb-pt-size-steppers { margin-left: 4px; ... }withgapon the parent flex container so the spacing matches the rest of the toolbar'swb-pt-group { gap: 4px; }pattern:Acceptance Criteria
--wb-primary-textluma logic).What NOT to break
applyTheme()still calls_applyChromePalette()first.--wb-primary-textluma computation.--wb-primary(tool-btn.active, btn-primary, prop-btn.active, emoji-cell.selected, etc.) — they pick up the new theme accent, which is the intended behavior.Done
Commit
2f7755condevelopment.themes.js: each built-in theme now has anaccentfield, and_applyChromePaletteuses it ahead ofshape-stroke/selection-color. Dark: #007AFF, Light: #0062cc, Ocean: #64ffda, Warm: #f59e0b, Minimal: #6366f1.selection_toolbar.css: size-picker now usesgap: 6pxon the parent flex; the steppers'margin-leftis dropped.cargo check --workspace: passFollow-up
Commit
ad5c8b3. Root cause:_buildSelectwas a native<select>— the OS draws its dropdown with the OS accent (always blue), so--wb-primarycouldn't reach it. Rewrote_buildSelectto render a button + chevron and open awb-pt-popoverwithwb-pt-font-itemrows; the theme accent now applies to the selected row. Affects calendar mode, mindmap direction, connector style. Theme switching now visibly recolors the selection in all three.cargo check --workspace: pass