Remove shape-type picker from floating selection toolbar #160

Open
opened 2026-05-06 11:49:06 +00:00 by AhmedHanafy725 · 2 comments
Member

The floating selection toolbar exposes a control to change a shape from one type to another (rect → diamond → circle, etc.). This shouldnt be possible from the floating toolbar — type selection happens at creation time. Remove this control from _renderShape in selection_toolbar.js.

The floating selection toolbar exposes a control to change a shape from one type to another (rect → diamond → circle, etc.). This shouldnt be possible from the floating toolbar — type selection happens at creation time. Remove this control from `_renderShape` in `selection_toolbar.js`.
Author
Member

Spec

Root cause / scope

_renderShape in selection_toolbar.js lines ~1040–1052 declares a shapeOpts array and passes it to _buildSelect(...) with a callback that calls WhiteboardObjects.changeShapeType(node, v) and refresh(). This control lets users change a shape's geometric type from the floating toolbar — undesired.

Files to Modify

  • crates/hero_whiteboard_ui/static/web/js/whiteboard/selection_toolbar.js — only file.

Implementation Plan

Step 1 — delete the picker block in _renderShape

Delete the 13 lines from var shapeOpts = [...] through the _buildSelect(shapeOpts, ...) call. Also delete the now-unused var shapeType = objData.shapeType || 'rect'; line above.

Cascading deletions — none

  • WhiteboardObjects.changeShapeType is also called from sync.js:621 (remote sync path) and exported. Keep it — it's part of the realtime contract.
  • _buildSelect is shared with calendar / mindmap / connector renderers. Keep.
  • .wb-pt-select CSS shared by all _buildSelect users. Keep.

Acceptance Criteria

  • Selecting a shape opens the floating toolbar with no shape-type dropdown.
  • Remaining controls unchanged: stroke color, fill color, stroke width, text color, font size, text alignment, edit-text pencil.
  • Lock/unlock unchanged.
  • Multi-select that includes a shape unchanged.
  • No JS console errors.
  • Realtime sync still applies remote shapeType mutations via sync.js.

What NOT to break

  • Shape creation via the canvas tool palette.
  • WhiteboardObjects.changeShapeType export + sync.js callsite.
  • Other _buildSelect users (calendar / mindmap / connector).
  • Existing persisted boards with any shapeType value still load/render.
## Spec ### Root cause / scope `_renderShape` in `selection_toolbar.js` lines ~1040–1052 declares a `shapeOpts` array and passes it to `_buildSelect(...)` with a callback that calls `WhiteboardObjects.changeShapeType(node, v)` and `refresh()`. This control lets users change a shape's geometric type from the floating toolbar — undesired. ### Files to Modify - `crates/hero_whiteboard_ui/static/web/js/whiteboard/selection_toolbar.js` — only file. ### Implementation Plan #### Step 1 — delete the picker block in `_renderShape` Delete the 13 lines from `var shapeOpts = [...]` through the `_buildSelect(shapeOpts, ...)` call. Also delete the now-unused `var shapeType = objData.shapeType || 'rect';` line above. ### Cascading deletions — none - `WhiteboardObjects.changeShapeType` is also called from `sync.js:621` (remote sync path) and exported. **Keep it** — it's part of the realtime contract. - `_buildSelect` is shared with calendar / mindmap / connector renderers. **Keep**. - `.wb-pt-select` CSS shared by all `_buildSelect` users. **Keep**. ### Acceptance Criteria - [ ] Selecting a shape opens the floating toolbar with no shape-type dropdown. - [ ] Remaining controls unchanged: stroke color, fill color, stroke width, text color, font size, text alignment, edit-text pencil. - [ ] Lock/unlock unchanged. - [ ] Multi-select that includes a shape unchanged. - [ ] No JS console errors. - [ ] Realtime sync still applies remote `shapeType` mutations via `sync.js`. ### What NOT to break - Shape creation via the canvas tool palette. - `WhiteboardObjects.changeShapeType` export + sync.js callsite. - Other `_buildSelect` users (calendar / mindmap / connector). - Existing persisted boards with any `shapeType` value still load/render.
Author
Member

Done

Commit d99f817 on development. Removed the shape-type dropdown block from _renderShape (15 lines deleted). WhiteboardObjects.changeShapeType remains exported and is still called from sync.js for remote shape-type updates.

  • cargo check --workspace: pass
  • cargo test --workspace --lib: pass
## Done Commit `d99f817` on `development`. Removed the shape-type dropdown block from `_renderShape` (15 lines deleted). `WhiteboardObjects.changeShapeType` remains exported and is still called from `sync.js` for remote shape-type updates. - `cargo check --workspace`: pass - `cargo test --workspace --lib`: pass
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_whiteboard#160
No description provided.