Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR Modified ComponentsIndicator (@astryxdesign/core) · View in Storybook
Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
#4921 Omitted four members from the exported IndicatorProps and shipped it as a `patch` under [fix]. That is a retyped public export, which rubric P11 names explicitly and puts at BLOCK: it needs [breaking] + minor + a codemod. The changeset even advertised the break in prose. check:changesets only enforces category-to-bump, so CI could not see it. My own PR three commits earlier set the precedent I then ignored: remove-dropdown-menu-radio-dot-target shipped [breaking] + minor + a codemod for a strictly QUIETER break -- silent at runtime rather than red at compile time. Found by an independent re-audit under rubric v1.3, not by me. - changeset re-issued as [breaking] / minor. - New codemod remove-indicator-a11y-props, staged in transforms/next. It reaches BOTH shapes: a direct <CheckIndicator .../> and the documented `const Mark = useIndicator('check')` form, where no indicator name appears in the JSX at all. Removal, not rewriting -- there is nowhere to move these props to -- and every removal leaves a TODO, because "the owner already carries the name" is a claim about the call site a codemod cannot verify. Also closes two FIXes from the same audit: - tabIndex joins the omission list, and is dropped at runtime. This diff created the trap: aria-hidden became unconditional, so a forwarded tabIndex is now a focusable node inside a hidden subtree. Measured in real Chromium: axe aria-hidden-focus 0 -> 1 violation. My own jsdom probe had reported none -- jsdom cannot judge focusability, which is worth remembering about that harness. - Indicator.doc.mjs:55 still told a replacement to render children "when present" -- verbatim the wording #4921 replaced in bestPractices BECAUSE "present" is the trap. And corrects an overstatement of mine: "passing role is a compile error" holds only for a literal attribute. A spread -- the ordinary host idiom -- bypasses excess-property checking for every member, `role` included. The type states intent; ordering and the codemod do the enforcing. A test now pins that, deliberately without @ts-expect-error, so it fails the day TypeScript changes its mind. Verified: 4 new tests red against origin/main; 1134 pass across the subject, every consumer and the codemods; core tsc, typecheck:docs and strict lint clean; check:changesets 60 valid.
… typecheck The remove-indicator-a11y-props transform tripped the strict CLI typecheck: the TODO helper's `names` parameter and the `removed` accumulator were implicitly `any`. Annotate both so `tsc --project tsconfig.strict.json` passes.
|
Closing — the premise is wrong, and Cindy caught it.
The whole layer ships for the first time in the next release. Omitting props from a type no consumer can have installed breaks nobody, so all three things this PR did are wrong:
The original Three fixes in here are real and independent of the changeset question, so I am re-landing them as a plain patch (see the follow-up PR):
|
* fix(indicator): a forwarded tabIndex no longer puts a tab stop in a hidden subtree Indicators are unconditionally aria-hidden, so a focusable one is a focusable node inside a hidden subtree -- axe aria-hidden-focus, measured in real Chromium going from 0 violations to 1 the moment tabIndex is forwarded. #4921 created that trap: before it, a consumer could pair tabIndex with aria-hidden="false" and be valid. `tabIndex` joins the props IndicatorProps omits, and is dropped at runtime by a small internal helper for the case the type cannot see: TypeScript exempts hyphenated JSX attributes from excess-property checking, and a spread -- `<Mark {...props} />`, the ordinary host idiom -- bypasses the check for every member. Only tabIndex is removed; aria-hidden is settled by attribute order, and role/aria-label are inert inside a hidden subtree, so they are left alone rather than silently deleted. This is the salvage from #4938, which was closed: that PR escalated the same change to a [breaking] changeset plus an `astryx upgrade` codemod on the theory that IndicatorProps is public API. It is not, yet -- [email protected] published 2026-08-05 with no ./Indicator subpath, Indicator landed 2026-08-11, and its changeset is still pending, so the layer ships for the first time next release. Nothing to break, nobody to migrate. Plain [fix] patch is the honest record. Closing that PR also surfaced a bug in it: the type half of this change was lost in a revert/restore during its development and never made it into the commit, while its changeset advertised it. Only the runtime drop shipped, and the tests passed because they exercise runtime. Both halves are here, and I checked the type change survived this time. Also corrects two doc claims, both from the same audit: - Indicator.doc.mjs:55 still said a replacement must render children "when present" -- verbatim the wording #4921 replaced in bestPractices BECAUSE "present" is the trap. - "passing role is a compile error" holds only for a literal attribute; a spread bypasses the check. A test pins that, deliberately without @ts-expect-error, so it fails the day TypeScript changes its mind. Verified: 4 new tests red against origin/main; 391 pass across the subject and every consumer; core tsc, typecheck:docs and strict lint clean. * Slim to the type: drop the runtime strip and its module Cindy's review, and she is right on both counts. Nobody sets tabIndex on an indicator -- grepped every call site in core, zero. And `tabIndex` is a plain JS identifier, so excess-property checking applies and the Omit rejects the literal on its own; I verified the @ts-expect-error is consumed. The type was already doing the work. So stripSmuggledProps.ts is deleted and all three components go back to a plain {...rest}. What is left is one word in an existing Omit. The module was also inconsistent, which I should have noticed while writing it: we deliberately do NOT strip `role` or `aria-label` -- they are inert inside an aria-hidden subtree -- so singling out tabIndex for a runtime guard defended one spread-only case while leaving its siblings, at the cost of a module and an indirection. The runtime tests go with it; the spread case is now documented in the test that shows it compiling, with the reason it is left alone. Diff is now: one word in types.ts, one doc sentence, tests, changeset. No .tsx source change at all.
Fixes #4937. Found by the independent re-audit under rubric v1.3, not by me.
The BLOCK
#4921
Omitted four members from the exportedIndicatorPropsand shipped it as apatchunder[fix]. That is a retyped public export, which rubric P11 names explicitly at BLOCK severity: it needs[breaking]→ minor and a codemod. The changeset even advertised the break in prose ("passingroleis a compile error").check:changesetsonly enforces category↔bump, so CI could not see it.My own PR three commits earlier set the precedent I then ignored:
remove-dropdown-menu-radio-dot-targetshipped[breaking]+ minor + a codemod for a quieter break — silent at runtime, rather than red at compile time.[breaking]/ minor.remove-indicator-a11y-props, staged intransforms/next.The codemod reaches both shapes, which is the part worth reviewing. A direct
<CheckIndicator … />is easy; the documented themeable form is not:No indicator name appears in that JSX at all, so a name-matching transform would sail past it. It resolves locals through
useIndicator()/getIndicator()too, pinned by a test.It removes rather than rewrites — there is nowhere to move these props to — and leaves a TODO at every site, because "the owning control already carries the name" is a claim about the call site that a codemod cannot verify. If the indicator was the only thing naming the control, the name has to move there, and a human has to decide that.
Two FIXes from the same audit
tabIndexjoins the omission list, and is dropped at runtime. This is a trap #4921 created:aria-hiddenbecame unconditional, so a forwardedtabIndexis now a focusable node inside a hidden subtree. Before that diff a consumer could pairtabIndexwitharia-hidden="false"and be valid.Measured in real Chromium with the repo's own axe: 0 → 1
aria-hidden-focusviolation the moment it is forwarded. My own jsdom probe had reported none — jsdom cannot judge focusability, which is worth remembering about that harness.Indicator.doc.mjs:55still told a replacement to render children "when present" — verbatim the wording #4921 replaced inbestPracticesbecause "present" is the trap. (Not an X21 BLOCK: X21 enumeratesexamples[].code,usage.bestPracticesand@example, and aprops[].descriptionis none of the three. Worth telling the rubric owner that the identical sentence is BLOCK-able one field away.)And a correction to something I claimed
"Passing
roleis a compile error" holds only for a literal attribute. A spread — the ordinary host idiom — bypasses excess-property checking for every member,roleincluded:So the type states intent and catches the literal; ordering and the codemod do the enforcing. A test pins that, deliberately without
@ts-expect-error, so it starts failing the day TypeScript changes its mind.Test plan
4 new tests red against
origin/main:Codemod: 5 cases — direct call site, the
useIndicatoralias, other components left alone, no-op on indicator-free files, idempotent. Assertions match the attribute form, not a bare substring, because the TODO comment names the props it removed.Suites: 1134 pass across Indicator + every consumer + the codemods; core
tscclean;typecheck:docsclean;CI=true eslint --no-cache0/0;check:changesets60 valid;check:syncclean.Ledger
Recorded at 82.4 / C (
653729439e, rubric v1.3) with P11 as the one open BLOCK — wiki3884786. This closes it; projected 87.1 / B. I will re-audit and re-record once this merges.