Skip to content

fix(Table): rebuild collection when children change (DS-5260)#425

Merged
KamilEmeleev merged 2 commits into
mainfrom
fix/ds-5260
Jul 17, 2026
Merged

fix(Table): rebuild collection when children change (DS-5260)#425
KamilEmeleev merged 2 commits into
mainfrom
fix/ds-5260

Conversation

@KamilEmeleev

Copy link
Copy Markdown
Collaborator

No description provided.

@KamilEmeleev KamilEmeleev added the bug Something isn't working label Jul 16, 2026
@github-actions

github-actions Bot commented Jul 16, 2026

Copy link
Copy Markdown

Visit the preview URL for this PR (updated for commit b03f9d5):

https://react-koobiq-next--prs-425-nltai7gg.web.app

(expires Tue, 21 Jul 2026 12:24:20 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: fc29847d4a9e5cb1adf458c76a9b681c76e2eeff

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses a Table rendering bug by forcing the React Aria/Stately table collection to be rebuilt when children change, so dynamic row/column props (e.g., conditional className) are re-evaluated while preserving table state like selection, sorting, and column resizing.

Changes:

  • Rebuild the Table collection on children changes and pass the resulting collection into useTableState.
  • Re-export CollectionBuilder from primitives as LegacyCollectionBuilder to support the collection rebuild logic.
  • Add regression tests to validate invalidation and preservation of selection/sorting/resizing across collection rebuilds.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
packages/primitives/src/index.ts Re-exports CollectionBuilder as LegacyCollectionBuilder for internal Table usage.
packages/components/src/components/Table/Table.tsx Introduces a legacy-collection rebuild hook and injects collection into useTableState.
packages/components/src/components/Table/Table.test.tsx Adds tests for dynamic row/column invalidation and state preservation across rebuilds.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/components/src/components/Table/Table.tsx
Comment thread packages/components/src/components/Table/Table.test.tsx
@KamilEmeleev
KamilEmeleev merged commit 9fa6eac into main Jul 17, 2026
6 checks passed
@KamilEmeleev
KamilEmeleev deleted the fix/ds-5260 branch July 17, 2026 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants