Skip to content

Match Canvas command toolbar spacing to Normal mode - #843

Merged
onevcat merged 1 commit into
mainfrom
fix/canvas-command-toolbar-spacing
Oct 1, 2026
Merged

onevcat merged 1 commit into
mainfrom
fix/canvas-command-toolbar-spacing

Conversation

@onevcat

@onevcat onevcat commented Sep 30, 2026

Copy link
Copy Markdown
Owner

Summary

In Canvas mode, the Run and custom-command buttons sat closer together than in Normal and Shelf mode, and the capsule had smaller edge margins.

Cause: Normal and Shelf render each button as its own NSToolbar item, and NSToolbar gives every item a horizontal inset. Canvas renders the whole cluster as one item (an approved exception that prevents the insert/remove jump when switching cards), so it gets that inset only once. The old HStack(spacing: 0) assumed the Normal buttons sit nearly flush, which is not true on the current OS.

Fix: CanvasCommandCluster adds the inset back: HStack spacing 3.5pt and horizontal padding 3pt. The cluster is now a helper, canvasCommandCluster, to keep canvasToolbarContent within the lint body-length limit. The docs-ai 061 toolbar guide records the new rendering.

Verification

  • Isolated Debug instance in Chinese UI with Run + Build + Test: pixel measurements from window screenshots (2x) are the same in Normal, Canvas, and Shelf mode. Capsule width is 417px, leading/trailing margins are 22/19px, and button gaps are 38/37px. Before the fix, Canvas was about 28px narrower.
  • make check and make build-app pass.

The Canvas Run/custom-command cluster is one toolbar item, so NSToolbar
adds its horizontal inset only once. Add the missing per-item inset back
as HStack spacing and horizontal padding so the capsule matches the
Normal and Shelf toolbars.
@onevcat
onevcat merged commit 436fc1e into main Oct 1, 2026
1 check passed
@onevcat
onevcat deleted the fix/canvas-command-toolbar-spacing branch October 1, 2026 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant