Workspace and Editor canvases have no Fit-to-View / Reset Zoom button — Editor listens for editor:fit-to-view event but nothing dispatches it #160
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#160
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?
Finding
The Workspace and Editor canvases have no "Fit to View" or "Reset Zoom" button. The user can scroll and zoom with the wheel (Workspace's
handleWheelatCanvasArea.tsx:188-204and Editor's wheel handler), but there's no way to recenter the view or reset the zoom to 1.0x without manually wheeling.The Editor's
EditorCanvas.tsx:459-460listens for aeditor:fit-to-viewwindow event (window.addEventListener('editor:fit-to-view', handler)) but nothing dispatches that event anywhere. The listener is dead. The event-based design anticipates a button somewhere in the editor toolbar that triggers it, but no such button exists.The Workspace has no such infrastructure at all.
Where
src/components/workspace/CanvasArea.tsx:188-204src/components/editor/EditorCanvas.tsxsrc/components/editor/EditorCanvas.tsx:459-460src/components/editor/EditorToolbar.tsx(no fit-to-view button)Suggested fix shape
Two additions:
Workspace canvas: add a "Fit" button to the Bottom Thread Bar (or the AppHeader) that dispatches the existing
viewportreset:viewport.zoom = 1,viewport.panX = 0,viewport.panY = 0viadispatch({ type: 'SET_VIEWPORT', viewport: { zoom: 1, panX: 0, panY: 0 } })Editor canvas: add a "Fit" button to the EditorToolbar that dispatches the
editor:fit-to-viewevent the canvas already listens for. The button should be enabled when the camera is not at the default position.The Workspace's zoom/pan is already in the reducer (
viewport.zoom,viewport.panX,viewport.panY). The button is a one-line dispatch.Severity
Medium. The user has to manually wheel-zoom back to 100% and scroll to center, which is tedious. A "Fit" button is a standard canvas affordance.
Discovered by
Gap analysis (2026-10-02) of canvas affordances.
Related
Fixed in commit
edeb88aon main.Editor: EditorToolbar now has a Maximize-icon Fit-to-View button (placed between the tool divider and Settings). It dispatches the new
editor:fit-all-to-viewwindow event. EditorCanvas listens for it and centers the camera on the union bounding box of all visible paths, using the existingcomputePathsBoundingBoxhelper. The pre-existing per-patheditor:fit-to-viewlistener is unchanged and still serves the right-panel Fit button.Workspace: the existing Maximize button in the zoom HUD was hidden until
appState === 'digitized', but the wheel handler is active fromimage-uploadedonward — so users who panned/zoomed in earlier states had no way to recenter. Widened the gate to includeimage-uploadedanddigitizing. (Side effect: the hoop-size indicator also shows earlier, which is informational and harmless.)Tests: 3 new cases for the global-fit listener (visible paths, no paths, all hidden). 691/691 pass; tsc clean.
computeFitToViewportandcomputeFitToHoopexist incanvasFit.tswith full test coverage but the Workspace's canvas has no button to invoke them — #160 landed for the Editor only #180