Repository navigation
fix(core): a TreeList row with no action shows its keyboard focus ring - #12153
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
There was a problem hiding this comment.
Requesting changes. The fix works: a plain TreeList row now shows the shared focus ring when it has keyboard focus, and both changed tests fail on main and pass here. One side effect needs a change before this lands.
- A plain row now also draws its ring while keyboard focus is on a control inside its start or end content (for example the Pin button in the TreeList Row Names story), so one focus move shows two rings; key the plain row's ring and lift only on its treeitem's own published focus, through a shared variant in
focusOutline.stylex.ts, and add a test that tabs into an end-content control.
Optional: the rewritten focusLift comment (TreeListItem.tsx:125-127) credits the wrong cause, since the lift's own conditions are what limit it.
Claims and files checked
Review mode: full; reason: no-earlier-review
- Claims
- Changeset: a plain row now shows the focus ring under keyboard focus, where it showed no sign of focus before: verified (Chromium: no outline on
main, a 2 px ring here). - A plain row is already a stop in the tree's arrow-key focus: verified (
TreeListItem.tsx:710, the new test's ArrowDown step). - Plain rows now take the ring styles and the guide lift, while hover and press styles stay on interactive rows: verified (
TreeListItem.tsx:750-759). - Nothing changes at rest: verified (rest frames are pixel-identical).
- The new focus-ring test fails on
main: verified (it fails at its ring-class assertion). - The updated guide-lift test fails on
main: verified. - 1310 tests pass in the TreeList and hooks folders: verified.
- Prettier and ESLint are clean on the changed files: verified.
- No new public API, default or interaction model rides under the fix: verified (the API report lists no rows).
- The template pixel checks and the build replay: not reproduced here; consistent with the rest-frame comparison.
- Changeset: a plain row now shows the focus ring under keyboard focus, where it showed no sign of focus before: verified (Chromium: no outline on
- Files
.changeset/treelist-plain-row-focus.md: clear.packages/core/src/TreeList/TreeList.test.tsx: clear; no case covers a control inside a plain row.packages/core/src/TreeList/TreeListItem.tsx: the blocking finding above, plus the optional comment note.
… control inside it
|
/approve-spec bf28f11 |
There was a problem hiding this comment.
Requesting changes. The fix works: a plain TreeList row now shows the focus ring while its treeitem has keyboard focus, and a control in its end content keeps the only ring. The /approve-spec for this head records the engineering owner's decision to ship the two new published members as public API, so what remains is a description edit.
focusOutlineProps.publishedis public at the package root,./utilsand./utils/focusOutline.stylexbut sits outside this pull request's TreeList scope, so name it on theComponents:scope line.focusOutlineStylesgains a publicpublishedmember that also sits outside the TreeList scope, so name it on theComponents:scope line too.- The checked box "No new public API, visual representation, default, or interaction model is hidden under the bug-fix label" is false while the fix ships those two public members, so reword it to say the shared
publishedvariant is public and list both members. - Please also state the first-load gzip delta on the four reference pages for the growth of the shared focus-outline module; measured here: docs +13 B, form +16 B, menu +2 B, table +11 B.
Claims and files checked
Review mode: incremental; reason: none
- changed rules (0): none
- Claims
- Changeset: a plain row now shows the focus ring under keyboard focus and was already a stop in the arrow-key focus: verified (
TreeListItem.tsx:754-764, the new ring test, Chromium). - On
maina plain row was a roving stop with no ring, and interactive rows alone took the shared ring styles: verified (main's plain branch composes no ring; Chromium reads no outline). - Plain rows now ring through a new shared
publishedvariant: verified (focusOutline.stylex.ts:211-214,TreeListItem.tsx:757). - The variant reads only the treeitem's published focus and has no focus-inside branch, so a control in the row's start or end content rings alone: verified (end-content test; Chromium Pin focus leaves the row without an outline).
publishedFocusLiftlifts the focused plain row above the guides: verified (z-index 2 in Chromium; the updated lift test).- Hover and press styles stay on interactive rows only: verified (
TreeListItem.tsx:730-753). - Nothing changes at rest: verified (the rest frame is pixel-identical to
main). - Every row in the roving focus shows keyboard focus, with no record change: verified (TreeList AR1 and DD3; no record in the diff).
- Smallest restoration (one shared variant, one branch and lift, comments, two new tests, one updated test, a changeset): verified.
- The new ring test and the updated lift test fail on
main: verified. - The end-content test shows no focus-inside ring on the row: verified; on
mainit fails only because the new member is missing there. - In Chromium the focused Budget row draws one 2 px ring,
maindraws none, and Pin focus shows only the button's ring: verified (reached with ArrowDown from Documents, which holds the story's Tab stop). - The story and the shell-nav, canvas-editor and IDE templates are pixel-identical at rest: verified for the story; the templates follow from the row's unchanged rest values and were not captured.
- A build replay moves no start, alternative or block list: not reproduced; this review does not rely on it.
- One defect is restored; separable tag-alongs were removed or split; public text holds no internal context: verified.
- No new public API is hidden under the bug-fix label: false (
focusOutlineProps.published,focusOutlineStyles.published). - The TreeList and hooks tests pass and the three changed tests fail on
main: verified (1311 tests pass). - Prettier and ESLint are clean on the changed files: verified.
- Changeset: a plain row now shows the focus ring under keyboard focus and was already a stop in the arrow-key focus: verified (
- Files
.changeset/treelist-plain-row-focus.md: clear.packages/core/src/TreeList/TreeList.test.tsx: clear.packages/core/src/TreeList/TreeListItem.tsx: clear.packages/core/src/utils/focusOutline.stylex.ts: the two scope findings above.
…lic focus-outline API
|
/approve-spec 8b06d89 |
…yles, with no new module
|
/approve-spec b83a20e |
There was a problem hiding this comment.
Requesting changes. The fix works and is now self-contained: a plain TreeList row shows the focus ring while its treeitem has keyboard focus, a control in its end content keeps the only ring, and no public API or new module is added. One description edit remains.
- The Testing line says the three changed tests fail on main, but "does not ring a plain row when focus is on a control in its end content" passes on main (only the ring test and the lift test fail there), so say which two fail and that the end-content test guards against a focus-inside ring.
Optional: three new comments run past the repository's comment style (two 30-word sentences in TreeListItem.tsx, and the new exception in focusOutline.stylex.ts gives no reason and breaks the wrap); suggested rewrites are inline.
Claims and files checked
Review mode: incremental; reason: none
- changed rules (0): none
- Claims
- Title and changeset: a TreeList row with no action (no
onClick,hrefor children) now shows the focus ring under keyboard focus, and was already an arrow-key stop: verified (TreeListItem.tsx:760-771, the new ring test, Chromium). - On
maina plain row was a roving stop with no ring, and only interactive rows took the shared ring styles: verified (main's plain branch composes no ring; Chromium reads no outline). - Plain rows ring through a style in
TreeListItem's own styles: verified (TreeListItem.tsx:137-140,:764). - That style reads only the variables the treeitem publishes with
publishFocusVisibleVars: verified (TreeListItem.tsx:724,:138-139). - No new module and no new export, the public focus-outline API is unchanged, and the shared module gains only a comment: verified (the API generator lists no row;
focusOutline.stylex.ts:12-13is comment only). - With no focus-inside branch, a control in the row's start or end content rings alone: verified (the end-content test; the Chromium Pin frame is pixel-identical to
main). publishedFocusLiftlifts the focused plain row above the guides: verified (TreeListItem.tsx:141-143,:766; the lift test; z-index 2 in Chromium).- Hover and press styles stay on interactive rows only: verified (
TreeListItem.tsx:736-759). - Nothing changes at rest: verified (the rest frame is pixel-identical to
main). - Every roving stop shows keyboard focus, with no record change: verified (the tree's roving-focus and guide-order rules; no record in the diff).
- Smallest restoration (one ring style and lift, one branch, comments, two new tests, one updated test, a changeset): verified.
- The new ring test and the updated lift test fail on
main: verified. - The end-content test tabs to the row, then to its Pin button, and finds no focus-inside ring on the row: verified.
- In Chromium the focused Budget row draws one 2 px ring and
mainnone, and the next Tab to Pin shows only the button's ring: verified (Budget is reached with ArrowDown from Documents, which holds the story's Tab stop). - The shell-nav, canvas-editor and IDE templates are pixel-identical at rest: follows from the row's unchanged rest values; not captured.
- A build replay against
mainmoves no start, alternative or block list: not reproduced; this review does not rely on it. - The four reference pages grow by +0 and the shared focus-outline module does not grow: verified (+0 on each page).
- A page with TreeList and Text grows by +151 B minified, +45 B gzip: verified (+151 / +45).
- One defect is restored, tag-alongs are removed, no new public API, visual representation, default or interaction model is hidden, and public text holds no internal context: verified.
- The TreeList and hooks tests pass: verified (1311 pass). The three changed tests fail on
main: false (two fail; the end-content test passes). - Core typecheck, Prettier and ESLint are clean on the changed files: verified.
- Title and changeset: a TreeList row with no action (no
- Files
.changeset/treelist-plain-row-focus.md: clear.packages/core/src/TreeList/TreeList.test.tsx: clear; the false claim is in the description.packages/core/src/TreeList/TreeListItem.tsx: two optional comment rewrites.packages/core/src/utils/focusOutline.stylex.ts: one optional comment rewrite.
4be7108 to
e184941
Compare
|
/approve-spec e184941 |
There was a problem hiding this comment.
Approved pending CI. A TreeList row with no action (no onClick, href or children) now shows the shared focus ring while its treeitem has keyboard focus and rises above the guides, a control in its start or end content keeps the only ring, and no public API is added. The description's testing claims now match the tests: the ring and lift tests fail on main, and the end-content test passes there as a guard.
CI has not run on this head yet: its admission step found no room, so build, test and typecheck were cancelled. Re-run the CI workflow so the required checks finish before merge.
Claims and files checked
Review mode: incremental; reason: none
- changed rules (0): none
- Claims
- Title and changeset: a TreeList row with no action now shows the focus ring under keyboard focus, and was already an arrow-key stop: verified (
TreeListItem.tsx:759-769, the new ring test, Chromium). - On
mainsuch a row showed no ring, selected or not: verified (main's plain branch composes no ring; the ring test's selected plain row fails there; the Chromium frame matches the rest frame). - Interactive rows took the shared ring styles and plain rows the bare style list: verified (
main'sTreeListItem.tsx:736-751). - Plain rows ring through
plainRowFocusRingin TreeListItem's own styles: verified (TreeListItem.tsx:136-139,:762). - That style reads only the variables the treeitem publishes with
publishFocusVisibleVars: verified (TreeListItem.tsx:723,:137-138). - No new module or export, the public focus-outline API is unchanged, and the shared module gains only a comment: verified (the API generator lists no row;
focusOutline.stylex.ts:12-18is comment only). - With no focus-inside branch, a control in the row's start or end content rings alone: verified (the end-content test; in Chromium the row stays unringed while Pin has focus).
publishedFocusLiftlifts the focused plain row above the guides: verified (TreeListItem.tsx:140-142,:764; the lift test; z-index 2 in Chromium).- Hover and press styles stay on interactive rows only: verified (
TreeListItem.tsx:735-737,:744-758). - Nothing changes at rest: verified (the rest frames are pixel-identical).
- Every roving stop shows keyboard focus, with no record change: verified (the tree's roving-focus and guide-order rules; no record in the diff).
- Smallest restoration (one ring style and lift, one branch, comments, two new tests, one updated test, a changeset): verified.
- The ring test and the lift test fail on
main; the end-content test passes there and guards the fix: verified (2 failed, 122 passed onmainwith the new tests). - In Chromium the focused Budget row draws one 2 px ring and
mainnone, and the next Tab to Pin shows only the button's ring: verified (Budget is reached with ArrowDown from Documents, which holds the story's Tab stop). - The shell-nav, canvas-editor and IDE templates are pixel-identical at rest: not captured; follows from the row's unchanged rest values.
- A build replay against
mainmoves no start, alternative or block list: not reproduced; not relied on. - The four reference pages grow by +0 and a TreeList and Text page by +151 B minified, +45 B gzip: not re-measured; the shipped code is unchanged since the last measurement apart from comments, which minification drops.
- One defect is restored, tag-alongs are removed, no new public API, default or interaction model is hidden, and public text holds no internal context: verified.
- The TreeList and hooks tests pass: verified (1311 pass).
- Core typecheck, Prettier and ESLint are clean on the changed files: verified.
- Title and changeset: a TreeList row with no action now shows the focus ring under keyboard focus, and was already an arrow-key stop: verified (
- Files
.changeset/treelist-plain-row-focus.md: clear.packages/core/src/TreeList/TreeList.test.tsx: clear.packages/core/src/TreeList/TreeListItem.tsx: clear.packages/core/src/utils/focusOutline.stylex.ts: clear.
User impact
A TreeList row with no action, no
onClick,hrefor children, is still a stop in the tree's arrow-key focus, but it showed no focus ring. In a file tree built from such rows, a keyboard user moving with the arrow keys could not see which row was focused, selected or not.Problem and solution fit
TreeListItem gave interactive rows the shared ring styles and plain rows the bare style list. Plain rows now draw the ring too, through a style in TreeListItem's own styles (
plainRowFocusRing). It reads only the focus variables the row's treeitem already publishes with the sharedpublishFocusVisibleVars. No new module and no new export: the public focus-outline API is unchanged, and the shared module gains only a comment naming this exception. It reads only the focus variables the row's own treeitem publishes and has no focus-inside branch, so a control in the row's start or end content still rings alone. A matchingpublishedFocusLiftlifts the focused plain row above the guides. The hover and press styles stay on interactive rows only. At rest nothing changes.Expected behavior and authority
Every row in the roving focus shows keyboard focus (
component:TreeListAR1 roving focus; DD3: a row whose focus ring is showing paints above the guides). No record change: the record never said plain rows go without a ring.Smallest restoration
One ring style and lift in TreeListItem's own styles, one style branch, comments, two new tests, one updated test, and a changeset.
Evidence
Size
First-load JavaScript, base against head (
scripts/measure-reference-pages.mjs):Scope
Components: TreeList (no public API and no new module added)
Testing
vitest run packages/core/src/TreeList packages/core/src/hooks: pass. The ring test and the lift test fail on main; the end-content test passes on main too, and guards against a focus-inside ring on a plain row.tsc --noEmitfor core: clean.