Skip to content

[refactor] Move columnDescriptors to DataProvider (and use initial value)#454

Merged
severo merged 4 commits intomasterfrom
simplify
Mar 4, 2026
Merged

[refactor] Move columnDescriptors to DataProvider (and use initial value)#454
severo merged 4 commits intomasterfrom
simplify

Conversation

@severo
Copy link
Copy Markdown
Contributor

@severo severo commented Mar 4, 2026

To reduce the number of rerenders + fix the value to the initial value (we don't have a mechanism to update the columns name, sortable property or number)

see #449

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Refactors column descriptor handling so column descriptors (and derived column count) are owned by DataProvider and treated as “initial, stable” values to reduce re-renders and avoid unsupported runtime updates to column descriptor properties (per #449).

Changes:

  • Add ColumnDescriptorsContext to DataProvider and initialize it from the data frame’s initial columnDescriptors.
  • Update ColumnParametersProvider to read column descriptors from DataContext instead of receiving them as a prop.
  • Update affected tests and HighTable wiring to align with the new context-driven API.

Reviewed changes

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

Show a summary per file
File Description
test/providers/ColumnParametersProvider.test.tsx Wraps ColumnParametersProvider in ColumnDescriptorsContext.Provider for updated dependency.
src/providers/DataProvider.tsx Introduces ColumnDescriptorsContext provider and stores initial column descriptors for stability.
src/providers/ColumnParametersProvider.tsx Switches to useColumnDescriptors() and removes columnDescriptors prop.
src/contexts/DataContext.ts Adds ColumnDescriptorsContext and useColumnDescriptors() hook.
src/components/HighTable/HighTable.tsx Removes passing data.columnDescriptors into ColumnParametersProvider; relies on DataProvider.
src/components/ColumnHeader/ColumnHeader.test.tsx Updates test setup to provide ColumnDescriptorsContext.

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

Comment thread src/contexts/DataContext.ts Outdated
Comment thread src/providers/DataProvider.tsx Outdated
severo and others added 3 commits March 4, 2026 05:21
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@severo severo merged commit 7f996bb into master Mar 4, 2026
5 checks passed
@severo severo deleted the simplify branch March 4, 2026 09:27
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.

2 participants