[refactor] simplify where possible and add doc#411
Merged
Conversation
…ls hook instead of the empty RowsAndColumnsProvider
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the table component architecture to simplify the provider hierarchy and improve code organization, while also adding comprehensive documentation and test coverage for selection functionality.
Changes:
- Removed
RowsAndColumnsProviderandRowsAndColumnsContext, converting the data fetching logic to auseFetchCellshook - Moved
visibleColumnsParameterscomputation toColumnVisibilityStatesProviderfor better data locality and performance - Added comprehensive documentation comments for types, interfaces, and functions across multiple files
- Added extensive test coverage for selection functionality (controlled, uncontrolled, and disabled states)
Reviewed changes
Copilot reviewed 13 out of 15 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/types.ts | Enhanced documentation for columnConfiguration and onError props |
| src/providers/OrderByProvider.tsx | Added useMemo optimization for context value and inline type import |
| src/providers/ColumnVisibilityStatesProvider.tsx | Added visibleColumnsParameters computation and export |
| src/providers/ColumnParametersProvider.tsx | Updated Props type to use Pick<DataFrame> and improved documentation |
| src/providers/CellNavigationProvider.tsx | Added TODO comment about refactoring focus state |
| src/hooks/useFetchCells.ts | Converted from RowsAndColumnsProvider to a hook for cleaner architecture |
| src/helpers/dataframe/types.ts | Added documentation for ColumnDescriptor interface |
| src/helpers/columnConfiguration.ts | Added comprehensive documentation for all types and changed import style |
| src/contexts/RowsAndColumnsContext.ts | Removed - no longer needed |
| src/contexts/ColumnVisibilityStatesContext.ts | Added visibleColumnsParameters to context type |
| src/contexts/ColumnParametersContext.ts | Enhanced documentation |
| src/components/HighTable/Slice.tsx | Integrated useFetchCells hook and optimized className lookup |
| src/components/HighTable/HighTable.tsx | Removed RowsAndColumnsProvider and simplified component hierarchy |
| src/components/HighTable/HighTable.selection.uncontrolled.test.tsx | New comprehensive test suite for uncontrolled selection |
| src/components/HighTable/HighTable.selection.controlled.test.tsx | New comprehensive test suite for controlled selection |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This reverts commit 413f215.
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.
No description provided.