Workspace: 5 of 6 LeftToolbar tools are cosmetic (select/auto-digitize/manual-stitch/text/shapes never read); bring-to-front/send-to-back skip pushHistory; BottomThreadBar selectedColorId is always null #95
Labels
No labels
blocked:commit-ready-failed
blocked:gate-fetch
blocked:gate-lint
blocked:gate-plan
blocked:gate-research
blocked:needs-attention
blocked:needs-decision
blocked:needs-human
blocked:no-changes
blocked:verify-failed
bug
deferred
feature-request
in-progress
needs-decompose
needs-triage
quickfix
security/medium
triage-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/Kimi_Agent_Brother_10_Digitizing_App#95
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?
Where:
src/pages/Workspace.tsx,src/components/workspace/CanvasArea.tsx,src/components/workspace/BottomThreadBar.tsx,src/components/workspace/LeftToolbar.tsx.Bug: Three independent issues in the Workspace surface, all same orphan-state family as #91 / #94 / #88.
Bug 1 —
state.activeToolis only consumed for 'zoom'; the other 5 tools are decorative.The
Tooltype (src/components/workspace/types.ts:9) enumerates six values:'select' | 'auto-digitize' | 'manual-stitch' | 'text' | 'shapes' | 'zoom'. TheLeftToolbar(src/components/workspace/LeftToolbar.tsx:28-33) renders a button for each. The reducer handlesSET_TOOLand stores it (useWorkspace.ts:142-143). But grep for actual consumers:Only ONE production read:
CanvasArea.tsx:165checkingstate.activeTool === 'zoom'for wheel-pan-vs-zoom behaviour. The five tools'select','auto-digitize','manual-stitch','text','shapes'are never consumed.So:
The toolbar buttons highlight (via
isActive = activeTool === tool.id, LeftToolbar.tsx:60) so the user sees the click registered, but no UI consequence follows. Same orphan-UI family as #91 (EditorRightPanel dead branches), #94 (EditorThreadBar static data), #88 (region-classifier orphan).Bug 2 —
handleBringToFrontandhandleSendToBack(Workspace.tsx:224-235) dispatchSET_STITCH_OBJECTSdirectly withoutpushHistory.SET_STITCH_OBJECTS(useWorkspace.ts:163-164) just replaces the array — no history. Compare withDELETE_SELECTED(L236),DUPLICATE_SELECTED(L257),GROUP_SELECTED(L286),UNGROUP_SELECTED(L301) which all wrap the return inpushHistory(...). Z-order changes are un-undoable. Same family as #92 (UPDATE_OBJECT, ADD/REMOVE/REORDER_THREAD_STOP also skip pushHistory).Bug 3 —
BottomThreadBar.selectedColorIdis alwaysnull.Workspace.tsx:284:<BottomThreadBar ... selectedColorId={null} />. The bar acceptsselectedColorId: string | null(BottomThreadBar.tsx:12) and uses it to computeisSelected = selectedColorId === stop.colorId(L62) for visual highlighting. Sincenullnever equals astop.colorId, no thread stop is ever visually selected in the bar. ThehandleSelectStopcallback (Workspace.tsx:181-187) does fire — it dispatchesSELECTfor objects matching the clicked color — but the bar can't reflect "you picked blue" becauseselectedColorIdis never updated.Compare with
EditorThreadBar(#94) which actually tracksselectedThreadIndex. The Workspace'sBottomThreadBarshould either:SELECTand reflect "currently selected objects' color", orselectedColorIdstate viauseStatein the bar and update it on click.Fix consistent with existing patterns:
For Bug 1, two paths:
LeftToolbar.tsx:28-33, drop the four tools with no consumers ('auto-digitize', 'manual-stitch', 'text', 'shapes'). Keep 'select' (the default — and as a placeholder for any future selection UI) and 'zoom' (the only one with real behavior). Trim theTooltype to'select' | 'zoom'. The keyboard shortcuts in Workspace.tsx:75-82 also need pruning (dropa, s, t, r).Recommended: Honest path. ~20 LOC removed, no UX regression (the dead buttons are misleading anyway).
For Bug 2, wrap each return in
pushHistory(...)like the four working actions do. Two-line change.For Bug 3, change
selectedColorId={null}(Workspace.tsx:284) toselectedColorId={selectedIds.length > 0 ? (stitchObjects.find((o) => selectedIds.includes(o.id))?.colorId ?? null) : null}. The bar's click handler can also update local selectedColorId for selection-mode UX, but at minimum the prop should reflect current selection.Severity: Bug 1 = medium (misleading toolbar; 4 buttons do nothing), Bug 2 = low (a single un-undoable action), Bug 3 = low (visual highlight never works).
Cross-references: #91 (EditorRightPanel dead Sequence/Underlay branches), #92 (useWorkspace reducer history gaps — same UPDATE_OBJECT-style gap), #94 (EditorThreadBar static data).
convert_nodeandscissorsare in the toolbar (TOOL_MODES) but EditorCanvas.tsx ignores them — picking them does nothing on the canvas (2 of 8 tools) #143