Skip to content

fix(ClickableCard, SelectableCard): a control inside rings itself, not the card too - #8872

Merged
cixzhang merged 27 commits into
mainfrom
fix/focus-ring-one-owner-cards
Nov 20, 2026
Merged

cixzhang merged 27 commits into
mainfrom
fix/focus-ring-one-owner-cards

Conversation

@cixzhang

@cixzhang cixzhang commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Part 2 of the #8850 fixes: ClickableCard and SelectableCard. #8869 (Item and Token) has landed; this pull request now targets main. Thumbnail is #11613, and Selector was fixed by #8874.

User impact

The card docs say "Nested interactive elements work independently", but a keyboard user who tabs to a button inside a ClickableCard or SelectableCard sees two rings: the button's, and a second around the whole card. Now the button shows one ring, and the card rings only when its own link, button or checkbox is focused.

"Add to cart" focused in a ClickableCard Before After
1280
390
"Details" focused in a SelectableCard Before After
1280
390

Stills at this head

Real Chromium 149 (headed, device pixel ratio 2), keyboard focus with real Tab keys, main e8200bb against this pull request. With the card itself focused, this head (f5506c1) and main are identical: one ring on the card's outer edge, following its 12 px radius and not clipped (ClickableCard, and SelectableCard selected and unselected; 1280 light and dark, 390 px, forced colors). With a nested button focused, main draws the card ring and the button ring, and this head draws the button ring only.

Focus-ring contact sheet: main vs this stack

Problem and solution fit

  • Cause: both cards ring with focusWithin (:has(:focus-visible)), which matches any focused descendant.
  • Fix: each card spreads the shared ring focusWithinOwner from privateAttributes/focusOwner.stylex.ts and marks its own primary (ClickableCard's screen-reader-only link or button, SelectableCard's checkbox) with focusOwnerProps. Both primaries are direct children of the card root.

Current specification

architecture:interaction-modality INV3 (current): one focus move has one owning indicator; sibling controls paint their own focus.

Evidence

  • FocusRingOwner.a11y.chromium.spec.ts: gains a ClickableCard case (Core/ClickableCard › Nested Interactive Elements) and a SelectableCard case (the new Core/SelectableCard › With Nested Button), at 1280 and 390 px. On main both show two rings while the inner button is focused; with this change each stop shows one. CI's Chromium leg runs it.
  • ClickableCard and SelectableCard unit suites pass.

Records

  • component:ClickableCard AR3 and component:SelectableCard AR2 now state that a nested control shows only its own indicator. Their two-indicator Current-state bullets and implementation-gap sentences are removed (gap counts updated), and both verified_by lists name FocusRingOwner.a11y.chromium.spec.ts.
  • architecture:interaction-modality INV3's implementation-gap list drops the clickable and selectable cards.

Preflight

pnpm preflight --browser at 643c678 (main 77a11ae merged), run on a separate build machine: review:pre, build, typecheck, lint, vitest ui, knowledge, changesets, Storybook build, a11y specs (129 passed) and interaction specs (1,878 passed) PASS. vitest node failed only .github/scripts/lib/offline-media.test.mjs's real-browser cases, which fail the same way on main there (its network proxy; 24/24 without it). No other failure.

Writing rubric results

  • R1 narration: none. The AR sentences state what a focused nested control shows.
  • R2 research: none.
  • R3 evidence: the verification lists name the browser spec, not a pull request.
  • R4 rejected alternatives: none added.
  • R5 change references: none added.
  • R6 open questions: none touched.
  • R7 project status: the gap counts ("One implementation gap", "Two implementation gaps") are the records' own lifecycle lines, updated after removing the focus gap.

Scope

Changeset: [fix] patch for @astryxdesign/core.

Owner: Astryx fix-loop lane 0. Land path: CodeBunny approval of the exact head, Specs stamp, CI, then the merge queue.

… too

architecture:interaction-modality INV3: one focus move has one owning
indicator. Item and Token drew their ring with focusWithin
(:has(:focus-visible)), which matches any focused descendant, so a control
in an Item's start or end slot, or a Token's remove button, drew its own
ring and the row or token drew a second around it; a row with no action of
its own rang too.

A new shared style, focusWithinOwner, rings a wrapper only for the direct
child marked data-astryx-focus-owner (FOCUS_OWNER_ATTRIBUTE). Item marks
its invisible button and link (delegation mode keeps focusWithin: the
nested control is the row's sole tab stop by contract); Token marks its
button and link. Other controls ring themselves.

New stories (Item With End Actions, Token Clickable With Remove) and
FocusRingOwner.a11y.chromium.spec.ts: one ring at every tab stop at 1280
and 390 px; it fails on main (two rings while Share or Remove is focused).
focusRings.ts is a shared helper for such specs.
…t the card too

architecture:interaction-modality INV3: one focus move has one owning
indicator. Both cards drew their ring with focusWithin, so a button in
their children (which the docs allow: "Nested interactive elements work
independently") drew its own ring and the card drew a second around it.
Each card now uses focusWithinOwner and marks its own link, button or
checkbox with FOCUS_OWNER_ATTRIBUTE.

SelectableCard gains a With Nested Button story; FocusRingOwner's browser
spec covers both cards at 1280 and 390 px and fails on the previous head.
focusRings ignores a visually hidden control's outline (the cards'
screen-reader-only primaries), which paints nothing a person sees.

Stacked on #8869 (focusWithinOwner).
@vercel

vercel Bot commented Oct 28, 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 Nov 20, 2026 10:28am UTC

Request Review

@astracat-bot

astracat-bot Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 20, 2026, 1:28 PM UTC

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

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: a keyboard-focused control inside a ClickableCard or SelectableCard now shows one focus ring instead of two, and the card still rings for its own link, button or checkbox, as the cards' focus contracts and architecture:interaction-modality INV3 require. The new browser cases pass on this branch and catch the double ring without the fix. As a non-blocking follow-up, both component records still describe the double ring as an open implementation gap and can drop those notes once this lands.

[Automated review]

@cixzhang
cixzhang marked this pull request as draft October 30, 2026 21:06
…abled story's doc comment

CodeBunny: focusWithinOwner and FOCUS_OWNER_ATTRIBUTE were reachable from
the published @astryxdesign/core/utils and utils/focusOutline.stylex entry
points, which would make them public API (public-component-api INV12).
They move to src/internal/focusOwner.ts, which no entry point exports, so
nothing new is published and focusOutline.stylex.ts is unchanged from main.
Item.stories: '/** Disabled items. */' goes back above Disabled.
….stylex.ts

The repo's focus-outline-shared lint rule allows rings only in a
focusOutline.stylex file; the internal file keeps that rule and the shared
tokens, and no package entry point exports it.
Follows #8869: focusWithinOwner and FOCUS_OWNER_ATTRIBUTE now come from the
unexported internal/focusOutline.stylex.ts, so nothing new is published.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

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: a keyboard-focused control inside a ClickableCard or SelectableCard now shows one focus ring instead of two, and the card still rings for its own link, button or checkbox, as the cards' focus contracts and architecture:interaction-modality INV3 require. The new browser cases pass on this branch and fail when the fix is reverted. Two non-blocking follow-ups: both component records still describe the double ring as an open implementation gap, and the spec's @pr-a11y scope line could also route on packages/core/src/internal/focusOutline.stylex.ts, where the owner ring now lives.

[Automated review]

…and Token resolve the owner module

CodeBunny on #8869:
- In a numbered List, Item wraps a row's button or link in the content cell
  beside the marker, so the owner condition's direct-child :has() missed it
  and the row showed no ring. The cell now carries
  data-astryx-focus-owner-group, and the condition also matches an owner one
  level down inside such a group. A numbered story and a Chromium case
  check one ring for a button row and a link row.
- Swizzled Item and Token import internal/focusOutline.stylex, which Core did
  not export. It is now a ./internal/* entry like internal/touch: reachable
  for Core, Lab and swizzled copies, outside the compatibility promise
  (architecture:public-component-api INV12).
…, privateAttributes/focusOwner.stylex.ts

Per architecture:interaction-modality INV3 and public-component-api INV23:
the private data-astryx-focus-owner attribute, its group attribute and their
selector are written once, in privateAttributes/focusOwner.stylex.ts, which
exports only the shared focusWithinOwner wrapper ring and the props that set
the attributes. Item and Token spread those exports and never write the
attribute; TokenLink takes them through its link props without typing the
name. No package entry exports the module: the ./internal/focusOutline.stylex
entry and its export-sync line are gone. focus-outline-shared allows the
owner module to write its ring.

A source-build test checks the compiled ring sits on the wrapper, keyed to
the marked control's :focus-visible, never :has(...) * on every descendant;
a Chromium case checks a Token inside an Item shows one ring at each stop.
…g-one-owner-cards; the cards spread the focus-owner owner module's ring and props
…ner-item-token

# Conflicts:
#	packages/core/src/Item/Item.tsx
#	packages/core/src/Token/Token.tsx
#	packages/core/src/Token/TokenLink.tsx

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

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: a keyboard-focused control inside a ClickableCard or SelectableCard now shows one focus ring instead of two, and the card still rings for its own link, button or checkbox, as the cards' focus contracts and architecture:interaction-modality INV3 require. The new browser cases fail on the unfixed components and pass on this branch. Non-blocking follow-ups:

  • Both component records still describe the double ring as an open implementation gap.
  • The spec's @pr-a11y scope line could also route on packages/core/src/privateAttributes/focusOwner.stylex.ts and packages/core/src/Card/, which the card ring now depends on.
  • focusRings.ts skips any outlined box 1px or narrower even when it is not clipped; the clip checks alone keep every case passing.

[Automated review]

cixzhang added a commit that referenced this pull request Nov 5, 2026
…s ring themselves, not the trigger too (#8874)

* fix(Item, Token): a control inside rings itself, not the row or token too

architecture:interaction-modality INV3: one focus move has one owning
indicator. Item and Token drew their ring with focusWithin
(:has(:focus-visible)), which matches any focused descendant, so a control
in an Item's start or end slot, or a Token's remove button, drew its own
ring and the row or token drew a second around it; a row with no action of
its own rang too.

A new shared style, focusWithinOwner, rings a wrapper only for the direct
child marked data-astryx-focus-owner (FOCUS_OWNER_ATTRIBUTE). Item marks
its invisible button and link (delegation mode keeps focusWithin: the
nested control is the row's sole tab stop by contract); Token marks its
button and link. Other controls ring themselves.

New stories (Item With End Actions, Token Clickable With Remove) and
FocusRingOwner.a11y.chromium.spec.ts: one ring at every tab stop at 1280
and 390 px; it fails on main (two rings while Share or Remove is focused).
focusRings.ts is a shared helper for such specs.

* fix(ClickableCard, SelectableCard): a control inside rings itself, not the card too

architecture:interaction-modality INV3: one focus move has one owning
indicator. Both cards drew their ring with focusWithin, so a button in
their children (which the docs allow: "Nested interactive elements work
independently") drew its own ring and the card drew a second around it.
Each card now uses focusWithinOwner and marks its own link, button or
checkbox with FOCUS_OWNER_ATTRIBUTE.

SelectableCard gains a With Nested Button story; FocusRingOwner's browser
spec covers both cards at 1280 and 390 px and fails on the previous head.
focusRings ignores a visually hidden control's outline (the cards'
screen-reader-only primaries), which paints nothing a person sees.

Stacked on #8869 (focusWithinOwner).

* fix(Thumbnail, Selector, MultiSelector): a nested button rings itself, not the thumbnail or trigger too

architecture:interaction-modality INV3: one focus move has one owning
indicator. Thumbnail's image container and the ghost and secondary
Selector and MultiSelector trigger containers rang with focusWithin, so a
Thumbnail's remove button, and a trigger's clear or status button, drew
their own ring and the container a second around it. Each container now
uses focusWithinOwner, and the Thumbnail's Open button and each trigger
button carry FOCUS_OWNER_ATTRIBUTE.

FocusRingOwner's browser spec gains a Thumbnail With Remove case and ghost
and secondary Clearable cases for both selectors, at 1280 and 390 px; they
fail on the previous head (two rings while Remove or Clear is focused).

Stacked on #8872.

* fix(Item, Token): keep the focus-owner ring internal; restore the Disabled story's doc comment

CodeBunny: focusWithinOwner and FOCUS_OWNER_ATTRIBUTE were reachable from
the published @astryxdesign/core/utils and utils/focusOutline.stylex entry
points, which would make them public API (public-component-api INV12).
They move to src/internal/focusOwner.ts, which no entry point exports, so
nothing new is published and focusOutline.stylex.ts is unchanged from main.
Item.stories: '/** Disabled items. */' goes back above Disabled.

* Merge remote-tracking branch 'origin/main' into fix/focus-ring-one-owner-item-token

* fix(Item, Token): the focus-owner ring lives in internal/focusOutline.stylex.ts

The repo's focus-outline-shared lint rule allows rings only in a
focusOutline.stylex file; the internal file keeps that rule and the shared
tokens, and no package entry point exports it.

* Merge branch 'fix/focus-ring-one-owner-item-token' into fix/focus-ring-one-owner-cards

* fix(ClickableCard, SelectableCard): use the internal focus-owner ring

Follows #8869: focusWithinOwner and FOCUS_OWNER_ATTRIBUTE now come from the
unexported internal/focusOutline.stylex.ts, so nothing new is published.

* chore(ClickableCard, SelectableCard): drop the now-unused focusOutlineProps import

* Merge branch 'fix/focus-ring-one-owner-cards' into fix/focus-ring-one-owner-thumbnail-selector

* fix(Thumbnail, Selector, MultiSelector): use the internal focus-owner ring

Follows #8869: focusWithinOwner and FOCUS_OWNER_ATTRIBUTE come from the
unexported internal/focusOutline.stylex.ts (focusOwnerStyles for the two
selectors' stylex.props lists), so nothing new is published.

* fix(Item): a numbered row's own action keeps its ring; swizzled Item and Token resolve the owner module

CodeBunny on #8869:
- In a numbered List, Item wraps a row's button or link in the content cell
  beside the marker, so the owner condition's direct-child :has() missed it
  and the row showed no ring. The cell now carries
  data-astryx-focus-owner-group, and the condition also matches an owner one
  level down inside such a group. A numbered story and a Chromium case
  check one ring for a button row and a link row.
- Swizzled Item and Token import internal/focusOutline.stylex, which Core did
  not export. It is now a ./internal/* entry like internal/touch: reachable
  for Core, Lab and swizzled copies, outside the compatibility promise
  (architecture:public-component-api INV12).

* refactor(Item, Token): the focus-owner attribute has one owner module, privateAttributes/focusOwner.stylex.ts

Per architecture:interaction-modality INV3 and public-component-api INV23:
the private data-astryx-focus-owner attribute, its group attribute and their
selector are written once, in privateAttributes/focusOwner.stylex.ts, which
exports only the shared focusWithinOwner wrapper ring and the props that set
the attributes. Item and Token spread those exports and never write the
attribute; TokenLink takes them through its link props without typing the
name. No package entry exports the module: the ./internal/focusOutline.stylex
entry and its export-sync line are gone. focus-outline-shared allows the
owner module to write its ring.

A source-build test checks the compiled ring sits on the wrapper, keyed to
the marked control's :focus-visible, never :has(...) * on every descendant;
a Chromium case checks a Token inside an Item shows one ring at each stop.

* Merge branch 'fix/focus-ring-one-owner-item-token' into fix/focus-ring-one-owner-cards

* Merge branch 'fix/focus-ring-one-owner-item-token' into fix/focus-ring-one-owner-cards; the cards spread the focus-owner owner module's ring and props

* Merge branch 'fix/focus-ring-one-owner-cards' into fix/focus-ring-one-owner-thumbnail-selector; Thumbnail, Selector and MultiSelector spread the focus-owner owner module's ring and props

* Merge remote-tracking branch 'origin/main' into fix/focus-ring-one-owner-item-token

# Conflicts:
#	packages/core/src/Item/Item.tsx
#	packages/core/src/Token/Token.tsx
#	packages/core/src/Token/TokenLink.tsx

* Merge branch 'fix/focus-ring-one-owner-item-token' into fix/focus-ring-one-owner-cards

* Merge branch 'fix/focus-ring-one-owner-cards' into fix/focus-ring-one-owner-thumbnail-selector

* Merge main; this pull request now carries only the Selector part, with the focus-owner module

Per the coordinator's Specs-ruled direction (interaction-modality INV3):
only the Selector part is free. MultiSelector's focusOutline change is
held on an owner card, so it is split out, along with the Thumbnail,
Item, Token and card changes from the stack below; their files are back
to main's. The pull request now carries what Selector needs on its own:
the focus-owner owner module (privateAttributes/focusOwner.stylex.ts),
the focus-outline-shared lint allowance for it, the source-build test,
the ring helper, and the Chromium spec's Selector cases.

* fix(Selector): the focus-owner module carries only its own attribute; lint-clean comments

The owner module writes only data-astryx-focus-owner (one attribute per
owner module); the one-level-down group attribute stays with Item's part.
Comments no longer cite records. The Chromium spec imports test from the
a11y-spec Playwright entry. The interaction-modality INV3 gap now names
what remains: the module exists and Selector uses it.

* fix(Selector): one style writes the trigger outline in each state; INV3 verification row says what remains

Per review: focusWithinOwner is spread only when the pointer-restored
focus suppression is off, so pointerRestoredFocus never sets the outline
again on the same element. The INV3 verification row no longer says the
module does not exist. The owner module's export comment no longer reads
as permission to set the outline again.

* Merge branch 'main' into fix/focus-ring-one-owner-thumbnail-selector

* Merge branch 'main' into fix/focus-ring-one-owner-thumbnail-selector

* Merge branch 'main' into fix/focus-ring-one-owner-thumbnail-selector

* Merge branch 'main' into fix/focus-ring-one-owner-thumbnail-selector

* Merge branch 'main' into fix/focus-ring-one-owner-thumbnail-selector
…Owner module

Main now has privateAttributes/focusOwner.stylex.ts (from the Selector
change), so this branch drops its own copy of the module, its build test and
its ring helper, and takes main's. The module gains focusOwnerGroupProps:
Item's content cell beside a list marker holds the row's own button or link
one level down, and the wrapper ring reaches it there. Item and Token mark
their own control with focusOwnerProps and ring through focusWithinOwner.
The Item and Token browser cases join main's FocusRingOwner spec.

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes requested: the focus-ring fix works (a control inside a ClickableCard or SelectableCard now shows one ring, and the card still rings once for its own link, button or checkbox), but one record sentence still describes the old behaviour.

  • docs/specs/components/SelectableCard/SelectableCard.spec.md:150: FR4 still ends with the implementation-gap sentence saying a focused nested control draws both the card outline and its own, citing a Current-state entry this pull request deletes, so the record contradicts the rewritten AR2 and the description's statement that the gap sentences are removed; end FR4 at "…shows one indicator on the card root (architecture:interaction-modality INV3)."

In the same pass, drop the lines that go stale with it: the FR4 verification gap at SelectableCard.spec.md:244, "AR3 records the gap" at ClickableCard.spec.md:205, and the focus-outline half of the gap at ClickableCard.spec.md:220. Non-blocking: INV3's verification row (interaction-modality.md:362) still says the browser spec covers only Selector, the SelectableCard readiness row (SelectableCard.spec.md:49) keeps "not built", and the browser spec's scope line has no token for packages/core/src/Card/, whose render shape the card ring now depends on.

Claims and files checked

Review mode: same-head; reason: none

Claims:

  • Tabbing to a button inside either card showed two rings and now shows one: verified (Chromium frames at this head on both cards at 640 px, plus ClickableCard at 390 px and in dark mode and SelectableCard in forced colours: two outlines at the nested stop on the base, one on the head).
  • The card rings only for its own link, button or checkbox: verified (the card's own stop is pixel-identical on base and head, and so is the selectable card group's radio stop).
  • The stills (card focused: identical to main; nested button focused: two rings on main, one here): verified for the same stops by the Chromium frames at this head; this head's own patch is unchanged from the head the stills name.
  • The cause is the any-descendant focus-within ring: verified (it compiles to :has(:focus-visible)).
  • Each card spreads the shared owner ring and marks its hidden control, a direct child of the card root: verified (ClickableCard.tsx:453, :489, :501; SelectableCard.tsx:557, :604; Card renders its children directly).
  • The interaction-modality focus rule governs the change: verified.
  • The browser spec gains a ClickableCard case and a new SelectableCard case at 1280 and 390 px, two rings on main and one here, and CI's accessibility job runs it: verified by reading (spec lines 126-144 and the job's routing of modified specs) and by the equivalent probe; CI has not run on this head.
  • The ClickableCard and SelectableCard unit suites pass: verified (47 tests).
  • The card records' accessibility sentences now say a nested control shows only its own indicator: verified.
  • The two-indicator Current-state bullets are removed and the gap counts updated: verified.
  • The implementation-gap sentences are removed: false (SelectableCard.spec.md:150).
  • Both verification lists name the browser spec, and the interaction-modality gap list drops both cards: verified.
  • Part 1 (Item and Token) has landed and this targets main; Thumbnail and Selector are handled in their own pull requests: verified.
  • No public API changes: verified (built surfaces compare with no row).
  • The changeset describes a patch fix with one ring per tab stop, the card ringing only for its own control: verified.
  • The writing-rubric results and the absence of internal context in public text: verified.

Files:

  • .changeset/focus-ring-one-owner-cards.md: clear
  • apps/storybook/stories/SelectableCard.stories.tsx: clear
  • docs/architecture/interaction-modality.md: clear; non-blocking stale verification row at 362
  • docs/specs/components/ClickableCard/ClickableCard.spec.md: stale lines 205 and 220
  • docs/specs/components/SelectableCard/SelectableCard.spec.md: blocking at 150; stale 244; non-blocking 49
  • packages/core/src/ClickableCard/ClickableCard.tsx: clear
  • packages/core/src/SelectableCard/SelectableCard.tsx: clear
  • packages/core/src/__tests__/FocusRingOwner.a11y.chromium.spec.ts: clear; non-blocking scope token

Automated review (maintainer link)

…nge closes

FR4 still ended with the implementation-gap sentence about a focused
nested control drawing two outlines, and cited a Current-state entry this
change removes. The FR4 verification row now names the browser check.
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 15, 2026
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 25470a1

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 15, 2026

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved pending CI: CI has not run on this head yet, so this is not ready to merge until it does. A control inside a ClickableCard or SelectableCard now shows only its own focus ring, the card still rings once for its own link, button or checkbox, and the SelectableCard FR4 sentence that held the last review is fixed.

  • Non-blocking: docs/specs/components/ClickableCard/ClickableCard.spec.md:205 still says "AR3 records the gap" and :220 still lists the focus outline as unchecked, though AR3's gap is closed and the browser spec now checks the card's ring.

Smaller non-blocking cleanups: the INV3 verification row (docs/architecture/interaction-modality.md:362) still names only Selector, the SelectableCard.spec.md:49 readiness row keeps "not built", and the browser spec's routing line has no token for packages/core/src/Card/, whose render shape the card ring depends on.

Claims and files checked

Review mode: full; reason: spec-record

Claims:

  • The card docs say nested interactive elements work independently: verified (the ClickableCard doc; the SelectableCard record's allowed variation says the same).
  • Tabbing to a button inside either card showed two rings and now shows one: verified (Chromium captures of both cards at 640 and 390 px, in dark mode and in forced colours: card and button outlined on the base, only the button on the head).
  • The card rings only when its own link, button or checkbox is focused: verified (the card's own stop is pixel-identical on base and head in every capture).
  • The stills (card focused identical to the base; nested button focused, two rings on the base and one here): verified for the same stops by this review's captures; the stills name an earlier head whose code patch equals this one.
  • The cause is the any-descendant focus-within ring: verified (it compiles to :has(:focus-visible)).
  • Each card spreads the shared owner ring and marks its hidden control, a direct child of the card root: verified (ClickableCard.tsx:453, :489, :501; SelectableCard.tsx:557, :604; Card renders its children directly in its root).
  • The interaction-modality rule of one owning indicator per focus move governs the change: verified.
  • The browser spec gains a ClickableCard case and a new SelectableCard case at 1280 and 390 px: verified (all 16 cases pass on a static Storybook build of this head; the base shows two rings at the nested stop under the same counting rule), and its routing line selects it for changes to either card.
  • The ClickableCard and SelectableCard unit suites pass: verified (47 tests).
  • The card records' accessibility sentences now say a nested control shows only its own indicator: verified.
  • The two-indicator current-state bullets and implementation-gap sentences are removed and the gap counts updated: verified.
  • Both verification lists name the browser spec, and the interaction-modality gap list drops both cards: verified.
  • Part 1 (Item and Token) has landed and this targets main; Thumbnail and Selector are handled in their own pull requests: verified.
  • No public API changes: verified (the built surfaces of Core and the themes compare with no row).
  • The writing-rubric results and the absence of internal context in public text: verified.
  • The changeset describes a patch fix with one ring per tab stop, the card ringing only for its own control: verified.

Files:

  • .changeset/focus-ring-one-owner-cards.md: clear
  • apps/storybook/stories/SelectableCard.stories.tsx: clear
  • docs/architecture/interaction-modality.md: clear; non-blocking stale verification row at 362
  • docs/specs/components/ClickableCard/ClickableCard.spec.md: non-blocking stale lines 205 and 220
  • docs/specs/components/SelectableCard/SelectableCard.spec.md: clear; non-blocking build status at 49
  • packages/core/src/ClickableCard/ClickableCard.tsx: clear
  • packages/core/src/SelectableCard/SelectableCard.tsx: clear
  • packages/core/src/__tests__/FocusRingOwner.a11y.chromium.spec.ts: clear; non-blocking routing token

Automated review (maintainer link)

…ner-cards

# Conflicts:
#	docs/specs/components/ClickableCard/ClickableCard.spec.md
#	docs/specs/components/SelectableCard/SelectableCard.spec.md
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 6fc2baa

@github-actions github-actions Bot added needs:spec-owner-review Current knowledge records await owner approval and removed needs:spec-owner-review Current knowledge records await owner approval labels Nov 17, 2026

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved pending CI: CI has not run on this head yet, so this is not ready to merge until it does.

A keyboard-focused control inside a ClickableCard or SelectableCard now shows only its own ring, and the card still rings once for its own link, button or checkbox; the new browser cases fail on the unfixed components and pass here. Two small follow-ups, neither blocking:

  • ClickableCard.spec.md lines 205-206 still say AR3 "records the gap", and line 221 still says the focus outline has no automated check, although the browser spec now checks it.
  • The browser spec's @pr-a11y scope does not route a Card-only change, though the card ring depends on Card rendering the hidden control directly in its root.
Claims and files checked

Review mode: same-head; reason: none

  • Claim: the Item and Token fix has merged and this targets main: verified (#8869 merged; the base is main).
  • Claim: Thumbnail is handled separately and Selector was already fixed: verified (#11613 open; #8874 merged; Selector.tsx uses the shared owner ring).
  • Claim: the ClickableCard docs say nested interactive elements work independently: verified (ClickableCard.doc.mjs:11).
  • Claim: tabbing to a nested button showed two rings and now shows one, with the card ringing only for its own control: verified (browser spec and probes at 640 and 390 px, dark mode and forced colours).
  • Claim: with the card itself focused, this change and main look identical: verified (own-stop frames pixel-identical at 640 and 390 px); the paragraph names an earlier head.
  • Claim: the cause is that both cards ringed on any focused descendant: verified (focusOutline.stylex.ts:107-121 on the base).
  • Claim: each card spreads the shared owner ring and marks its own control, a direct child of the card root: verified (ClickableCard.tsx:453, :489, :501; SelectableCard.tsx:557, :604; Card.tsx:304-343).
  • Claim: INV3 is the governing specification: verified (interaction-modality.md:150-162).
  • Claim: the browser spec gains a ClickableCard case and a new SelectableCard case at 1280 and 390 px, two rings on main and one here: verified (16 of 16 pass on this head; the 4 card cases fail on the base components).
  • Claim: CI's Chromium leg runs the spec: verified as routed (its scope matches both card folders); CI has not run on this head.
  • Claim: the ClickableCard and SelectableCard unit suites pass: verified (4 files, 47 tests).
  • Claim: AR3 and AR2 now say a nested control shows only its own indicator, the two-indicator bullets and gap sentences are removed with counts updated, and both verified_by lists name the browser spec: verified (ClickableCard.spec.md:29, :173-175; SelectableCard.spec.md:18, :151, :194-196); a stale cross-reference remains at ClickableCard.spec.md:205-206.
  • Claim: INV3's gap list drops the two cards: verified (interaction-modality.md:160-162).
  • Claim: the writing rubric results hold: verified (no narration, research or change references added).
  • Claim: no public API changes: verified (no export, prop, type or default changes; the marker attribute is private and already in use).
  • Claim: public text carries no internal context: verified.
  • Changeset: a patch fix for core saying each tab stop shows one ring and the card rings only for its own control: verified (behaviour verified above).
  • File .changeset/focus-ring-one-owner-cards.md: clear.
  • File apps/storybook/stories/SelectableCard.stories.tsx: clear.
  • File docs/architecture/interaction-modality.md: clear; its unchanged INV3 verification row (line 362) still says the spec covers only Selector.
  • File docs/specs/components/ClickableCard/ClickableCard.spec.md: non-blocking stale lines 205-206 and 221.
  • File docs/specs/components/SelectableCard/SelectableCard.spec.md: non-blocking build-status wording at lines 49 and 149.
  • File packages/core/src/ClickableCard/ClickableCard.tsx: clear.
  • File packages/core/src/SelectableCard/SelectableCard.tsx: clear.
  • File packages/core/src/__tests__/FocusRingOwner.a11y.chromium.spec.ts: non-blocking scope routing for Card.

Automated review (maintainer link)

| Behavior | A visually hidden native checkbox carries the role, name, and checked state; the whole surface toggles; selection draws an inset ring without moving layout. |
| End-user impact | Screen-reader users hear a named checkbox and its state; pointer users click anywhere on the card; disabled cards stay discoverable by keyboard. |
| Builder impact | At the next minor, a click inside an open layer inside the card (e.g. a Tooltip or HoverCard surface) no longer reaches the caller's `onClick`; a handler that needs those presses moves to the layer content. A theme's exit duration and easing set the touch press release (FR4). |
| Compatibility/readiness | No API changes. One `[breaking]` behavior change is staged for the next minor and not built: `onClick` stops receiving clicks inside an open layer. Two implementation gaps are listed under Current-state impact. FR4 gap: a mouse or pen press that starts on a nested control still paints the card. The touch press release changes (FR4, `spec:AST-094` FR5). |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Non-blocking: this re-padded row keeps "staged for the next minor and not built", and the FR2 row at line 149 keeps "implementation gap: not built". Records avoid temporary build status; the staged [breaking] change can be stated without it, for example "One [breaking] behavior change is staged for the next minor: onClick stops receiving clicks inside an open layer."

…ner-cards

FocusRingOwner's browser spec keeps main's Thumbnail case beside this
branch's card cases: the scope and header name both.
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 42574c9

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved. A keyboard-focused control inside a ClickableCard or SelectableCard now shows only its own ring, and the card still rings once for its own link, button or checkbox; the new browser cases fail on the unfixed components and pass here, and CI passes on this head. Two small follow-ups, neither blocking:

  • ClickableCard.spec.md line 206 still says AR3 "records the gap", and line 221 still says the focus outline has no automated check, although the browser spec now checks it.
  • The browser spec's @pr-a11y scope does not route a Card-only change, though the card ring depends on Card rendering the hidden control directly in its root.
Claims and files checked

Review mode: same-head; reason: none

  • Changed rules (0): none.
  • Claim: the Item and Token fix has landed and this targets main: verified (#8869 merged; the base is main).
  • Claim: Thumbnail is handled by #11613 and Selector was fixed by #8874: verified (both merged into main).
  • Claim: the ClickableCard docs say nested interactive elements work independently: verified (ClickableCard.doc.mjs:11).
  • Claim: tabbing to a nested button showed two rings and now shows one, with the card ringing only for its own control: verified (browser spec and probes at 640 and 390 px, dark mode and forced colours: card and button on the base components, the button alone on this head).
  • Claim: with the card itself focused, this change and main look identical: verified (own-stop frames pixel-identical at 640 and 390 px, in dark mode and in forced colours); the paragraph names an earlier head.
  • Claim: the cause is that both cards ringed on any focused descendant: verified (focusOutline.stylex.ts:107-120 on the base).
  • Claim: each card spreads the shared owner ring and marks its own control, a direct child of the card root: verified (ClickableCard.tsx:453, :489, :501; SelectableCard.tsx:557, :604; Card.tsx:303-342); still true after a merge with main, whose Card adds a wrapper with no element.
  • Claim: INV3 is the governing specification: verified (interaction-modality.md:150-162).
  • Claim: the browser spec gains a ClickableCard case and a new SelectableCard case at 1280 and 390 px, two rings on main and one here: verified (18 of 18 pass on this head; the 4 card cases fail on the base components).
  • Claim: CI's Chromium leg runs the spec: verified as routed (its scope matches both card folders); on a pull request that leg runs only with the ci:run-a11y label, so CI's run on this head skipped it.
  • Claim: the ClickableCard and SelectableCard unit suites pass: verified (4 files, 47 tests; CI's unit-test shards pass on this head).
  • Claim: AR3 and AR2 now say a nested control shows only its own indicator, the two-indicator bullets and gap sentences are removed with counts updated, and both verified_by lists name the browser spec: verified (ClickableCard.spec.md:29, :61, :173-175; SelectableCard.spec.md:18, :49, :151, :194-196, :245); a stale cross-reference remains at ClickableCard.spec.md:206.
  • Claim: INV3's gap list drops the two cards: verified (interaction-modality.md:160-162).
  • Claim: the writing rubric results hold: verified (no narration, research or change references added).
  • Claim: no public API changes: verified (no export, prop, type, CSS variable or default changes in the API report; the marker attribute is private and already in use).
  • Claim: public text carries no internal context: verified.
  • Claim: the land path is approval, the spec stamp, CI and the merge queue: a process statement; the spec stamp is present for this head.
  • Changeset: a patch fix for core saying each tab stop shows one ring and the card rings only for its own control: verified (behaviour verified above).
  • File .changeset/focus-ring-one-owner-cards.md: clear.
  • File apps/storybook/stories/SelectableCard.stories.tsx: clear.
  • File docs/architecture/interaction-modality.md: clear; its unchanged INV3 verification row (line 362) still says the spec covers only Selector.
  • File docs/specs/components/ClickableCard/ClickableCard.spec.md: non-blocking stale lines 206 and 221.
  • File docs/specs/components/SelectableCard/SelectableCard.spec.md: non-blocking build-status wording at lines 49 and 149.
  • File packages/core/src/ClickableCard/ClickableCard.tsx: clear.
  • File packages/core/src/SelectableCard/SelectableCard.tsx: clear.
  • File packages/core/src/__tests__/FocusRingOwner.a11y.chromium.spec.ts: clear; non-blocking scope routing for Card.

Automated review (maintainer link)

@cixzhang
cixzhang marked this pull request as ready for review November 19, 2026 12:47
@cixzhang cixzhang added the ci:run-a11y Run the accessibility suite on this PR; write access, next push (AST-030 FR12) label Nov 19, 2026
@cixzhang
cixzhang marked this pull request as draft November 20, 2026 10:14
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 643c678

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved. A keyboard-focused control inside a ClickableCard or SelectableCard now shows only its own ring, and the card still rings once for its own link, button or checkbox. CI passes on this head, and its browser accessibility leg runs the new card cases, which fail on the unfixed components. Two small follow-ups, neither blocking:

  • ClickableCard.spec.md line 206 still says AR3 "records the gap", and line 221 still says the focus outline has no automated check, although the browser spec now checks it.
  • The browser spec's @pr-a11y scope does not route a Card-only change, though the card ring depends on Card rendering the hidden control directly in its root.
Claims and files checked

Review mode: same-head; reason: none

  • Changed rules (0): none.
  • Claim: the Item and Token fix has landed and this targets main: verified (#8869 merged; the base is main).
  • Claim: Thumbnail is handled by #11613 and Selector was fixed by #8874: verified (both merged into main).
  • Claim: the ClickableCard docs say nested interactive elements work independently: verified (ClickableCard.doc.mjs:11).
  • Claim: tabbing to a nested button showed two rings and now shows one, with the card ringing only for its own control: verified (browser spec and probes: card and button rings with the unfixed components, the button alone on this head).
  • Claim: with the card itself focused, this change and main look identical: verified on this head in light, dark and forced colours (own-stop frames pixel-identical); the paragraph names an earlier commit.
  • Claim: the cause is that both cards ringed on any focused descendant: verified (focusOutline.stylex.ts:110-123 on the base).
  • Claim: each card spreads the shared owner ring and marks its own control, a direct child of the card root: verified (ClickableCard.tsx:453, :489, :501; SelectableCard.tsx:557, :604; Card.tsx:321-361).
  • Claim: INV3 is the governing specification: verified (interaction-modality.md:150-162).
  • Claim: the browser spec gains a ClickableCard case and a new SelectableCard case at 1280 and 390 px, two rings on main and one here: verified (CI runs all 18 cases of the spec on this head and they pass; the 4 card cases fail with the unfixed components).
  • Claim: CI's Chromium leg runs the spec: verified (CI's browser accessibility leg selected and passed it on this head).
  • Claim: the ClickableCard and SelectableCard unit suites pass: verified (4 files, 47 tests on this head; CI's UI test shards pass, including ClickableCard.test.tsx, ClickableCard.nestedPress.test.tsx and SelectableCard.test.tsx).
  • Claim: AR3 and AR2 now say a nested control shows only its own indicator, the two-indicator bullets and gap sentences are removed with counts updated, and both verified_by lists name the browser spec: verified (ClickableCard.spec.md:29, :61, :173-175; SelectableCard.spec.md:18, :49, :151, :194-196, :245); a stale cross-reference remains at ClickableCard.spec.md:206.
  • Claim: INV3's gap list drops the two cards: verified (interaction-modality.md:160-162).
  • Claim: the preflight run passed every step apart from network-dependent node tests that also fail on main on that machine: consistent with CI on this head (lint, typecheck, build, Storybook build, node tests, UI tests, browser accessibility and interaction specs pass); the run itself was on the author's machine.
  • Claim: the writing rubric results hold: verified (no narration, research or change references added).
  • Claim: no public API changes: verified (the repository's API generator lists no added, changed or removed entry for core or any theme).
  • Claim: public text carries no internal context: verified.
  • Claim: the land path is approval, the spec stamp, CI and the merge queue: a process statement; the spec stamp is present for this head.
  • Changeset: a patch fix for core saying each tab stop shows one ring and the card rings only for its own control: verified (behaviour verified above).
  • File .changeset/focus-ring-one-owner-cards.md: clear.
  • File apps/storybook/stories/SelectableCard.stories.tsx: clear.
  • File docs/architecture/interaction-modality.md: clear; its unchanged INV3 verification row (line 362) still says the spec covers only Selector.
  • File docs/specs/components/ClickableCard/ClickableCard.spec.md: non-blocking stale lines 206 and 221.
  • File docs/specs/components/SelectableCard/SelectableCard.spec.md: non-blocking build-status wording at lines 49 and 149.
  • File packages/core/src/ClickableCard/ClickableCard.tsx: clear.
  • File packages/core/src/SelectableCard/SelectableCard.tsx: clear.
  • File packages/core/src/__tests__/FocusRingOwner.a11y.chromium.spec.ts: clear; non-blocking scope routing for Card.

Automated review (maintainer link)

@cixzhang
cixzhang marked this pull request as ready for review November 20, 2026 13:03
@cixzhang
cixzhang merged commit 5ebe00f into main Nov 20, 2026
157 checks passed
@github-actions
github-actions Bot deleted the fix/focus-ring-one-owner-cards branch November 21, 2026 06:04

This branch was successfully deployed

1 active deployment
Preview — 643c6781 Deployed Nov 20, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:run-a11y Run the accessibility suite on this PR; write access, next push (AST-030 FR12) 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