Skip to content

feat(TreeList): add variant prop (lineGuides | noGuides) - #4334

Merged
cixzhang merged 2 commits into
mainfrom
feat/treelist-variant
Jul 27, 2026
Merged

cixzhang merged 2 commits into
mainfrom
feat/treelist-variant

Conversation

@cixzhang

Copy link
Copy Markdown
Contributor

Adds a variant prop to TreeList for selecting the base hierarchy guide-line look. Resolves #4333 (API reviewed/approved).

API

  • variant?: TreeListVariant on TreeListProps, @default 'lineGuides'.
  • Extensible-map pattern (mirrors AppShellVariant):
    export interface TreeListVariantMap { lineGuides: true; noGuides: true; }
    export type TreeListVariant = keyof TreeListVariantMap;
    Theme packages can add variants via module augmentation of TreeListVariantMap.
  • 'lineGuides' (default) — the connector guide lines as they render today.
  • 'noGuides' — hides the connector lines; indentation is preserved (indent-only nesting).

Orthogonal to density — variant controls only guide-line visibility, density owns spacing; the two compose. The guides stay themeable via the existing astryx-tree-list-guide target regardless of variant.

Why / What / Risk / Testing

  • Why: consumers want the tree's nesting affordance without the connector lines in layouts that already convey hierarchy, without dropping to a theme override.
  • What: thread variant from TreeList down to TreeListItem (same direct-prop mechanism as density); for noGuides, the connector element (TreeListBranches) is simply not rendered. Indentation is unaffected because it lives on the row's marginLeft, not on the guide element.
  • Risk: non-breaking. Omitting the prop (or passing 'lineGuides') is pixel-identical to current output — the guide render path is untouched.
  • Testing: unit tests cover default-renders-guides, noGuides renders no .astryx-tree-list-guide element while preserving rows/roles/structure and per-level indentation, and lineGuides == default. Storybook gains Variants (side-by-side) and NoGuides stories. Green: pnpm build, @astryxdesign/core + @astryxdesign/storybook typecheck, pnpm vitest run TreeList themingTargets (339 passed, themingTargets guard green — no new target needed), lint clean.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jul 25, 2026
@vercel

vercel Bot commented Jul 25, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
astryx Ready Ready Preview, Comment Jul 26, 2026 4:04am

Request Review

@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review label Jul 25, 2026
github-actions Bot added a commit that referenced this pull request Jul 25, 2026
@github-actions

github-actions Bot commented Jul 25, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

🧪 Sandbox Preview

View Sandbox for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

Modified Components

TreeList · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 756 -
Complexity N/A Very High (78) -

Bundle Size Summary

Package Size (ESM) Size (CJS) Gzipped
@astryxdesign/core N/A 4.7KB 0B

Accessibility Audit

Status: No accessibility violations detected.


Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

github-actions Bot added a commit that referenced this pull request Jul 26, 2026
@cixzhang
cixzhang marked this pull request as ready for review July 26, 2026 04:15
@cixzhang
cixzhang merged commit ad5a438 into main Jul 27, 2026
22 checks passed
@github-actions
github-actions Bot deleted the feat/treelist-variant branch July 28, 2026 06:57
AKnassa added a commit to AKnassa/astryx that referenced this pull request Aug 27, 2026
Conflicts: TreeList.tsx, TreeListItem.tsx, TreeListTypes.ts, index.ts —
resolved as a union of main's TreeListVariant / Icon-rendered chevron /
flush-leaf column logic (meta#4838, meta#4540, meta#4530, meta#4334) and this branch's
renderExpandIcon. A leaf that renders its own indicator no longer reserves
the chevron column. The four alignment tests now read the published
--_tree-indent custom property instead of the removed inline marginLeft.

This branch was successfully deployed

1 active deployment
Preview — 34a57463 Deployed Jul 26, 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.

TreeList: add a themeable variant visual axis (lineGuides / noGuides)

1 participant