Skip to content

feat(tables): add tree support - #1338

Open
tenphi wants to merge 4 commits into
mainfrom
codex/table-tree-support
Open

feat(tables): add tree support#1338
tenphi wants to merge 4 commits into
mainfrom
codex/table-tree-support

Conversation

@tenphi

@tenphi tenphi commented Aug 20, 2026

Copy link
Copy Markdown
Member

Summary

  • add opt-in nested rows to ItemTable and DataTable with controlled and uncontrolled expansion
  • add React Aria treegrid semantics, disclosure controls, roving focus, typeahead, and hierarchy keyboard navigation
  • make client sorting, search, pagination, virtualization, ranges, selection, and row drops hierarchy-aware
  • add cascading ItemTable selection, recursive DataTable sorting, stories, docs, localization, browser coverage, and a minor changeset
  • raise the complete bundle budget from 505 kB to 510 kB; the measured bundle is 508.04 kB and the Button tree-shaking budget is unchanged

Verification

  • pnpm test — 97 files, 2,079 passed, 1 skipped
  • pnpm test:browser — 8 files, 110 passed
  • pnpm audit-docs --component=ItemTable
  • pnpm audit-docs --component=DataTable
  • pnpm audit-defaults
  • pnpm build
  • pnpm size

Note

Medium Risk
Touches the shared table renderer, selection, keyboard focus, and virtualization. Behavior is opt-in via getRowChildren, but bugs here can affect accessibility and selection in both tables.

Overview
Adds opt-in nested rows to ItemTable and DataTable via getRowChildren, with controlled/uncontrolled expansion (expandedKeys / defaultExpandedKeys / onExpand) and a disclosure column (treeColumnKey).

A shared immutable tree model recursively sorts siblings, paginates roots (keeping subtrees together), and flattens only expanded rows for render and virtualization. ItemTable client search keeps ancestor paths and temporarily opens matching branches. Multiple selection cascades by default (treeSelectionBehavior); DataTable cell ranges and row numbers follow visible descendants. Flat reorder is ignored in tree mode; dropOnRow rejects self/descendant cycles.

The native table becomes role="treegrid" with React Aria keyboard/typeahead, virtualized focus handoff, and TreeContent / TreeToggle / TreeValue styling. Bundle budget rises 505→510 kB; Button tree-shaking is unchanged.

Reviewed by Cursor Bugbot for commit 8b84560. Bugbot is set up for automated code reviews on this repo. Configure here.

@changeset-bot

changeset-bot Bot commented Aug 20, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8b84560

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@cube-dev/ui-kit Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Aug 20, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
cube-ui-kit Ready Ready Preview Aug 20, 2026 7:51pm

Request Review

@github-actions

github-actions Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

📦 NPM canary release

Deployed canary version 0.0.0-canary-7475904.

@github-actions

github-actions Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

🧪 Storybook is successfully deployed!

@github-actions

github-actions Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

🏋️ Size limit report

Name Size Passed?
All 496.35 KB (+0.79% 🔺) Yes 🎉
Tree shaking (just a Button) 120.73 KB (0% 🟰) Yes 🎉

Compared against main at 11e8319run 32383738012, 2026-08-20T15:02:21Z.

To see which modules changed, download the size-limit-statoscope-report artifact from this run and open report.html.

Comment thread src/components/data/ItemTable/ItemTable.tsx Outdated
Comment thread src/components/data/TableBase/TableView.tsx
Comment thread src/components/data/TableBase/TableView.tsx Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit a8e5a2b. Configure here.

Comment thread src/components/data/TableBase/TableView.tsx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant