Skip to content

style(editor): compact buttons with shared radius tokens - #94

Merged
utpalsinghdev merged 3 commits into
mainfrom
style/compact-buttons
Nov 19, 2026
Merged

utpalsinghdev merged 3 commits into
mainfrom
style/compact-buttons

Conversation

@utpalsinghdev

Copy link
Copy Markdown
Owner

Summary

Buttons, menu items and fields in the editor were sized one rule at a time. Text buttons ranged from 32 to 40 px tall depending on the screen (Export 37.5 px, File 35.5 px, Home project rows 40 px, menu items and dialog buttons 36 px, comment Save 32 px), and corner radii were a mix of 2, 3, 4, 5, 6 and 8 px. The result felt heavy next to the denser parts of the editor and looked inconsistent from one surface to the next. The project website already moved to a tighter, single-radius button style, so the editor should follow the same direction at editor density.

This PR adds two radius tokens and two control-height tokens in apps/web/src/styles.css and applies them to every text button, field, menu and dialog. Desktop text buttons and fields are now one height (32 px) with a 4 px control radius, and larger surfaces share one 6 px radius. Narrow screens keep a 36 px regular height so tap targets stay comfortable. Colors, layout, behavior and focus treatment are unchanged.

What users will see

  • On desktop, Export, File, Home, the project switcher, Review, menu items, dialog and Home buttons, comment Cancel and Save, inputs, selects and the Properties fields all measure 32 px tall. Menu rows are a little tighter.
  • Corner radii are consistent: controls 4 px, menus, dialogs, the comment box, toast and zoom cluster 6 px. Help and Projects dialogs go from 8 px to 6 px.
  • Icon buttons, the tool rail and the narrow Layers, Properties and Review tabs keep their sizes. The 36 px regular height on narrow screens means File and Export menu rows there are about 2 px taller than before, and the header Export button about 1 px shorter.
  • Keyboard focus rings look the same: 2 px blue outline with a 2 px black separation.
  • No shortcuts, defaults or behavior change.

Affected areas

  • Editor UI, navigation, keyboard controls
  • Document schema, migration, assets, native backup format
  • Commands, rendering, layout, undo/redo
  • MCP tools, targets, revisions, capabilities
  • Saving, recovery, concurrent editing
  • Import, export, fonts, visual fidelity
  • Runtime, release, dependencies, docs/feature-delivery.md (DESIGN.md and a patch changeset only)

CSS and docs only. The document model, commands, MCP, saving and import/export are untouched, so those paths do not apply.

Tokens

Token Before After
--radius-control 2, 3, 4 px mixed 4 px
--radius-surface 4, 5, 6, 8 px mixed 6 px
--control-height 32, 33, 34, 36, 38, 40 px and padding-driven (about 35 to 38 px) 32 px above 900 px, 36 px at 900 px and below
--control-height-compact 26, 27, 28 px 28 px

Screenshots

Same synthetic workspace and state for each pair, Chromium. Before is origin/main.

Desktop, 1440 x 1000

Editor with a layer selected (header, tool rail, Properties fields, Arrange buttons, zoom):

Before After
Before: editor with a rectangle selected at 1440 px After: editor with a rectangle selected at 1440 px

File menu open:

Before After
Before: File menu open at 1440 px After: File menu open at 1440 px

Export menu open:

Before After
Before: Export menu open at 1440 px After: Export menu open at 1440 px

Projects dialog:

Before After
Before: Projects dialog at 1440 px After: Projects dialog at 1440 px

Comment composer:

Before After
Before: comment composer at 1440 px After: comment composer at 1440 px

Narrow, 390 x 844

Properties panel scrolled to Arrange:

Before After
Before: Properties panel with fields and Arrange buttons at 390 px After: Properties panel with fields and Arrange buttons at 390 px

File menu open:

Before After
Before: File menu open at 390 px After: File menu open at 390 px

Comment composer:

Before After
Before: comment composer at 390 px After: comment composer at 390 px

Verification

Run on Node 24.22.1 and pnpm 12.21.0 in the feature worktree, final commit:

  • corepack pnpm run check: passed.
  • corepack pnpm run build: passed (Vite's existing chunk size warning only).
  • corepack pnpm run changeset:status --since=origin/main: passed, @open-cavas/web patch.
  • git diff --check origin/main..HEAD: clean.

Real browser (Chromium via agent-browser, dev server on its own ports, synthetic workspace) at 1440 x 1000 and 390 x 844:

  • Header, File and Export menus, tool rail, Properties fields and Arrange buttons, Help dialog, Projects dialog, Home, workspace chooser and the comment composer were opened and compared against origin/main. Review panel was checked on desktop only.
  • Measured sizes with getBoundingClientRect: desktop text buttons, menu items, selects, color field and numeric fields all 32 px; narrow equivalents 36 px; icon hit areas and the 40 px narrow tab strip unchanged. Every measured control reported a 4 px radius.
  • No horizontal page overflow and no clipped button labels at either width.
  • Keyboard Tab through the header (9 stops at each width): every stop reported :focus-visible with a 2 px blue outline and the black separation shadow.
  • Two controls missed the token on the first pass (Home inputs and Review Comment/Place pin buttons kept vertical padding). Both were found by measuring and fixed before this PR.

Not covered: Firefox and Safari, a real touch device, the Review list with existing threads, and the narrow Projects dialog beyond measurements. Label weight and letter spacing were not changed: only Export uses weight 500 among buttons, so nothing felt heavy enough to lighten.

Docs and limits

  • DESIGN.md has a new Control sizing section with the token table and the fixed sizes that stay outside it, and drops the old "3 to 5 px" radius line.
  • .changeset/compact-buttons.md adds a patch note for @open-cavas/web.
  • docs/verification.md is not updated with these browser results.
  • Outlined buttons keep a 1 px border instead of the inset shadow the website uses, because the editor's focus style already uses that shadow for its black separation.
  • Row heights in Layers and Pages (32 to 35 px) and the tool rail (36 px) are intentionally outside the new tokens.
  • The 23 px narrow heading buttons in the Projects dialog are unchanged from before.

🤖 Generated with Claude Code

Replace the mix of 2 to 8 px radii and ad-hoc button heights with two
radius tokens and two control-height tokens. Desktop text buttons,
menu items and fields are 32 px tall (was 34 to 40 px); narrow screens
keep a 36 px regular height. Icon hit areas, tab strip heights and
focus rings are unchanged. Document the tokens in DESIGN.md.
Comment on selection and Place pin kept 8 px vertical padding, so they measured 34 px instead of the 32 px control height token.
@utpalsinghdev
utpalsinghdev merged commit a9d8d2c into main Nov 19, 2026
1 check passed
@utpalsinghdev utpalsinghdev mentioned this pull request Nov 19, 2026
2 tasks done
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