Conversation
Oh, yes, it makes sense: we want to compute the width on the maximum row number, not necessarily on the number of rows in the dataframe. I'll add this possibility, and fallback to the dataframe number of rows by default. |
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for displaying custom maximum row numbers in the HighTable component, particularly useful for filtered datasets where the visible row count differs from the actual data index range. The implementation shifts from JavaScript-calculated row header widths to CSS-based dynamic width calculations.
Key changes:
- Added
maxRowNumberprop to HighTable and DataProvider to support custom row number display - Refactored row header width calculation from JavaScript to CSS using character-based sizing
- Changed
canMeasureWidthfrom boolean to per-column record in TableHeader for more granular control
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/hooks/useData.tsx | Added maxRowNumber to DataContext with memoized fallback to data.numRows |
| src/components/TableHeader/TableHeader.tsx | Changed canMeasureWidth prop from boolean to canMeasureColumn record for per-column measurement control |
| src/components/TableHeader/TableHeader.test.tsx | Removed canMeasureWidth prop from test cases (now optional) |
| src/components/HighTable/HighTable.tsx | Integrated maxRowNumber prop, replaced JavaScript width calculation with CSS variables, refactored canMeasureWidth logic to per-column basis, removed unused cellStyle import, reordered prop documentation alphabetically |
| src/components/HighTable/HighTable.stories.tsx | Added FilteredData story demonstrating the maxRowNumber feature with custom row numbering |
| src/components/ColumnHeader/ColumnHeader.tsx | Added clarifying comment about using offsetWidth instead of clientWidth |
| src/HighTable.module.css | Replaced fixed --row-label-width with dynamic --row-number-width calculated from character count, updated comment clarity |
| README.md | Updated documentation with new maxRowNumber prop and reordered props alphabetically for consistency |
| .storybook/main.ts | Simplified Storybook configuration to use string format for framework |
| .storybook/global.css | Fixed typo in comment: "HightTable" to "HighTable" |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
bleakley
left a comment
There was a problem hiding this comment.
Yes, this is perfect, thank you 👍



The code is simpler now: we just compute the number of characters of the number of rows, and the first column width is computed in CSS.
It works for different fonts (monospace or not). We use the
chunit which is more adapted to this use case thanem.Screencast.From.2025-11-04.16-20-47.mp4