Skip to content

test(rtl): enforce native touch target dimensions and remove centering exemption - #7848

Merged
nynexman4464 merged 1 commit into
mainfrom
fix/rtl-native-target-size
Oct 27, 2026
Merged

nynexman4464 merged 1 commit into
mainfrom
fix/rtl-native-target-size

Conversation

@nynexman4464

@nynexman4464 nynexman4464 commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Rebased validation — 2026-10-27

Rebased onto main ad427c274995826177dd851d8a798c18391da161; head is 706a76e5931534a23a841cdddfcf806d8b4e2ab2. No conflicts. git range-diff reports the same focused patch: 9 files, 260 additions, 90 deletions. No component or product behavior changes were added during the rebase.

Fresh local validation on the rebased head:

  • D7 Chromium regression suite: 9/9 passed. The three size regressions fail against a runner byte-identical to the new main base, because the base incorrectly exits 0 for undersized native inputs.
  • RTL routing/coverage/pool/shard/completion suites: 101/101 passed.
  • CheckboxInput, RadioList, and Switch suites: 161/161 passed.
  • Rebuilt Storybook mutation: the base passes all three centered 20×20px native targets (exit 0); the rebased runner fails all three (exit 1); restoring native expansion passes all three again (exit 0). Restored native dimensions remain 24×24px for CheckboxInput/RadioList, and 32×24px sm / 40×24px md for Switch, in both directions.
  • Full scoped RTL audit: exact 3/3 D1 and 58/58 D5/D6 completion identities; D2/D4/D7 pass; 3 measured components, no failures, gaps, or stale evidence.
  • Package builds, static Storybook build, Storybook typecheck, pnpm check:repo, lint of the three formerly exempt components, and diff whitespace checks passed. Lint retains one existing unused-import warning in Switch.
  • The testing authority route was reevaluated against the new base/head. The matched records and claims are unchanged: architecture:rtl-audit-evidence INV1–INV4, INV6, INV9/INV10, INV12–INV14, INV16; architecture:component-test-sufficiency INV1–INV7, INV10/INV11; AST-030 FR7/FR11.

Fresh GitHub CI must rerun on this head; previous green CI and approval receipts below belong to the original head. Engineering-owner approval is still required for the architecture record. No merge or auto-merge is requested.


Maintainer impact

The three coarse-pointer controls already use rtlStyles.centerInline() and keep their native inputs at least 24px in each dimension, but their obsolete lint exemption still permits unsafe logical centering to return. D7 also reports a centered, hittable input as passing even when its native box has shrunk below that minimum. A green audit can therefore miss a smaller touch target.

Intended invariant

  • architecture:rtl-audit-evidence INV9/INV10: prove the gate with mutations; measure native target size as well as alignment.
  • design:bidirectionality DR8/DR12: retain the same centered, adequately sized target in LTR and RTL.
  • The curated CheckboxInput, RadioList, and Switch targets retain their existing 24×24px coarse-pointer minimum. This is target-owned metadata, not a new universal audit floor or a change to WCAG exceptions.

Change

  • Delete the three-file ESLint override, the allowLogicalCentering option/schema branch, and its exemption-only tests. Keep all physical-property and unsafe-centering diagnostics; assert the rule has no options.
  • Have D7 compare the native input's measured width and height to minimumTargetSize, while retaining center-point hit testing and the existing alignment tolerance.
  • Report native and wrapper boxes separately, plus the minimum and individual hit/alignment/size outcomes. Missing or invalid minimum dimensions produce an error.
  • Add a Chromium regression suite to the existing RTL lane, once in Core part 1. Cold-clone unit tests still require no browser.
  • Update only the D7 implementation-state and verification descriptions in the existing architecture record. No normative product intent or new specification owner.

Overlap check

Open #7489 changes D1 fixture selection in the same runner/README; #5885 changes N/A evidence admission/coverage. Neither changes D7 or the removed lint option. This PR leaves those mechanisms and their unresolved decisions alone. No open PR was found for allowLogicalCentering or D7. The current records were checked on base b0981237c0440a680a33580f7a99fa85b2f05bbd.

Evidence

Failure before the change: the new 23×24, 24×23, and 20×20 native-input regression cases all fail against the pinned base D7 implementation: each expects audit exit 1 but receives exit 0. Each fixture has a 64×64px wrapper, so it cannot pass by measuring only the wrapper.

