Skip to content

spec(interaction-modality): wrapper focus rings come from one shared owner module - #9183

Merged
cixzhang merged 5 commits into
mainfrom
spec/focus-owner-attribute
Oct 31, 2026
Merged

cixzhang merged 5 commits into
mainfrom
spec/focus-owner-attribute

Conversation

@cixzhang

@cixzhang cixzhang commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Maintainer impact

Item, Token, the clickable and selectable cards, Thumbnail and the Selector triggers paint a ring on their wrapper for one primary control while other controls sit inside them. Today a nested control can light both rings, or each component writes its own copy of the wiring. This record makes every such wrapper take one shared ring style and one private owner attribute from a single internal module, so keyboard users see exactly one ring and the ring has one definition.

Decision

  • interaction-modality INV3: a Core wrapper that paints the ring for one primary control takes the one shared focus-owner style and owner attribute from privateAttributes/focusOwner.stylex.ts; the wrapper rings only while that control has keyboard focus, a nested owner or a sibling control rings itself, and no component writes the attribute or its selector itself.
  • Owning code adds privateAttributes/focusOwner.stylex.ts, which is not exported from the package.
  • The INV3 verification row adds a Token inside an Item and a control inside a card.

The module follows the private-attribute owner-module convention (public-component-api INV23, proposed alongside it), so it lives in that convention's folder.

Evidence

  • The shared selector compiles with no warnings under the repository's StyleX options.
  • Real-browser keyboard checks: one ring in every nesting case (card owner, Item in a card, Token in an Item, chip in a card); sibling buttons ring themselves.
  • Restyle cost on a 1,500-paragraph document: 4 elements per Enter, the same as today's ring.

Writing rubric results

  • R1 narration: none; the INV3 sentences state what wrappers do, and the implementation gap is stated as the current state.
  • R2 research in the record: none; the compile, browser and restyle-cost evidence lives in this description.
  • R3 evidence naming a change: none; the verification row names cases and failure signals.
  • R4 rejected alternatives over one line or outside a decision: none in the record.
  • R5 pull request or issue references remaining: none.
  • R6 open questions with answers still listing options: none.

@vercel

vercel Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
astryx Error Error Oct 31, 2026 7:31pm UTC

Request Review

@astracat-bot

astracat-bot Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🔄 In progress (for maintainers only) Oct 31, 2026, 7:27 PM UTC

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

Copy link
Copy Markdown
Contributor Author

/approve-spec 6fee387

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

github-actions Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

Preview: the links below open this branch's latest Vercel deployment, which can trail a new push until that push's deployment is ready.

📚 Storybook Preview

View Storybook for this PR

🧪 Sandbox Preview

View Sandbox for this PR

No new or modified components detected.

Bundle Size Summary

No component packages changed.

Published Package Size

No published package changed size (11 measured).

Download is the gzip tarball npm fetches; unpacked is what lands in node_modules.

Accessibility Audit

Status: Accessibility did not run on this pull request; add ci:run-a11y to run it. It runs after merges to main and before each release.


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

@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 INV3 direction is approved, but the record names privateAttributes/focusOwner.stylex.ts, which doesn't exist yet, while Item, Token, the clickable and selectable cards, Thumbnail, the Selectors and SideNavItem still write their own ring conditions. Please mark that as an implementation gap in INV3 and open the INV3 verification row's new cases with an evidence-gap note, as the INV11 row and INV13 already do, or land the module together with the record. Please also redo the ## Writing rubric results lines using the six R1–R6 items from the specification template, saying what each pass found.

[Automated review]

| ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| INV1, INV2 | Programmatic-focus cases after keyboard and pointer input in representative component tests | Programmatic focus invents a modality, or pointer history paints the keyboard indicator |
| INV3 | Direct-owner, wrapper-owner, replaceable-indicator, and nested-action cases | No indicator, two indicators, or replacement content can opt out |
| INV3 | Direct-owner, wrapper-owner, replaceable-indicator, and nested-action cases, including a Token inside an Item and a control inside a card, with the wrapper ring from `privateAttributes/focusOwner.stylex.ts` | No indicator, two indicators, replacement content that can opt out, or a component that writes the focus-owner attribute or selector itself |

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 row and INV3 (lines 118–123) cite privateAttributes/focusOwner.stylex.ts, which doesn't exist yet, while ten wrapper sites still use focusWithin, focusWithinFirstChild or focusWithinCombobox. Suggest opening the new cases the way the INV11 row does ("Evidence gap: the focus-owner module and its adopters are pending. Then: …"), plus an implementation-gap note in INV3 naming the wrappers still on focusOutline.stylex.ts.

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec d1920d3

@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 INV3 direction is approved, and the gap marking and rubric results now read correctly, but the INV3 implementation-gap sentence leaves out the Chat composer. ChatComposer's body rings for its editor among the header, footer and send actions with its own state-gated condition (packages/core/src/Chat/ChatComposer.tsx:552-561), which is exactly the wrapper INV3 now covers, so please add it to the gap sentence or say why it sits outside INV3. Separately, when the module lands, astryx swizzle will need a way to carry it, since the record keeps it unexported and swizzle rewrites cross-directory .stylex imports to package subpaths.

[Automated review]

Comment on lines +124 to +126
gap: the module does not exist yet, and Item, Token, the clickable and
selectable cards, Thumbnail, the Selectors, and SideNavItem write their own
ring conditions.

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 list leaves out the Chat composer: its body rings for the editor among the header, footer and send actions, and it writes its own condition (hasKeyboardEditorFocus && focusOutlineStyles.focusWithin, packages/core/src/Chat/ChatComposer.tsx:552-561). Suggest adding "the Chat composer's body" here, or stating why it is outside INV3.

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 4db674d

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

Recommending approval: the INV3 focus-owner rule is approved by an engineering owner at this head, and its implementation-gap sentence now names every wrapper that still writes its own ring condition, the Chat composer's body included. Nothing more is needed in this pull request; the owner module, its adopters, the swizzle carry and the new INV3 verification cases (a Token inside an Item, a control inside a card) follow with the implementation.

[Automated review]

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec eecb7ac

@cixzhang cixzhang closed this Oct 31, 2026
@cixzhang cixzhang reopened this Oct 31, 2026
@cixzhang
cixzhang merged commit 932cfb9 into main Oct 31, 2026
61 of 92 checks passed
@github-actions
github-actions Bot deleted the spec/focus-owner-attribute branch November 1, 2026 06:05

This branch had an error being deployed

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

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant