Repository navigation
fix(treelist): leaf row highlight flush with sibling parents (trial) - #4570
Closed
freddymeta wants to merge 1 commit into
Closed
freddymeta wants to merge 1 commit into
freddymeta wants to merge 1 commit into
Conversation
A leaf row's hover/selected/focus highlight started inset past its sibling parent rows: leaves folded the chevron-column offset (chevron width + gap) into the row's outer margin, so a leaf's whole row box — and its highlight — began one toggle-column further in than a parent at the same level. Move that offset from the row's margin to the content's padding-inline-start. Now every row's box starts at `level * step` (flush to the guide/toggle column for parents and leaves alike), while a leaf re-insets only its content so labels stay aligned with parents. The label x is unchanged (verified: margin+basePad for old == padding for new); only the highlighted row box moves, so leaves and parents now share one highlight start. `padding-inline-start` is a longhand and wins over `contentWrapper`'s `paddingInline` shorthand via StyleX's longhand>shorthand priority (order-independent, no !important). Purely visual; no API change. Adds tests pinning that a leaf and a parent at the same level publish the same row indent and that the chevron-column offset no longer lands in the leaf row box.
freddymeta
requested review from
cixzhang,
ejhammond and
imdreamrunner
as code owners
July 31, 2026 01:41
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
github-actions
Bot
requested review from
cvkxx,
ernestt,
kentonquatman and
rubyycheung
July 31, 2026 01:41
Contributor
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR Modified ComponentsTreeList (@astryxdesign/core) · View in Storybook
Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
Contributor
Author
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
A trial to see how "flush to guide" reads. This makes a leaf row's hover / selected / focus highlight start at the same x as its sibling parent rows (the guide/toggle column) instead of being inset past them by the chevron column. No new prop — it fixes the default.
The inconsistency today
The per-level indent lives on the row's outer
margin-inline-start. Parents uselevel * step, but leaves add the chevron-column offset (spacing-4+spacing-2) into that same margin so their labels line up under sibling parents. Side effect: a leaf's entire row box — and therefore its highlight — begins one toggle-column further in than a parent at the same level. Within a level, leaf highlights look inset relative to parent highlights.The change
Move the leaf's chevron-column offset from the row margin to the content
padding-inline-start:level * step(parents and leaves alike) → highlights are flush to the guide column.Label x is unchanged (verified algebraically: old
margin + basePadsum == newpaddingsum); only the highlighted row box moves.padding-inline-startis a longhand, so it wins overcontentWrapper'spaddingInlineshorthand via StyleX's longhand>shorthand priority — order-independent, no!important.Notes / open question
Testing
TreeListsuite: 68 passed (incl. 2 new — a leaf and a parent at the same level publish the same row indent; the chevron offset no longer lands in the leaf row box).typecheck:docs,check-sync,sync-exports --check, changeset check, eslint — all green.calc(var(--spacing-2) + var(--spacing-4) + var(--spacing-2)); row margin staysvar(--_tree-indent).