Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR follows issue #449 by splitting table-corner sizing concerns into dedicated contexts/providers and introducing a Wrapper component to host the portal container context, with the goal of reducing unnecessary re-renders and prop drilling in HighTable.
Changes:
- Added
TableCornerSizeProvider+TableCornerSizeContextto store and expose the top-left “table corner” cell width/height and its setter via context. - Updated
TableCorner,Slice,ColumnWidthsProvider, andScrollProviderto consume table-corner size via context rather than props/state lifted intoHighTable. - Introduced
components/HighTable/Wrapperto own the outer container element +PortalContainerContextprovider.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/providers/ViewportSizeProvider.tsx | Adds clarifying comment about clientWidth/clientHeight usage. |
| src/providers/TableCornerSizeProvider.tsx | New provider that stores table-corner width/height and exposes a setter via contexts. |
| src/providers/ScrollProvider.tsx | Replaces headerHeight prop with useHeaderHeight() from the new context. |
| src/providers/ColumnWidthsProvider.tsx | Replaces tableCornerWidth prop with TableCornerWidthContext consumption. |
| src/contexts/TableCornerSizeContext.ts | New contexts + hooks for table-corner width/height and setter. |
| src/components/TableCorner/TableCorner.tsx | Switches to useSetTableCornerSize() and passes the element to the setter. |
| src/components/HighTable/Wrapper.tsx | New outer wrapper that sets CSS vars and provides PortalContainerContext. |
| src/components/HighTable/Slice.tsx | Removes setTableCornerSize prop drilling into TableCorner. |
| src/components/HighTable/HighTable.tsx | Wires in TableCornerSizeProvider + Wrapper and removes local corner-size state. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
see #449
Create a new Wrapper component for the outermost div element. Note that it provides the PortalContainerContext (a reference to it used for the portals).
Move the table corner (top left cell) size to a provider.
This avoids rerenders if that cell is resized, separates concerns, and removes the need to drill props.