computeFitToViewport and computeFitToHoop exist in canvasFit.ts with full test coverage but the Workspace's canvas has no button to invoke them — #160 landed for the Editor only #180
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#180
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
src/components/workspace/canvasFit.ts(referenced by 9 tests incanvasFit.test.ts) exportscomputeFitToViewportandcomputeFitToHoop— the math for "fit the design to the visible canvas area" and "fit the design to the hoop's bounds."grep -rn 'computeFitToViewport\|computeFitToHoop' src/components/returns 11 hits, all of them incanvasFit.test.tsand the function definitions themselves. No production component invokes either function.The Editor has the wired affordance:
handleFitAllToViewis passed asonFitToViewtoEditorToolbar(line 892 ofEditor.tsx), which renders a Fit-to-View button atEditorToolbar.tsx. The Workspace'sAppHeader,BottomThreadBar,LeftToolbar, andCanvasAreahave no fit-to-view button.A user with a 6000×4000px design in the Workspace scrolls the wheel to zoom out, scrolls the wheel to zoom out more, and the design is still bigger than the visible canvas. They can't quickly "fit everything to the screen" without manually computing the right zoom.
Where
src/components/workspace/canvasFit.ts(computeFitToViewport,computeFitToHoop)src/components/workspace/canvasFit.test.ts(9 tests, no consumer)src/components/editor/EditorToolbar.tsxsrc/components/workspace/AppHeader.tsx(where the "Save to Gallery" / "Export" buttons live — the natural home for a fit-to-view button)Suggested fix shape
Add a Fit-to-View button to the Workspace's
AppHeader(next to the existing zoom controls or the Split View toggle):A keyboard shortcut "F" or "0" should also trigger the fit (the Editor's
useKeyboardShortcutsalready handleszfor zoom; the Workspace would need a similar hook — see #156).Severity
Medium. The math is implemented and tested; the UI is the only missing piece. Same family as the Editor's fit-to-view fix.
Discovered by
Gap analysis (2026-10-02) of canvas affordances.
Related
fix(#180): Workspace now has a Fit-to-View button + F keyboard shortcut.
Commit
eaa4c2bon main. computeFitToViewport (with full 9-test coverage) is now wired into the Workspace UI:workspace:fit-to-view.3 new AppHeader tests + 1 new useKeyboardShortcuts test pin the contract. Full workspace suite green (414 tests pass).