Skip to content

feat(ui): add UI size setting for larger touch-friendly controls#41

Open
eugenioenko wants to merge 1 commit into
mainfrom
feat/ui-size
Open

feat(ui): add UI size setting for larger touch-friendly controls#41
eugenioenko wants to merge 1 commit into
mainfrom
feat/ui-size

Conversation

@eugenioenko
Copy link
Copy Markdown
Owner

Summary

  • New UI size setting (Default / Large) in the Settings tab, persisted in useOptionsStore (v6).
  • At Large, interactive controls scale to ~44px — iOS HIG and WCAG 2.2 AAA minimum — so finger drawing is actually usable without touching text, layout spacing, or the rest of the chrome.
  • An app-root effect syncs the choice to document.body.dataset.uiSize; a body[data-ui-size="large"] block in index.css overrides the :root CSS variables that every affected primitive reads.

What scales

  • ButtonGroup min-height follows --ctrl-h; items-center keeps children aligned at any container height.
  • SlideInput: wrapper width & max-width, icon buttons (--ctrl-icon-btn), and Tabler icons inside them (--ctrl-icon).
  • ColorInput: hex/alpha input width & padding, percent icon button, swatch (fills the left-pad area at large with no inset; keeps its 18px look with a 4px inset at default).
  • Toolbar tool buttons (single + ToolGroup) get a .toolbar-btn class that forces 44×44 at large, auto at default (unchanged look).
  • Top navbar height via --nav-h: 48px default → 56px at large.

What doesn't scale

Body text, tooltips, labels, section titles, panel width, color palette, canvas handles, status bar — all unchanged. Scope was intentionally limited to the interactive primitives that hurt with a finger.

Other

  • ToggleButton now honours its className prop (was silently dropped).
  • Tool-options dropped its per-call max-w-24 on each SlideInput; the new --slider-input-max-w inside the primitive caps them consistently for both scopes.
  • Removed the old versioned migrate block on the store; fresh localStorage assumed (new version: 6).

Test plan

  • Toggle UI size in Settings; ButtonGroup buttons, SlideInputs, ColorInputs, and toolbar tool buttons all grow/shrink.
  • SlideInput selector chevron lands on the right edge of the input in both modes.
  • ColorInput swatch is 18px with inset at default, fills the left pad area at large.
  • Top navbar resizes between 48 and 56px.
  • Toolbar tool buttons hit 44×44 at large; tool-group popover still opens on hover.
  • Panel layout (properties grid, Stroke section) still fits without horizontal scroll.

🤖 Generated with Claude Code

Add a "UI size" setting (Default / Large) to the Settings tab. Large
mode scales interactive controls to ~44px (the iOS HIG / WCAG 2.2 AAA
touch-target minimum) without touching text, layout spacing, or the
rest of the chrome.

Mechanic
- `uiSize: "default" | "large"` in useOptionsStore, persisted (v6).
- App-level effect writes data-ui-size onto <body>.
- CSS variables in :root carry the base sizes; a body[data-ui-size="large"]
  block overrides them. All affected components read the vars.

Scope
- ButtonGroup min-height tracks --ctrl-h; items-center keeps children
  vertically aligned at any container height.
- ToggleButton honours its className prop (was silently dropped).
- SlideInput wrapper uses a .slide-input-wrapper class with width and
  max-width from vars; icon buttons and their Tabler icons use
  --ctrl-icon-btn and --ctrl-icon.
- ColorInput swatch / alpha button / percent icon all var-driven; the
  swatch size matches --ctrl-h at large so it fills the left pad with
  no inset, and keeps its 18px look with a 4px inset at default.
- Toolbar tool buttons (single and ToolGroup) get a .toolbar-btn class
  that forces 44x44 at large and auto (natural p-1 + 24px icon) at default.
- Top navbar height moves to var(--nav-h): 48px default, 56px at large.
- Tool-options SlideInputs dropped their per-call max-w-24; the new
  --slider-input-max-w inside the primitive caps them consistently.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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