Repository navigation
feat(treelist): reveal endContent on hover/focus via endContentReveal - #4538
Closed
freddymeta wants to merge 1 commit into
Closed
freddymeta wants to merge 1 commit into
freddymeta wants to merge 1 commit into
Conversation
Add a tree-level `endContentReveal` prop (`'always' | 'hover'`, default `'always'`, non-breaking) so each row's endContent can stay hidden until the row is hovered or focused — useful for secondary row actions like a delete button that would otherwise add visual noise at rest. The reveal mirrors Thumbnail's proven `showRemoveOn="hover"` pattern: - CSS-driven via `stylex.when.ancestor(:hover / :focus-within, marker)`, keyed to each row through a scoped `treeItemScope` marker so a nested tree's rows react to their own hover/focus, never an ancestor row's. - Accessible by construction: opacity-only (never display/visibility), so the content — and any focusable action inside it — stays mounted and in the tab order; tabbing to it triggers the row's :focus-within reveal. The hover branch is guarded by `@media (hover: hover)` and the content stays visible on `any-pointer: coarse` (touch), so the action is never gated behind an unavailable hover. Honors `prefers-reduced-motion`. Includes tests (mounted/focusable contract + class application), the `endContentReveal` prop across all doc variants, a best-practice note, a Hover Actions showcase block, and a changeset.
freddymeta
requested review from
cixzhang,
ejhammond,
imdreamrunner and
josephfarina
as code owners
July 30, 2026 06:44
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
github-actions
Bot
requested review from
cvkxx,
ernestt,
kentonquatman and
rubyycheung
July 30, 2026 06:44
Contributor
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR Modified ComponentsTreeList · View in Storybook
Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
This was referenced Jul 31, 2026
Contributor
Author
|
Closing — no longer necessary. |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a tree-level
endContentRevealprop toTreeList—'always' | 'hover', default'always'(non-breaking).With
endContentReveal="hover", each row'sendContentis hidden at rest and revealed when the row is hovered or focused, and stays visible on touch. This is for secondary row actions (e.g. a delete button) that would otherwise clutter the tree at rest.Is this accessible? Yes — by construction
Hover-to-reveal is only an a11y problem when done naively. This implementation avoids every failure mode:
:focus-within, so tabbing into the row (or into the action itself) shows it. Not pointer-only.display:none/visibility:hidden, which would drop the control from the tab order and a11y tree. The action stays mounted and focusable, so it can receive the focus that triggers its own reveal.@media (any-pointer: coarse), so the action is never gated behind an unavailable hover.@media (hover: hover).prefers-reduced-motion(0s transition).Approach
Mirrors the already-shipped, reviewed
ThumbnailshowRemoveOn="hover"pattern exactly:stylex.when.ancestor(':hover' / ':focus-within', treeItemScope).treeItemScopemarker (stylex.defineMarker()) is applied per row, so a nested tree's rows react to their own hover/focus — not an ancestor row's, and not an outer container's.Changes
endContentRevealprop onTreeList(threaded toTreeListItem); default'always'.treeList.markers.stylex.tsscope marker.TreeListEndContentRevealtype, exported from the package.hover).hovermode + class-application + default behavior.Testing
TreeListsuite: 69 passed (incl. 3 new). Showcase manifest tests: 12 passed.typecheck:docs,typecheck:template-docs,check-sync,sync-exports --check, token-docs--check, changeset check, eslint — all green.opacity:0at rest;opacity:1under:hover *(guarded by@media (hover: hover)),:focus-within *, and@media (any-pointer: coarse).