Success after the change: all nine Chromium tests pass. The exact 24×24 boundary passes; independent width/height reductions fail while centering and center hits remain true; displaced and occluded inputs still fail; invalid/missing minima are errors. Every geometry case exercises CheckboxInput, RadioList, and Switch routes in LTR/RTL at sm/md.

Real built Storybook mutation: shrink only the native checkbox/radio inputs to 20×20px, suppressing their CSS minimums without moving their centers. The base runner passes all three D7 targets (exit 0). The changed runner fails all three (exit 1), retaining hit=true, centered=true, and size=false. Restore the untouched built Storybook: all three pass (exit 0).

Restored native dimensions are identical in LTR and RTL:

  • CheckboxInput and RadioList: 24×24px at sm/md, including controls whose visible sm wrapper is only 20×20px.
  • Switch: 32×24px at sm and 40×24px at md.

Product/runtime behavior verified unchanged: no component source, public types, styles, stories, or callbacks changed. The full scoped built-Storybook audit completes 3/3 D1 and 58/58 D5/D6 scans with exact planned/completed identities, all curated D2/D4/D7 checks passing, 3 measured components, and no failures/gaps/stale evidence. Existing component tests pass 159/159.

Repeat the red/green browser test

After pnpm install --frozen-lockfile and pnpm exec playwright install chromium:

git show b0981237c0440a680a33580f7a99fa85b2f05bbd:apps/storybook/rtl-audit/rtl-audit.mjs > apps/storybook/rtl-audit/rtl-audit.before.mjs
ASTRYX_RTL_BROWSER=1 ASTRYX_RTL_AUDIT_SCRIPT="$PWD/apps/storybook/rtl-audit/rtl-audit.before.mjs" pnpm exec vitest run --project node .github/scripts/rtl-audit-coarse-hit.browser.test.mjs --maxWorkers=1 --testNamePattern='rejects a centered'
# Expected: 3 failed; audit incorrectly returns 0 for undersized inputs.
ASTRYX_RTL_BROWSER=1 pnpm exec vitest run --project node .github/scripts/rtl-audit-coarse-hit.browser.test.mjs --maxWorkers=1
# Expected: 9 passed.
rm apps/storybook/rtl-audit/rtl-audit.before.mjs

Review receipt

The testing trigger was routed against the pinned base to head 9e7f43f3611bc06a9ca87162485fb7d9584d9d00. It matches architecture:rtl-audit-evidence INV1–INV4, INV6, INV9/INV10, INV12–INV14, INV16; architecture:component-test-sufficiency INV1–INV7, INV10/INV11; and AST-030 FR7/FR11. The direct RTL evidence owner supplies this change's size/mutation obligations. Component-test sufficiency does not introduce a component API change; the new tests observe the previously unmeasured native-size outcome. AST-030 is preserved by using the existing RTL owner and retaining check names. D1 applicability/exclusion claims are unchanged.

Independent read-only review found no actionable defects and confirmed the regression, existing component checks, and restored lint enforcement. CI wiring was inspected, not run end to end.

Scope

  • No intended public API, product behavior, visual direction, or policy change.
  • No component changes or unrelated generated-file changes retained.
  • Public text and evidence contain no private operational context.
  • Published for review; no merge/auto-merge enabled.

Testing

  • pnpm build and pnpm -F @astryxdesign/storybook build — passed.
  • D7 Chromium suite — 9/9 passed after; three size regressions fail before as expected.
  • Built Storybook 20×20 native-input mutation and restoration — passed the expected pass/fail/pass controls.
  • Scoped full RTL audit (--filter CheckboxInput,RadioList,Switch --concurrency 2) — passed, exit 0.
  • Seven RTL routing/coverage/pool/shard/completion CLI suites — 99/99 passed.
  • CheckboxInput, RadioList, and Switch unit suites — 159/159 passed.
  • node internal/eslint-plugin-astryx/no-physical-properties.test.mjs and prefer-center-inline.test.mjs — passed.
  • Effective ESLint config for all three former exemptions — error severity with no options; component lint has zero errors and one existing unused-import warning in Switch.
  • pnpm -F @astryxdesign/storybook typecheck — passed.
  • pnpm check:repo and pnpm check:knowledge — passed.
  • Prettier checks pass on the changed test, rule/test, workflow, README, targets, and record. eslint.config.js has the same three unrelated pre-existing formatting differences as the pinned base; they are left untouched.
  • node --check apps/storybook/rtl-audit/rtl-audit.mjs and git diff --check — passed.
  • GitHub CI on head 9e7f43f3611bc06a9ca87162485fb7d9584d9d00: test, build, lint, typecheck, Storybook, and pr-rtl passed before publication. Code review and owner approval remain separate.

No changeset: only repository lint/audit infrastructure and its documentation change.

Writing rubric results

R1 narration: removed the stale D7 size-enforcement gap and described the measured native dimensions in present tense; unrelated planned D1/N/A implementation descriptions remain scoped to their existing owners.
R2 research: mutation runs and results stay in this PR, not the architecture record.
R3 evidence: INV10 names native width/height mutation fixtures and the browser test path, not a PR or commit.
R4 rejected alternatives: no new alternatives or decisions added.
R5 change references: no PR/issue references added to the record.
R6 open questions: N/A admission, historical debt, and required-check rollout remain unanswered and unchanged.

@vercel

vercel Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Oct 27, 2026 6:05pm UTC

Request Review

@astracat-bot

astracat-bot Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Oct 27, 2026, 6:29 PM UTC

@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Oct 22, 2026
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 22, 2026
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR

🧪 Sandbox Preview

View Sandbox for this PR

No new or modified components detected.

Bundle Size Summary

No component packages changed.

Accessibility Audit

Status: No accessibility violations detected.

Visual Regression

55 of 502 shot(s) changed.

A change here is a question, not a failure: check whether the after is the
picture you intended. Record that review on the PR. Baseline maintenance is an
explicit dispatch of CI; this report never rewrites the baseline or adds a release gate.

component story theme mode pixels
Selector Indicator Space Bottom Sheet Narrow End RTL neutral light 753,933
Selector Indicator Space Bottom Sheet Wide Start neutral light 740,072
RichTextEditor Markdown parity: side by side probe dark 558,840
RichTextEditor Markdown parity: side by side probe light 540,756
Chat Full AI Chat probe light 230,823
Chat Full AI Chat probe dark 229,805
AppShell With Mobile Nav probe light 217,010
AppShell With Mobile Nav probe dark 216,960
Collapsible Dividers probe dark 66,445
Collapsible Dividers probe light 66,445
AppShell Playground neutral dark 65,198
AppShell Playground neutral light 63,788
Chat Default neutral dark 36,304
Chat Default neutral light 35,767
Chat Empty State probe light 23,531
Chat Empty State probe dark 22,622
ChatAutoScroll Scroll Behavior Comparison neutral dark 15,378
ChatAutoScroll Scroll Behavior Comparison neutral light 14,107
Chat With Attachments probe light 13,406
Chat With Attachments probe dark 11,232

and 35 more.


Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

@nynexman4464
nynexman4464 marked this pull request as ready for review October 22, 2026 16:12

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks ready to approve: D7 now fails a native input below the target's 24×24 minimum (23×24, 24×23 and 20×20 inputs pass on the base audit and fail with this change), keeps its centering and hit checks, and CheckboxInput, RadioList and Switch still pass D7 on the built Storybook in CI. The three components also lint cleanly without the allowLogicalCentering exemption. The remaining step is an engineering owner's approval of the rtl-audit-evidence record edit, which the spec-owner check is waiting on.

[Automated review]

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks ready to approve: D7 now fails a native input below its target's 24×24 minimum (23×24, 24×23 and 20×20 inputs pass the base audit and fail with this change) while keeping its centering and hit checks, and the real CheckboxInput, RadioList and Switch inputs still measure at least 24×24 in both directions. The three components also lint cleanly without the allowLogicalCentering exemption. What remains is an engineering owner's approval of the rtl-audit-evidence record edit, which the spec-owner check is waiting on, and a green CI run on this head.

[Automated review]

@nynexman4464

Copy link
Copy Markdown
Contributor Author

/approve-spec 706a76e

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Oct 27, 2026
@nynexman4464
nynexman4464 merged commit 0472c4e into main Oct 27, 2026
74 checks passed
@github-actions
github-actions Bot deleted the fix/rtl-native-target-size branch October 28, 2026 06:17

This branch was successfully deployed

1 active deployment
Preview — 706a76e5 Deployed Oct 27, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant