Skip to content

feat(ui): IconButton 44px hit area and no-scale press, with composition spacing - #548

Merged
egdev6 merged 6 commits into
mainfrom
docs/plan-icon-button-hit-area
Nov 23, 2026
Merged

egdev6 merged 6 commits into
mainfrom
docs/plan-icon-button-hit-area

Conversation

@egdev6

@egdev6 egdev6 commented Nov 23, 2026

Copy link
Copy Markdown
Owner

Summary

This PR implements the approved IconButton v0.4 invisible hit area (#540) and v0.5 press feedback. It also brings along the composition adaptations those changes require, each covered by its own approved amendment.

IconButton ((#540))

  • Hit area. Every enabled IconButton gets an automatic invisible target of at least 44px: a static, token-backed 44.8px ::after (--space-14). This works on every pointer type and adds no new prop. The visible size, Material and focus ring are unchanged.
  • Press feedback. The active scale-94 is removed. Chrome feasibility tests showed that every scaled option misdirected clicks at the edge. Pressed paint by variant:
    • ghost/outline: surface-3 plus --shadow-btn-pressed, a non-color depth cue; --shadow-focus still wins when focused;
    • secondary: keeps its pressed paint through a documented, scoped exception for --color-alpha-red-15.
  • Guidance. JSDoc and stories now describe the real 44px behavior and the spacing rule: adjacent extended targets need a visible gap at least one spacing token above the sum of their outsets. A gap exactly equal to that sum overlaps under sub-pixel rounding.

Compositions (approved amendments)

Component Change Visual
SocialLinks v0.2 → v0.3 (#104) gap becomes a per-size minimum: md ≥ gap-5, lg ≥ gap-3; prop values and default unchanged Wider spacing
ListItem v0.3 → v0.4 (#88) ListItemActions gap-1 → gap-5; adjacent sm actions need consumer clearance Wider spacing
Carousel v0.3 Controls gap-2 → gap-3 +3.2px
AttachmentField v0.3 → v0.4 Strip gap-3, root gap-4. The root change fixes Chrome touch adjustment toward the textarea Wider spacing
ButtonGroup v0.2 (#79) Compact targets, attached and spaced, through data-icon-button-target="compact" (direct parent only) None
Tabs v0.6 (#107) Scroll buttons use compact targets. On touch-capable hybrids they stay about 25.6px, accepted because the list also scrolls by dragging None

Compact suppression reads an ancestor data attribute from IconButton's own static recipe. No eg-* marker is used as a styling selector.

Commits

Commit Content
7aa05ea Implementation plan (v0.4 + v0.5)
f00daf5 SocialLinks v0.2, ButtonGroup v0.2, ListItem v0.3 amendments
e29f143 SocialLinks v0.3, ListItem v0.4, Tabs v0.6, Carousel v0.3, AttachmentField v0.3/v0.4 amendments
b66eaf4 Implementation, tests, stories, registry revisions, artifact, harnesses, evidence
f76af4d Verification advisories: overflow note, ButtonGroup comment, compact-rule regression test

The full decision history (owner choices S6–S12, each verbatim) is in odd/tasks/consumer-request-specs.md.

Validation

  • Unit tests. Tests were written to fail first, then made to pass: IconButton 12 failing → 31/31; compositions 6 → 331/331; Tabs 3 → 91/91; Carousel 2 → 69/69; AttachmentField 2 → 101/101; SocialLinks and ListItem 7 → 71/71; marker fix 14 → 134/134. Final runs:
    • focused suites for the 9 affected components: 490/490
    • storybook docgen/controls/css: 507/507
    • pnpm test:props: 132/132
    • artifact tests: 44/44
    • pnpm typecheck, biome, and the props, artifact and system checks all pass
    • after a fresh pnpm build, node --test scripts/package-exports.test.mjs passes 138/138
  • Real browser. Headless Chrome 148 over CDP, static HTML from the built package, LTR/RTL, mouse/touch, normal and reduced motion: 2,104 mouse and 2,104 touch sequences across standalone controls and all six compositions. Each case checked center, edges and corners, at rest and pressed, with a stationary pointer.
  • Independent verification (risk item 3: shipped CSS, press feedback and visible spacing for every consumer app, a new compact-target attribute contract, registry and artifact): PASS with no blockers.
    • All 12 amendment digests match.
    • Across 946 jsdom story renders, the diff against the base shows only approved changes.
    • The registry diff is exactly 43 source.revision fields.
  • Pending: physical devices, assistive technology, the packed React 18/19 consumer (runs in CI). Visual conformity: Not evaluated.

Consumer impact (for release notes)

  • All apps: new press feedback (no shrink) and the 44px target on every IconButton. An IconButton flush against an overflow edge can now create scrollbars or be clipped (CHANGELOG note).
  • Recado: SocialLinks md in About settings (6.4 → 16px) and AttachmentField in Capture.
  • Nexo: SocialLinks md in settings and app details (6.4 → 16px); the news Carousel controls (6.4 → 9.6px).
  • egdev-website: the Hero SocialLinks lg (6.4 → 9.6px).

Linked issue

Refs #540 (closes at the release that ships it, per the consumer requests flow). Related: #104, #88, #79, #107.

SocialLinks v0.2 spacing, ButtonGroup v0.2 hit area and ListItem v0.3 spacing. Refs #540
…area

SocialLinks v0.3, ListItem v0.4, Tabs v0.6, Carousel v0.3, AttachmentField v0.3 and v0.4. Refs #540
Compositions adapt: SocialLinks and ListItemActions spacing, Carousel and
AttachmentField gaps; ButtonGroup and Tabs scroll buttons use compact targets.
@egdev6 egdev6 added the enhancement New feature or request label Nov 23, 2026
@egdev6
egdev6 merged commit 4e9fdaa into main Nov 23, 2026
7 checks passed
@egdev6
egdev6 deleted the docs/plan-icon-button-hit-area branch November 23, 2026 01:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant