Skip to content

fix(Item, Token): a control inside a row with its own action, or a token's Remove, rings itself - #8869

Merged
cixzhang merged 11 commits into
mainfrom
fix/focus-ring-one-owner-item-token
Nov 15, 2026
Merged

cixzhang merged 11 commits into
mainfrom
fix/focus-ring-one-owner-item-token

Conversation

@cixzhang

@cixzhang cixzhang commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Part 1 of the #8850 fixes: Item and Token. ClickableCard and SelectableCard follow in #8872 (stacked on this), Thumbnail is #11613, and Selector was fixed by #8874.

User impact

  • Who: keyboard users of an Item row that has its own onClick or href and a control in startContent or endContent (a Share button), and of a Token with a remove button.
  • Before: focusing that control showed two rings: the control's own, and a second around the whole row or token.
  • After: each of those tab stops shows one ring. The row or token rings only for its own button or link; the slot control and the remove button ring themselves.
  • Unchanged: rows that delegate to a nested control (CheckboxListItem, RadioListItem, any Item with interactiveRef) and reorderable ListItem rows with a handle keep their current ring.
Share focused in "With End Actions" Before After
1280
390
Remove focused in "Clickable With Remove" 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 focus on a row's own end-slot control or on a token's Remove, main draws two rings (the row or token, and the control) and this head (3f8b6ab) draws one, at 1280 light and dark, at 390 px and in forced colors. With the row or token itself focused, both draw one ring. No ring is clipped.

Focus-ring contact sheet: main vs this stack

Problem and solution fit

  • Cause: Item and Token painted their ring with focusOutlineStyles.focusWithin, which compiles to :has(:focus-visible) and matches any focused descendant.
  • Fix: both take the shared focus-owner ring (focusWithinOwner) from privateAttributes/focusOwner.stylex.ts, which already exists on main, and mark their own button or link with focusOwnerProps.
  • Item: in a numbered List the button and link sit inside the content cell beside the marker. That cell spreads focusOwnerGroupProps, which marks it with the same private attribute (data-astryx-focus-owner="group"), so a numbered row keeps its ring. The owner module gains that export and one more branch in its ring condition. Delegating rows keep focusWithin, because their nested control does not carry the owner marker.
  • Token: the button and the link carry the marker. The remove button rings itself, as before.

Current specification

  • architecture:interaction-modality INV3 (current): one focus move has one owning indicator; a Core wrapper that rings for one primary control takes the shared focus-owner style and owner attribute. This pull request removes Item and Token from INV3's implementation-gap list.
  • architecture:public-component-api INV23 (current): each private data attribute has one owner module. The group mark reuses the owner attribute, so there is still one attribute and one owner module.

Evidence

  • FocusRingOwner.a11y.chromium.spec.ts (real Chromium, 1280 and 390 px) tabs through every stop and asserts exactly one painted ring at each: Item › With End Actions, Item › Numbered With Actions (a button row and a link row in a decimal List), Item › With Token Action (a Token inside an Item) and Token › Clickable With Remove. On main it fails with two rings while Share or Remove has focus.
  • focusOwner.source-build.test.mjs compiles the owner module and checks every ring rule is keyed to the marked control's :focus-visible, directly or through a group cell, and never to every descendant.
  • New stories: Item › With End Actions, Item › Numbered With Actions, Item › With Token Action, and Token › Clickable With Remove.
  • Item, Token and focus-owner suites pass at this head.

Writing rubric results

Record touched: architecture:interaction-modality (the INV3 implementation-gap list).

  • R1 narration: none. The gap list states which components write their own ring conditions.
  • R2 research: none.
  • R3 evidence: none changed.
  • R4 rejected alternatives: none added.
  • R5 change references: none added.
  • R6 open questions: none touched.
  • R7 project status: none added; Item and Token leave the gap: line.

Scope

Changeset: [fix] patch for @astryxdesign/core, scoped to rows with their own onClick or href and to Token's remove button.

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

… 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.
@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 14, 2026 3:57pm 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 15, 2026, 7:06 AM 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.

The focus-ring fix works: each tab stop in the new Item and Token stories now paints one outline, as component:Token AR4 and architecture:interaction-modality INV3 require. Approval waits on one decision: focusWithinOwner and FOCUS_OWNER_ATTRIBUTE are reachable from the published @astryxdesign/core/utils and @astryxdesign/core/utils/focusOutline.stylex entry points, which makes them public API under architecture:public-component-api INV12 even though the description calls them internal, and no current spec admits them, so an engineering owner either admits them by commenting /approve-spec <full head SHA> on this pull request (the author may do so as an engineering owner) or asks for the owner condition to stay component-local in Item and Token so nothing new is exported. Independently, please fix two displaced doc comments:

  • apps/storybook/stories/Item.stories.tsx: /** Disabled items. */ now opens the With End Actions description and leaves Disabled with none; move it back above export const Disabled.
  • packages/core/src/utils/focusOutline.stylex.ts: FOCUS_OWNER_ATTRIBUTE sits between FOCUS_OUTLINE_PARTS and its JSDoc, so that export loses its documentation; declare the constant above that block or after FOCUS_OUTLINE_PARTS_NONE.

[Automated review]

Comment thread apps/storybook/stories/Item.stories.tsx Resolved
@cixzhang
cixzhang marked this pull request as draft October 30, 2026 21:05
@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review label Oct 30, 2026
…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.
@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 3f8b6ab

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
Tokenizer 103.7 kB (+232 B) · 20.3 kB CSS (+233 B) — — · — · —
MoreMenu 106.6 kB (+253 B) · 18.8 kB CSS (+197 B) — — · — · —
DropdownMenu 106.3 kB (+239 B) · 18.8 kB CSS (+197 B) — — · — · —
29 more components
Component Size LoC Visual · A11y · RTL
ContextMenu 119.9 kB (+191 B) · 18.7 kB CSS (+240 B) — — · — · —
DropdownMenuItem 27.8 kB (+275 B) · 6.9 kB CSS (+156 B) — — · — · —
BreadcrumbItem 96.3 kB (+257 B) · 13.3 kB CSS (+173 B) — — · — · —
ContextMenuItem 35.3 kB (+275 B) · 7.1 kB CSS (+154 B) — — · — · —
DropdownMenuSubMenu 79.3 kB (+267 B) · 10.4 kB CSS (+159 B) — — · — · —
DropdownMenuCheckboxItem 28.6 kB (+244 B) · 7.3 kB CSS (+159 B) — — · — · —
Typeahead 87.7 kB (+218 B) · 13.4 kB CSS (+180 B) — — · — · —
Markdown 201.4 kB (+211 B) · 21.8 kB CSS (+184 B) — — · — · —
DropdownMenuRadioItem 28.6 kB (+227 B) · 7.3 kB CSS (+159 B) — — · — · —
SelectorOption 24.0 kB (+227 B) · 6.7 kB CSS (+159 B) — — · — · —
TableCell 121.2 kB (+173 B) · 19.1 kB CSS (+207 B) — — · — · —
Table 138.1 kB (+167 B) · 19.6 kB CSS (+207 B) — — · — · —
Token · Storybook 29.5 kB (+199 B) · 4.9 kB CSS (+174 B) 604 (+13) ✓ · ✓ · —
TableHeaderCell 120.8 kB (+168 B) · 18.9 kB CSS (+204 B) — — · — · —
Item · Storybook 20.5 kB (+198 B) · 6.2 kB CSS (+161 B) 958 (+9) ✓ · ✓ · —
CheckboxListItem 79.8 kB (+188 B) · 12.0 kB CSS (+156 B) — — · — · —
RadioListItem 75.9 kB (+173 B) · 10.7 kB CSS (+153 B) — — · — · —
ListItem 78.9 kB (+155 B) · 12.0 kB CSS (+156 B) — — · — · —
lab/TransferListSelector 120.9 kB (+278 B) · 1.4 kB CSS (0) — — · — · —
lab/TransferList 112.0 kB (+249 B) · 1.2 kB CSS (0) — — · — · —
lab/DiffViewer 93.0 kB (+225 B) · 2.1 kB CSS (0) — — · — · —
lab/TabBarMoreList 101.8 kB (+198 B) · 1.8 kB CSS (0) — — · — · —
lab/CommentThread 360.4 kB (+187 B) · 2.4 kB CSS (0) — — · — · —
lab/Comments 367.7 kB (+178 B) · 2.5 kB CSS (0) — — · — · —
PowerSearch 305.8 kB (+62 B) · 25.5 kB CSS (+18 B) — — · — · —
Selector 111.9 kB (+28 B) · 18.6 kB CSS (+30 B) — — · — · —
richtext/RichTextEditorToolbar 298.5 kB (+50 B) · 454 B CSS (0) — — · — · —
Pagination 122.9 kB (+22 B) · 19.0 kB CSS (+22 B) — — · — · —
Carousel 74.5 kB (−2 B) · 11.7 kB CSS (+21 B) — — · — · —

Package size: @astryxdesign/core 7.58 MB packed (+878 B); no new dependencies.

Touched components checked; for the full suites, add ci:run-visual for Visual, ci:run-rtl for RTL.

Accessibility: 1 violation(s)

Accessibility Audit

Status: 1 accessibility violation(s) found — 1 serious.

Token - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 2/12 stories · Learn more
    • WCAG: 1.4.3 (Level AA)

Generated by PR Enrichment workflow | View full report

cixzhang added a commit that referenced this pull request Oct 30, 2026
Follows #8869: focusWithinOwner and FOCUS_OWNER_ATTRIBUTE now come from the
unexported internal/focusOutline.stylex.ts, so nothing new is published.
cixzhang added a commit that referenced this pull request Oct 30, 2026
… 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.

@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.

Requesting changes: flat Item rows and both token structures now show one focus ring per tab stop, but two regressions need fixing first.

  • In a numbered list (<List listStyle="decimal">), a ListItem with onClick or href now shows no focus indicator at all, because Item wraps the marked button in its marker-column span and :has(> [data-astryx-focus-owner]:focus-visible) only matches a direct child, so please let the condition reach it and add a numbered row to FocusRingOwner.a11y.chromium.spec.ts.
  • astryx swizzle Item and astryx swizzle Token now emit an import from @astryxdesign/core/internal/focusOutline.stylex, which packages/core/package.json does not export, so please keep the owner condition in each component's own directory or move it to an exported utility that an engineering owner admits.

[Automated review]

Comment thread packages/core/src/Item/Item.tsx Resolved
@cixzhang
cixzhang marked this pull request as ready for review October 31, 2026 03:07
…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).

@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.

Requesting changes: Item rows (flat and numbered) and both token structures now show one focus ring per tab stop, but two things need fixing first.

  • astryx swizzle Item and astryx swizzle Token now emit an import of @astryxdesign/core/internal/focusOutline.stylex, and ./internal/* subpaths are reserved for Astryx's own packages and sit outside the compatibility promise, so please define the owner condition in each component's own styles from focusVars and drop the new export, or have an engineering owner admit it as a public utility.
  • The lint check fails on packages/core/src/internal/focusOutline.stylex.ts:59 (@typescript-eslint/no-unnecessary-type-assertion); dropping the as never on styles.focusWithinOwner fixes it.

The inline comments cover three smaller fixes: the module's stale header, the browser spec's @pr-a11y scope line, and the changeset's wording about delegation rows.

[Automated review]

Comment thread packages/core/package.json Resolved
@cixzhang
cixzhang marked this pull request as draft October 31, 2026 05:06
…, 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.

@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.

The fix works where it applies: in the new stories, each tab stop in an Item row with its own action, a Token nested in a row, and a clickable or link Token with Remove now paints one focus ring instead of two. Approval waits on an engineering owner deciding whether packages/core/src/privateAttributes/focusOwner.stylex.ts and its private-attribute convention become the owner of the wrapper focus ring, which #9182, #9183 and #9190 propose but no current record establishes; an engineering owner records that decision by approving those records or by commenting /approve-spec <full head SHA> on this pull request, and the author may do so as an engineering owner. Two fixes are needed either way:

  • astryx swizzle Item and astryx swizzle Token now emit an import of @astryxdesign/core/privateAttributes/focusOwner.stylex, which Core does not export, so the swizzle copy change has to land in or before this pull request.
  • The changeset says no control inside an Item rings the row any more, but delegation rows (CheckboxListItem, RadioListItem, any Item with interactiveRef) still show two rings; scope it to rows with their own onClick or href.

[Automated review]

Comment thread packages/core/src/Item/Item.tsx Resolved
@cixzhang
cixzhang marked this pull request as ready for review October 31, 2026 19:54
@cixzhang
cixzhang marked this pull request as draft November 2, 2026 20:15
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

@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 fix works where it applies: in the new stories, each tab stop in an Item row with its own action, a Token nested in a row, and a clickable or link Token with Remove now paints one focus ring instead of two. The earlier question about where the shared ring lives is settled, since main now names privateAttributes/focusOwner.stylex.ts as its owner.

  • Regression: the branch no longer merges into main, which now has its own privateAttributes/focusOwner.stylex.ts, FocusRingOwner.a11y.chromium.spec.ts and focusRings.ts plus changes to Item.tsx, so please update the branch and add the Item and Token cases to main's module and spec instead of replacing them.
  • Newly live check: data-astryx-focus-owner-group is written in the owner module of data-astryx-focus-owner (focusOwner.stylex.ts:28), which the private-attribute lint on main rejects because each owner module writes only its own attribute; a value of that attribute, such as data-astryx-focus-owner="group", would keep the numbered-row ring.
  • The changeset and title say no control inside an Item rings the row any more, but delegation rows (CheckboxListItem, RadioListItem, any Item with interactiveRef) still show two rings, so please scope both to rows with their own onClick or href.

Updating the branch also brings main's swizzle support for owner modules, which settles the earlier swizzle import concern.

Automated review (maintainer link)

…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.
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 12, 2026
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 0529a47

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 12, 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.

Changes requested. Item rows and Tokens with their own button or link now key their ring to that control, so a control in a row's slot or a token's Remove rings alone, and the architecture:interaction-modality wording change is approved for this head.

  • data-astryx-focus-owner-group is a second private attribute written in the focus-owner module (focusOwner.stylex.ts:27 and :31), which the one-owner-module rule for private attributes forbids and the private-attribute lint rejects under CI's strict mode, so mark the cell with a value of the owner's own attribute, data-astryx-focus-owner="group", which keeps the numbered-row ring and passes the lint.
  • The changeset (line 5) and the title say no control inside an Item rings the row any more, but delegating rows (CheckboxListItem, RadioListItem, any Item with interactiveRef) and reorderable ListItem rows with a handle still show the row's ring beside an end-slot control's own, so please scope both to rows with their own onClick or href.
  • The description still describes an earlier state of the branch (its line counts, a lint-rule and ring-helper change, the owner module being created here and its exports, the Numbered With Actions story, the delegation reason and the swizzle merge gate), so please update it to this head.

The new browser cases have not run yet because CI skipped this draft. Two small comment rewrites are suggested inline.

Claims and files checked
  • Changeset: a control in an Item's start or end slot no longer rings the row: true for rows with onClick or href (Item.tsx:904, :921, :1049); false for delegating rows (Item.tsx:1049) and reorderable rows with a handle (ListItem.tsx:641).
  • Changeset: a token's Remove no longer rings the token: verified (Token.tsx:481, :503, :558, :583).
  • Changeset: a row or token rings only for its own action, and a row without one draws no ring: true except for those rows.
  • Changeset: a patch for core: verified.
  • The cause is the any-descendant :has(:focus-visible) ring: verified (utils/focusOutline.stylex.ts:107-120).
  • The owner module is created here: false, it already exists on main; this change adds the group props.
  • The owner module exports only the ring and the marker props: false, it also exports the overlay ring (focusOwner.stylex.ts:97).
  • The wrapper rings only for its marked control, directly or one level down in a marked group: verified (focusOwner.stylex.ts:30-56).
  • No package entry exports the module: verified (packages/core/package.json unchanged).
  • Item's invisible button and link carry the marker, and the numbered cell spreads the group props: verified (Item.tsx:904, :921, :1095).
  • Delegation keeps the old ring because its control is the row's only tab stop: the code is as stated (Item.tsx:1049); the reason is false (Item.tsx:239-250).
  • Token's button and link carry the marker, with or without Remove: true with Remove (Token.tsx:481, :583); without Remove the link is the token itself and rings itself.
  • Remove rings itself: verified (Token.tsx:353).
  • The cited interaction-modality and public-component-api clauses are current: verified on main.
  • The browser spec tabs every stop at two widths and asserts one ring, including a Token inside an Item and numbered rows: verified in code (FocusRingOwner.a11y.chromium.spec.ts:333-374); not run.
  • The ring helper is new: false, it is unchanged from main.
  • The compiled-CSS test checks every ring rule is keyed to the marked control: verified (focusOwner.source-build.test.mjs:45-56).
  • The new stories: With End Actions and Clickable With Remove verified; Numbered With Actions is a button row and a link row, not Share and Restore rows (Item.stories.tsx:380); With Token Action is also new.
  • Item, Token, List and utils suites pass: not checked.
  • No public API, the shared focus-outline utility unchanged, the focus-outline lint admits the owner module: verified.
  • Line counts and the lint-rule and helper changes: false (212 added, 29 deleted; no lint or helper change).
  • The merge gate on the swizzle copy change: already met on main.
  • Files: focusOwner.stylex.ts (finding; comment suggestion), .changeset/focus-ring-one-owner-item-token.md (finding), Item.tsx (clear; comment suggestion), Token.tsx (clear), TokenLink.tsx (clear), interaction-modality.md (clear; its verification row goes stale), Item.stories.tsx (clear), Token.stories.tsx (clear), FocusRingOwner.a11y.chromium.spec.ts (clear), focusOwner.source-build.test.mjs (clear; update it with the fix).

Automated review (maintainer link)

Comment thread packages/core/src/Item/Item.tsx Resolved
…e changeset

Marks Item's numbered content cell with data-astryx-focus-owner="group"
instead of a second private attribute, so the owner module writes one
attribute. The changeset now names only rows with their own onClick or
href and Token's remove button. Comments keep their reason without a
record citation.
@cixzhang cixzhang changed the title fix(Item, Token): a control inside rings itself, not the row or token too fix(Item, Token): a control inside a row with its own action, or a token's Remove, rings itself Nov 14, 2026
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 3f8b6ab

@cixzhang cixzhang added the ci:run-a11y Run the accessibility suite on this PR; write access, next push (AST-030 FR12) label Nov 14, 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: some required checks are still running on this head.

Item rows with their own button or link, and clickable or link Tokens, now ring only for that control, as the shared one-owner focus rule and Token's accessibility requirement ask. CI's Chromium spec confirms one ring at every Item and Token tab stop at desktop and phone widths, and the swizzle proof passes for the changed components.

Two optional tidy-ups, neither blocking:

  • The description's rubric line names only the INV3 gap list, but the record change also adds the group-props sentence to INV3; naming it keeps the approval trail exact.
  • INV3's verification row still says the Chromium spec covers Selector alone, and Token's record still lists the double ring on Remove as an implementation gap; both can be updated now that this fixes it.
Claims and files checked

Review mode: same-head; reason: none

  • Changeset: a row with its own onClick or href no longer rings when a start- or end-slot control takes focus: verified (Item.tsx:916, :933, :1035; Share drops from 2 rings to 1 in Chromium).
  • Changeset: a token's remove button no longer rings the whole token: verified (Token.tsx:479-482, :503, :558, :583; Remove drops from 2 to 1 in the clickable and the link token).
  • Changeset: rows that delegate to a nested control, and reorderable rows with a handle, keep their ring: verified (Item.tsx:1035; ListItem.tsx:650; a delegating row stays at 2).
  • Changeset: a patch release of core: verified.
  • This is the Item and Token part of the double-ring bug; the cards follow in a stacked pull request, Thumbnail in another, and Selector is already fixed: verified.
  • Before, focusing the slot control or Remove showed two rings; after, one; delegating and reorderable rows keep their current ring: verified.
  • Stills: one ring at this head and two on main at desktop light and dark, phone width and forced colours, and no ring is clipped: verified at desktop light from captured frames and at desktop and phone widths by CI's spec; the dark and forced-colour stills are the author's, and the ring condition does not depend on colour scheme.
  • The cause is the any-descendant ring: verified (utils/focusOutline.stylex.ts, focusWithin).
  • The owner module already exists on main; both components take its ring and mark their own button or link: verified.
  • A numbered row's content cell carries the same attribute with a group value, and the module gains that export and one ring branch: verified (Item.tsx:1082; focusOwner.stylex.ts:26-31).
  • Delegating rows keep the old ring because their nested control carries no marker: verified (Item.tsx:1035).
  • Token's button and link carry the marker, and Remove rings itself: verified.
  • The cited one-owner and private-attribute clauses are current, and Item and Token leave the INV3 gap list: verified.
  • The group mark keeps one attribute and one owner module: verified (strict lint 0 errors; CI lint passes).
  • The browser spec tabs every stop of the four stories at 1280 and 390 px and asserts one ring, and fails on main at Share or Remove: verified (CI passes it on this head; base frames show two rings at Share and Remove).
  • The compiled-CSS test keys every ring rule to the marked control, directly or through a group cell: verified, passes.
  • New stories With End Actions, Numbered With Actions, With Token Action and Clickable With Remove: verified (Item.stories.tsx:334, :367, :381; Token.stories.tsx:172).
  • Item, Token and focus-owner suites pass: verified.
  • The record change is the INV3 gap list: incomplete; INV3 also gains the group-props sentence (interaction-modality.md:157-160), and the rubric results hold for it.
  • No public API, and no package entry exports the owner module: verified (API surfaces identical; CI's API report lists no change).
  • Public text carries no internal context: verified.
  • Files: privateAttributes/focusOwner.stylex.ts (clear), Item/Item.tsx (clear), Token/Token.tsx (clear), Token/TokenLink.tsx (clear), docs/architecture/interaction-modality.md (clear; verification-row note), .changeset/focus-ring-one-owner-item-token.md (clear), Item.stories.tsx (clear), Token.stories.tsx (clear), FocusRingOwner.a11y.chromium.spec.ts (clear), focusOwner.source-build.test.mjs (clear).
  • Review rules changed since the last review (same-head re-review, review mode line): checked: the review rules, this pull request's conversation, labels, approvals and CI on this head; no finding.

Automated review (maintainer link)

cixzhang added a commit that referenced this pull request Nov 14, 2026
@cixzhang
cixzhang marked this pull request as ready for review November 15, 2026 06:42
@cixzhang
cixzhang merged commit 30b12dd into main Nov 15, 2026
154 checks passed
@github-actions
github-actions Bot deleted the fix/focus-ring-one-owner-item-token branch November 16, 2026 06:04
cixzhang added a commit that referenced this pull request Nov 20, 2026
…t the card too (#8872)

* 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(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

* 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 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 main into fix/focus-ring-one-owner-item-token; use main's focusOwner 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.

* Merge the rebuilt Item/Token branch into fix/focus-ring-one-owner-cards

The branch below now sits on main and uses main's focusOwner module. The
cards keep their change: ClickableCard and SelectableCard mark their own
link, button or checkbox with focusOwnerProps and ring through
focusWithinOwner, so a control in their children rings itself. The card
cases join main's FocusRingOwner spec; main's ring helper already skips a
visually hidden control.

* docs(interaction-modality): name the focus-owner group props; Item and Token leave the INV3 gap

* Merge fix/focus-ring-one-owner-item-token; the cards leave the INV3 gap

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

* fix(Item, Token): the group cell reuses the owner attribute; scope the changeset

Marks Item's numbered content cell with data-astryx-focus-owner="group"
instead of a second private attribute, so the owner module writes one
attribute. The changeset now names only rows with their own onClick or
href and Token's remove button. Comments keep their reason without a
record citation.

* Merge commit '3f8b6ab82afdda44e6461662604b8d6576037aa5' into l0-tmp-8872

* fix(ClickableCard, SelectableCard): comments without record citations; the records close the focus gap

The two ring comments keep their reason without the record citation the
comment-provenance lint rejects. Both card records now state that a
nested control shows only its own indicator, drop the two-indicator gap,
and list the focus-owner browser spec.

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

# Conflicts:
#	docs/architecture/interaction-modality.md
#	packages/core/src/__tests__/FocusRingOwner.a11y.chromium.spec.ts

* docs(SelectableCard): FR4 drops the nested-control focus gap this change 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.

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

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

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

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

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

This branch was successfully deployed

1 active deployment
Preview — 3f8b6ab8 Deployed Nov 14, 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. needs:design-review Affects visuals — Design should review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant