Skip to content

fix(core): fields with a status keep their keyboard focus ring (and the theme editor follows) - #12139

Merged
josephfarina merged 3 commits into
mainfrom
josephfarina/status-field-focus-ring
Nov 18, 2026
Merged

josephfarina merged 3 commits into
mainfrom
josephfarina/status-field-focus-ring

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

User impact

A field with an error, warning or success status showed no keyboard focus. Its status border stays the status color on focus, and the inset focus ring every other field draws was missing, so a keyboard user could not see which field was focused, exactly when a form had errors. This affected TextInput, TextArea, NumberInput, Selector, MultiSelector, the date and time fields, Typeahead, Tokenizer and PowerSearch.

Problem and solution fit

The shared status hover styles in Field/inputStyles.stylex.ts declare a whole boxShadow (none at rest, the status tint on hover). StyleX applies the last boxShadow whole, so it replaced the base style's :focus-within ring. Each status hover style now declares the same :focus-within ring as the base style. One change in the shared styles fixes every field that uses them. No token changes, and no change at rest or on hover.

Theme editor follow-through

The theme editor reads Core's focus rings, and four of its tests pinned the old output, where status fields drew no ring while focused. Those expectations now follow Core: a status field keeps its ring, under a resting shadow when there is one, and a focus-ring change reaches status fields too.

One real gap showed up. Asking to change the inputs' focus ring "but keep the invalid ones" wrote the error fields' resting shadow, not their focus ring. Before, this worked only by accident, because Core drew none. A kept status now keeps its ring as Core draws it while focused. The keep stays on the whole input group, so it reaches every input the new ring reaches, DateTimeInput and ComplexSelector included, whose fields draw the status.

Expected behavior and authority

Keyboard focus is visible on every field (WCAG 2.4.7), as for a field without a status. The status border color on focus is unchanged.

Smallest restoration

  • Core: three :focus-within entries in one shared style, a browser test, and a [fix] changeset.
  • Theme editor: the keep fix (two branches in _how-question.mjs), four test files updated to the fixed Core output with the keep test extended to every input, and an [experimental] changeset naming astryx experimental theme editor how.

Evidence

  • New browser test FieldStatusFocusRing.a11y.chromium.spec.ts: on each field's status comparison story it tabs to every field and requires its edge to change on focus.
    • Before (main): fails for all 11 stories; every status field's edge is the same focused and at rest.
    • After: passes for all 11.
  • Unit tests for Field, Selector, TextInput and TextArea pass.
  • A replay of build against main moves no start, alternative or block list.

Scope

Components: Field shared input styles (TextInput, TextArea, NumberInput, Selector, MultiSelector, DateInput, DateRangeInput, DateTimeInput, TimeInput, Typeahead, Tokenizer, PowerSearch); CLI astryx experimental theme editor how (keeping a status's focus ring)

  • One defect is restored.
  • Separable contradictory or unsettled tagalongs were removed or split.
  • No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
  • Public text and artifacts contain no internal Meta context.

Testing

  • playwright test --config playwright.config.ts --project chromium FieldStatusFocusRing with a built Storybook: 11 passed (11 failed on main).
  • vitest run packages/core/src/Field packages/core/src/Selector packages/core/src/TextInput packages/core/src/TextArea: 821 passed.
  • vitest run --project node packages/cli/api/theme-edit: the four updated files pass (30 tests), with the browser step (ASTRYX_THEME_EDITOR_BROWSER=1) included; the extended keep test fails without the keep fix (DateTimeInput loses its error ring). The suite's 15 app-copy and compile-check failures on this box fail identically on main.
  • prettier and eslint on the changed files: clean.

@vercel

vercel Bot commented Nov 16, 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 16, 2026 11:43pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 16, 2026
@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review label Nov 16, 2026
@astracat-bot

astracat-bot Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 17, 2026, 12:12 AM UTC

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 9cde0f0

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
PowerSearch 307.0 kB (+9 B) · 25.6 kB CSS (0) — — · — · —
lab/Comments 370.4 kB (+9 B) · 2.5 kB CSS (0) — — · — · —
lab/CommentComposer 174.1 kB (+8 B) · 1.9 kB CSS (0) — — · — · —
28 more components
Component Size LoC Visual · A11y · RTL
richtext/RichTextEditorToolbar 299.8 kB (+7 B) · 454 B CSS (0) — — · — · —
DateInput 200.2 kB (+6 B) · 18.0 kB CSS (0) — — · — · —
Selector 113.0 kB (+6 B) · 18.7 kB CSS (0) — — · — · —
Tokenizer 104.4 kB (+6 B) · 20.4 kB CSS (0) — — · — · —
lab/TransferListSelector 121.2 kB (+6 B) · 1.4 kB CSS (0) — — · — · —
Typeahead 88.0 kB (+5 B) · 13.5 kB CSS (0) — — · — · —
lab/TransferList 112.2 kB (+5 B) · 1.2 kB CSS (0) — — · — · —
richtext/RichTextEditor 305.9 kB (+5 B) · 2.6 kB CSS (0) — — · — · —
DateRangeInput 99.4 kB (+4 B) · 13.3 kB CSS (0) — — · — · —
DateTimeInput 223.7 kB (+4 B) · 19.8 kB CSS (0) — — · — · —
TextArea 66.9 kB (+4 B) · 9.4 kB CSS (0) — — · — · —
lab/ChatEmojiPicker 113.7 kB (+4 B) · 773 B CSS (0) — — · — · —
lab/ChatReactionBar 114.9 kB (+4 B) · 1.1 kB CSS (0) — — · — · —
lab/CommentThread 363.6 kB (+4 B) · 2.4 kB CSS (0) — — · — · —
MultiSelector 101.6 kB (+3 B) · 17.8 kB CSS (0) — — · — · —
lab/EmojiPicker 92.5 kB (+3 B) · 751 B CSS (0) — — · — · —
Pagination 123.9 kB (+2 B) · 19.1 kB CSS (0) — — · — · —
TextInput 72.8 kB (+2 B) · 12.0 kB CSS (0) — — · — · —
ChatComposer 84.6 kB (0) · 12.9 kB CSS (0) — — · — · —
ComplexSelector 77.7 kB (0) · 12.7 kB CSS (0) — — · — · —
Field 59.5 kB (0) · 7.3 kB CSS (0) — ✓ · ✓ · —
FieldLabel 55.4 kB (0) · 5.8 kB CSS (0) — ✓ · ✓ · —
FileInput 74.2 kB (0) · 11.7 kB CSS (0) — — · — · —
InputGroup 61.1 kB (0) · 7.9 kB CSS (0) — — · — · —
NumberInput 77.6 kB (0) · 12.2 kB CSS (0) — — · — · —
lab/ListInput 93.6 kB (0) · 922 B CSS (0) — — · — · —
lab/SelectableCardGroup 68.9 kB (0) · 162 B CSS (0) — — · — · —
TimeInput 175.0 kB (−4 B) · 17.0 kB CSS (0) — — · — · —

Package size:

  • @astryxdesign/cli 5.23 MB packed (+318 B); no new dependencies
  • @astryxdesign/core 7.62 MB packed (+175 B); no new dependencies

API changes: core +0 · ~1 · −0

1 API change (advisory)
Package Where Signature Usage
~ core . · Values · const inputStatusHoverShadowStyles const inputStatusHoverShadowStyles: Readonly<{ readonly warning: Readonly<{ readonly boxShadow: stylex.StyleXClassNameFor<"boxShadow", "none" | { readonly '@media (hover: hover)': stylex.StyleXVar … #de6f47e5 → const inputStatusHoverShadowStyles: Readonly<{ readonly warning: Readonly<{ readonly boxShadow: stylex.StyleXClassNameFor<"boxShadow", "none" | `inset 0px 0px 0px 2px ${stylex.StyleXVar<"light-dar … #1517abee import {inputStatusHoverShadowStyles} from '@astryxdesign/core'

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


Generated by PR Enrichment workflow | 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.

Approved pending CI: the required checks have not run on this head yet, because the CI workflow stopped when CI was full, so re-run it before merging.

Restating the base :focus-within ring in each status hover style gives fields with an error, warning or success status a visible keyboard focus again, and the new Chromium spec fails on all 11 status stories without the fix and passes with it.

  • Non-blocking: the comment repeated three times in inputStyles.stylex.ts is one 31-word sentence with three topics; consider stating it once in shorter sentences (see the inline suggestion).
  • Non-blocking: the spec checks each field at its first tab stop only, so the status-tooltip, calendar and clear button stops are not covered.
Claims and files checked

Review mode: full; reason: no-earlier-review

  • Claim: a field with a status showed no keyboard focus. Verified: on the base the focused status field's edge is unchanged on all 11 status stories.
  • Claim: the status border keeps its status color on focus. Verified: inputStyles.stylex.ts:99-127 and the focused-field probe.
  • Claim: the inset ring other fields draw was missing. Verified: the base style draws it at inputStyles.stylex.ts:71, and a focused field without a status shows it.
  • Claim: TextInput, TextArea, NumberInput, Selector, MultiSelector, the date and time fields, Typeahead, Tokenizer and PowerSearch were affected. Verified: each applies inputStatusHoverShadowStyles (RichTextEditor does too).
  • Claim: the status style's whole boxShadow replaced the base ring. Verified: built class lists and the focused-field probe.
  • Claim: each status style now declares the same ring as the base. Verified: inputStyles.stylex.ts:145, :158 and :171 match :71, and the build reuses the same atomic class.
  • Claim: no token change and no change at rest or on hover. Verified: no token file changes, the built CSS is byte-identical, and the at-rest probe is identical.
  • Claim: keyboard focus is visible on every field and the status border is unchanged on focus. Verified on 11 stories; DateTimeInput and RichTextEditor by code.
  • Claim: the restoration is three ring entries, a browser spec and a changeset. Verified: the three changed files.
  • Claim: the spec tabs to every field and requires its edge to change. Verified by reading; it checks each field once.
  • Claim: the spec fails on all 11 stories before the fix and passes after. Verified: 11 failed on the base with the spec copied in, 11 passed on the head.
  • Claim: the Field, Selector, TextInput and TextArea unit tests pass (821). Verified: 34 files, 821 passed.
  • Claim: a replay of the build against main moves no start, alternative or block list. Not checkable as written, since it names no command or list; the built CSS and the API surface show only the one type change.
  • Claim: one defect is restored, nothing else rides along, and the text holds no private context. Verified: one restored behavior, one type row that follows from it, and no private terms.
  • Claim: prettier and eslint are clean on the changed files. Verified.
  • Changeset claim: a status field shows keyboard focus again. Verified, including "again": status fields drew a status-colored focus outline before the field focus treatment moved to the shadow.
  • Changeset claim: the status style replaced the whole shadow, so a focused status field looked unfocused. Verified: rest and focus matched on the base.
  • Changeset claim: the fix covers the listed components. Verified.
  • File .changeset/status-field-focus-ring.md: clear.
  • File packages/core/src/Field/__tests__/FieldStatusFocusRing.a11y.chromium.spec.ts: clear (non-blocking note on reach).
  • File packages/core/src/Field/inputStyles.stylex.ts: clear (non-blocking comment-style suggestion).

Automated review (maintainer link)

Comment on lines +142 to +144
// This boxShadow replaces the base one whole, so it keeps the base
// focus ring: the status border does not change on focus, and the ring
// is the only sign of keyboard focus.

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 (comment style): this is one 31-word sentence with three topics, and it repeats at lines 155-157 and 168-170. Consider stating it once, for example in the JSDoc above inputStatusHoverShadowStyles:

// StyleX keeps only the last boxShadow. Repeat the base focus ring here.
// The status border keeps its color on focus, so the ring is the only focus cue.

@josephfarina josephfarina changed the title fix(core): fields with a status keep their keyboard focus ring fix(core): fields with a status keep their keyboard focus ring (and the theme editor follows) Nov 16, 2026
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 6093cae

@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 Core fix restores the focus ring on fields with a status and needs nothing more; the theme-editor half needs these fixes:

  • The keep answer for "make the focus ring on inputs red but keep the invalid ones" no longer keeps invalid DateTimeInput and ComplexSelector fields, because the compiled theme gets .astryx-date-time-input:focus-within and .astryx-complex-selector:focus-within ring rules without the [data-status="error"] exceptions main writes, so please keep every member the group ring reaches (or name the ones it cannot keep) and extend the keep test to them.
  • .changeset/theme-edit-keep-status-ring.md describes a change confined to astryx experimental theme editor how, which spec:AST-017 FR22 releases as an [experimental] note that names the command, not as [fix].
  • The description's Smallest restoration, Scope and Testing sections cover only the Core change, so please add the theme-editor change, its changeset and the CLI test run.

CI did not run at this head (the run stopped because CI was full), so it needs a re-run.

Claims and files checked

Review mode: incremental; reason: none

Claims:

  • Status fields showed no keyboard focus because the status hover style replaced the whole field shadow: verified (shared status styles in inputStyles.stylex.ts; the browser spec fails on the base).
  • The fix reaches TextInput, TextArea, NumberInput, Selector, MultiSelector, the date and time fields, Typeahead, Tokenizer and PowerSearch: verified (each composes the shared status style).
  • Each status style declares the same focus ring as the base style, with no token change and no change at rest or on hover: verified (inputStyles.stylex.ts:71, :145, :158, :171; the hover selector excludes focus).
  • The status border color on focus is unchanged: verified (inputStatusBorderStyles).
  • The smallest restoration is three focus entries, a browser test and one changeset: false at this head (it also changes the theme editor and four CLI tests and adds a second changeset).
  • The browser spec fails on all 11 stories before and passes on all 11 after: verified.
  • Field, Selector, TextInput and TextArea unit tests pass: verified (821 passed on this Core code).
  • A replay of build moves no recommendation: consistent, not rerun (no changed file feeds the build recommender).
  • No new public API, default or interaction model hides under the fix label: verified (one style type widens for an appearance fix).
  • Core changeset, status fields show keyboard focus again: verified.
  • CLI changeset, a kept status keeps its ring as Core draws it while focused: false for DateTimeInput and ComplexSelector.
  • CLI changeset, a ring change now reaches status fields unless they are kept: verified (CLI tests).

Files:

  • .changeset/status-field-focus-ring.md: clear
  • .changeset/theme-edit-keep-status-ring.md: wrong tag ([fix] for an experimental command)
  • packages/cli/api/theme-edit/_how-question.mjs: keep leaves two inputs unkept
  • packages/cli/api/theme-edit/theme-part-text-sits-core.test.mjs: clear
  • packages/cli/api/theme-edit/theme-readers-part-named-color.test.mjs: asserts one member only
  • packages/cli/api/theme-edit/theme-state-part-states-changed.test.mjs: clear
  • packages/cli/api/theme-edit/theme-table-cells-borders-colored.test.mjs: clear
  • packages/core/src/Field/__tests__/FieldStatusFocusRing.a11y.chromium.spec.ts: clear
  • packages/core/src/Field/inputStyles.stylex.ts: clear (non-blocking comment-style note)

Automated review (maintainer link)

@josephfarina
josephfarina force-pushed the josephfarina/status-field-focus-ring branch from 6093cae to 9cde0f0 Compare November 16, 2026 23:29
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 9cde0f0

@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's run on this head was cancelled when CI was full, so re-run it before merging.

Fields with an error, warning or success status now keep the shared focus ring while focused, and the theme editor's keep answer now keeps invalid fields on every input the new ring reaches. Two optional follow-ups:

  • The comment repeated three times in inputStyles.stylex.ts is one long sentence with three topics; the existing inline suggestion still applies.
  • The new browser spec does not list DateTimeInput, which takes the same ring; adding its error-status story would cover it.
Claims and files checked

Review mode: full; reason: rebase

Claims:

  • Status fields (error, warning, success) showed no focus change on the base and now draw the shared ring: verified, computed styles in Chromium on the base and head Storybooks.
  • The status style replaced the whole field shadow, so a focused status field looked unfocused: verified, inputStyles.stylex.ts status entries and the base probe (no shadow, unchanged border while focused).
  • The fix covers TextInput, TextArea, NumberInput, Selector, MultiSelector, the date and time fields, Typeahead, Tokenizer and PowerSearch: verified, the same probe on each of their status stories, DateTimeInput included.
  • Each status style declares the base style's focus ring, with no token change and no change at rest or on hover: verified, inputStyles.stylex.ts:71, :145, :158, :171; rest shadow unchanged in the probe.
  • The status border color on focus is unchanged: verified, probe border color identical focused and at rest.
  • A plain-language keep of the invalid ones wrote the error fields' resting shadow once Core drew the ring: verified, the editor's answer with the base editor and the head's Core.
  • A kept status now keeps its ring as Core draws it while focused, on every input the new ring reaches: verified, the editor's answer and compiled theme CSS at this head, all 11 inputs.
  • Before, the keep matched Core only because Core drew no ring: verified, the base editor writes no ring for each status.
  • The new browser spec fails on the base for all 11 stories and passes at the head: verified through an equivalent computed-style probe on the same stories; the spec itself did not run here or in CI.
  • Unit tests for Field, Selector, TextInput and TextArea pass: verified, 821 passed.
  • The four updated theme-editor test files pass, browser step included: verified, 30 passed plus the browser step 8 of 8.
  • A replay of the page builder moves no start, alternative or block list: verified, no file the build command reads changes.
  • The theme-editor suite's other failures on the author's machine are not caused by this change: verified here, the whole suite passes at this head.
  • Prettier and ESLint are clean on the changed files: verified.
  • The Core release note is a patch fix and the CLI note is an experimental patch naming astryx experimental theme editor how: verified, both changesets.
  • The editor's tests now follow Core, so a ring change reaches status fields and a status keeps its ring under a resting shadow: verified, the four updated files and the editor's answers on the base and at this head.
  • No new public API, look, default or interaction model hides under the fix: verified; the one API change is the existing style's declared value type, and the look is the existing ring.
  • Public text carries no internal context: verified.

Files:

  • .changeset/status-field-focus-ring.md: clear
  • .changeset/theme-edit-keep-status-ring.md: clear
  • packages/cli/api/theme-edit/_how-question.mjs: clear
  • packages/cli/api/theme-edit/theme-part-text-sits-core.test.mjs: clear
  • packages/cli/api/theme-edit/theme-readers-part-named-color.test.mjs: clear
  • packages/cli/api/theme-edit/theme-state-part-states-changed.test.mjs: clear
  • packages/cli/api/theme-edit/theme-table-cells-borders-colored.test.mjs: clear
  • packages/core/src/Field/__tests__/FieldStatusFocusRing.a11y.chromium.spec.ts: non-blocking, DateTimeInput not listed
  • packages/core/src/Field/inputStyles.stylex.ts: non-blocking, comment style

Automated review (maintainer link)

'core-timeinput--status-variant-comparison',
'core-typeahead--status-variant-comparison',
'core-tokenizer--status-variant-comparison',
'core-powersearch--status-variant-comparison',

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: DateTimeInput composes the same status style and the changeset names the date and time fields, but no DateTimeInput story is listed. It has no status comparison story; core-datetimeinput--with-error-status would cover it.

@josephfarina josephfarina reopened this Nov 18, 2026
@josephfarina
josephfarina merged commit 50275d9 into main Nov 18, 2026
149 of 155 checks passed
@github-actions
github-actions Bot deleted the josephfarina/status-field-focus-ring branch November 19, 2026 06:05

This branch was successfully deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant