Skip to content

[refactor] provide numColumns from the DataProvider#453

Merged
severo merged 6 commits intomasterfrom
simplify
Mar 3, 2026
Merged

[refactor] provide numColumns from the DataProvider#453
severo merged 6 commits intomasterfrom
simplify

Conversation

@severo
Copy link
Copy Markdown
Contributor

@severo severo commented Mar 3, 2026

see #449

@severo severo changed the title [refactor] provuder numColumns from the DataProvider [refactor] provide numColumns from the DataProvider Mar 3, 2026
@severo severo requested a review from Copilot March 3, 2026 20:53
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 internal table state so numColumns is sourced from DataProvider via context (per #449), instead of being passed down as a prop, reducing prop threading and helping minimize re-renders.

Changes:

  • Add NumColumnsContext / useNumColumns() to DataContext, and provide the initial column count from DataProvider.
  • Update ColumnWidthsProvider to consume numColumns from context; update HighTable to stop passing numColumns.
  • Update tests to validate numColumns provisioning and adapt ColumnHeader tests to the new context dependency.

Reviewed changes

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

Show a summary per file
File Description
test/providers/DataProvider.test.tsx Extends provider tests to assert numColumns behavior (including immutability expectation).
src/providers/DataProvider.tsx Provides numColumns via a new context, keeping the initial value stable per data instance.
src/providers/ColumnWidthsProvider.tsx Removes numColumns prop; reads numColumns from DataContext.
src/contexts/DataContext.ts Introduces NumColumnsContext and useNumColumns().
src/components/HighTable/HighTable.tsx Stops passing numColumns into ColumnWidthsProvider.
src/components/ColumnHeader/ColumnHeader.test.tsx Wraps tests with NumColumnsContext.Provider to satisfy new dependency.

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

Comment thread src/components/ColumnHeader/ColumnHeader.test.tsx Outdated
Comment thread src/components/ColumnHeader/ColumnHeader.test.tsx
Comment thread src/contexts/DataContext.ts Outdated
Comment thread src/providers/DataProvider.tsx
@severo severo merged commit b906d32 into master Mar 3, 2026
5 checks passed
@severo severo deleted the simplify branch March 3, 2026 21:26
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