Repository navigation
feat(TreeList): let a tree item carry row styles - #6238
Merged
Merged
Conversation
TreeList takes rows as data, so nothing handed back the row's element. That blocks StyleX markers specifically: a marker's class is the only way to scope when.ancestor() to one row, so revealing an endContent action on its own row's hover had nothing to mark and had to mark the whole tree, which reveals every row's action at once. Item already accepts className for this, so the gap surfaced as a regression when converting a list to a tree. The class lands on the row box rather than the <li> — the boundary a consumer means by 'this row' — and merges last so it wins ties. Co-authored-by: Cursor <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
ernestt
requested review from
imdreamrunner and
josephfarina
as code owners
September 11, 2026 01:19
Contributor
|
AI review status for this pull request.
|
Contributor
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR No new or modified components detected. Bundle Size Summary
Accessibility AuditStatus: 36 accessibility violation(s) found — 2 critical, 34 serious. Button pattern - 1 issue(s)
ChatComposer - 1 issue(s)
ChatComposerInput - 1 issue(s)
ChatReasoning - 1 issue(s)
ChatToolCalls - 1 issue(s)
Checkbox pattern - 1 issue(s)
CheckboxList - 1 issue(s)
ClickableCard - 1 issue(s)
CodeEditor - 1 issue(s)
CodeEditorPerf - 1 issue(s)
CodeEditorTheme - 1 issue(s)
CodeTheme - 1 issue(s)
DateRangeInput - 1 issue(s)
FileInput - 1 issue(s)
GridMasonry - 1 issue(s)
Heading - 1 issue(s)
Icon - 1 issue(s)
LogStream - 1 issue(s)
MediaTheme Auto - 1 issue(s)
PowerSearch - 1 issue(s)
ProgressBar - 1 issue(s)
Radio group pattern - 1 issue(s)
RadioList - 1 issue(s)
RichTextEditor - 2 issue(s)
SelectableCard - 1 issue(s)
Stepper - 1 issue(s)
TableGroupedRows - 1 issue(s)
TableTree - 1 issue(s)
Text - 1 issue(s)
Theme - 1 issue(s)
PopArt - 1 issue(s)
Thumbnail - 1 issue(s)
Timestamp - 1 issue(s)
Token - 1 issue(s)
Tokenizer - 1 issue(s)
Visual RegressionStatus: No visual change across 2 compared shot(s). Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
TreeListItemData accepts xstyle, style, and className; all three compose on the Item row box in the precedence the TreeList contract records (component styles, then xstyle, then className, then inline style, merged after the private indent custom property). Completes FR5 of the TreeList component contract, which requires all three mechanisms on the same row rather than className alone.
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
TreeListItemDatagainsxstyle,className, andstyle, all applied to the item's row element.TreeListtakes its rows as data, so nothing previously handed back the row's element. That blocks row-scoped primitives:useContainerRevealpublishes its container state as a class and inline custom properties, so a consumer wanting an action inendContentto reveal on that row's hover had nothing to attach either half to. The only thing available was the tree, and marking the tree reveals every row's action at once.Itemalready accepts the same three styling inputs, which is how the gap surfaced — as a regression when converting a list to a tree.Current specification
Implements FR5 and FR6 of the now-current TreeList component contract (
packages/core/src/TreeList/TreeList.spec.md, approved 2026-09-20 in #6406), which records the per-item styling seam as one concept and requires all three mechanisms on the same row:An earlier revision of this PR carried
classNamealone. The contract's review checks reject that shape, so this now ships the complete seam.Shape
Three details, all load-bearing:
<li>. That is the boundary a consumer means by "this row" — the element the hover is actually on, and the one anendContentaction is a descendant of. FR6 pins it there.xstyle, thenclassName, then inlinestyle. All three combine; none suppresses another.--_tree-indent, so a consumer's custom properties land without the indent being dropped.Test plan
TreeListtests pass, including a new one asserting all three inputs compose on the row box and that--_tree-indentsurvives a suppliedstyle.pnpm exec tsc -p packages/core/tsconfig.json --noEmit— clean.pnpm check:knowledgeandpnpm check:repo— clean.eslinton the changed files — no new findings (5 pre-existingno-nullish-jsx-guardwarnings unchanged).useContainerRevealthrough this seam, and hovering one row reveals one action.