Skip to content

refactor(ui): refine Button proportions and interaction hierarchy - #901

Merged
Astro-Han merged 16 commits into
mainfrom
refactor/ui-button-hierarchy
Jul 13, 2026
Merged

refactor(ui): refine Button proportions and interaction hierarchy#901
Astro-Han merged 16 commits into
mainfrom
refactor/ui-button-hierarchy

Conversation

@Astro-Han

Copy link
Copy Markdown
Contributor

Summary

  • Refine the shared Button primitive into governed 32px default and 28px compact tiers with one 13px bilingual type tier.
  • Simplify the neutral hierarchy to secondary, ghost, and quiet; remove the outline and layout-free nav escape hatches.
  • Make hover, active, focus, and disabled states visually distinct, and expand Storybook coverage for CJK, English, mixed labels, icons, sizes, variants, and disabled controls.

Why

The shared Button had accumulated 28px, 30px, 32px, 36px, and 40px paths, while compact consumers compensated with local geometry and hover rules. That made Chinese and English labels appear inconsistent and blurred the hierarchy between solid actions, bordered secondary actions, and quiet controls.

This change restores the primitive as the single authority for action proportions and interaction states. Composite navigation rows remain in their existing semantic seams instead of pretending to be another Button size.

Closes #878.

Scope

  • No per-language CSS or language-specific sizing.
  • No new typography, control-height, or interaction-state tokens.
  • No parallel Button primitive.
  • Composite sidebar, session, and artifact rows keep their semantic layouts; standard actions use the governed Button tiers.

Verification

  • npm --workspace @maka/ui test — 128 tests passed.
  • npm --workspace @maka/desktop test — 2,415 tests passed.
  • npm run typecheck — all workspaces passed.
  • Storybook real-browser computed styles, light and dark:
    • default / compact heights: 32px / 28px
    • CJK and English labels: 13px
    • solid / neutral weights: 500 / 400
    • secondary border: 1px
    • hover, active, focus, and disabled states are pairwise distinguishable
    • disabled opacity: 0.45
  • Representative Electron visual smoke reviewed for settings actions, compact chat actions, destructive permission dialog, and composite sidebar rows. All four screenshots rendered successfully; the existing macOS harness reached its 60s cleanup threshold after capture.

Button hierarchy

Before After
Button variants before Button variants after

Interaction states

Before After
Interaction states before Interaction states after

Impact

Button consumers now use a smaller governed default height, neutral text uses normal weight, and outline, lg, and nav are no longer valid Button options. Existing consumers are migrated in this PR; no operator action or data migration is required.

Reviewer notes

Please focus on the shared variant matrix, the distinction between ghost and quiet text tone, and the semantic separation between standard actions and composite navigation rows.

Ready for review

  • Verification is complete and the results above are current
  • Impact, compatibility, migration, documentation, and release-note needs are addressed
  • User-visible UI/UX changes include visual evidence, or Verification explains why it is not applicable

@Astro-Han
Astro-Han force-pushed the refactor/ui-button-hierarchy branch from 4a20293 to 6c35908 Compare July 13, 2026 18:10
@Astro-Han
Astro-Han marked this pull request as ready for review July 13, 2026 19:24
@Astro-Han
Astro-Han merged commit 0af06d3 into main Jul 13, 2026
3 checks passed
@Astro-Han
Astro-Han deleted the refactor/ui-button-hierarchy branch July 13, 2026 19:25
Astro-Han added a commit that referenced this pull request Jul 15, 2026
…ill shape (#1028)

#901 retired the composer consumer-layer button CSS
(maka-composer-tool-button / maka-composer-context-plus /
maka-composer-send-button) onto the shared Button, but the shared
primitive had no governed replacement for the circle — its only radius
is the control-tier rounded-sm — so the "+" affordance (hover included)
and the send button silently went square.

Add a `shape` axis to buttonVariants (default / pill) so the pill tier
lives on the governed primitive, opt the composer "+" and send buttons
into shape="pill", and extend the radius-converge contract with
`alsoTiers` so a component can legitimately serve more than one radius
tier (buttonVariants: control + pill). The utility-primitives contract
now asserts the composer buttons carry shape="pill", and button.test.ts
locks that tailwind-merge resolves pill over the base rounded-sm.
Astro-Han added a commit that referenced this pull request Jul 16, 2026
docs/screenshots/ holds issue-878 and AskUserQuestion evidence images
(#901, #939). No tracked file references them, and the PR bodies embed
them via raw URLs pinned to PR-branch SHAs, which GitHub keeps serving
(verified HTTP 200) independently of main.
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.

refactor(ui): refine Button primitive proportions and interaction hierarchy

1 participant