Repository navigation
Add row-number column to tables - #420
Open
Krish-Parmar22 wants to merge 1 commit into
Open
Krish-Parmar22 wants to merge 1 commit into
Krish-Parmar22 wants to merge 1 commit into
Conversation
|
@Krish-Parmar22 is attempting to deploy a commit to the avgupta456's projects Team on Vercel. A member of the Team first needs to authorize it. |
Table.tsx gains a showRowNumbers prop that renders a leading '#' column. The number is taken from the sorted, filtered row model and offset by the current page, so it follows any sort and continues across pages (11-20 on page 2). It is rendered outside the column map, so column dividers and the CSV export are unaffected. InsightsTable.tsx exposes a toolbar icon to toggle the column (on by default; defaultShowRowNumbers prop to change it). filteredData is memoized so toggling display-only state does not hand TanStack a new data array, which would reset pagination to page 1. Closes avgupta456#265, closes avgupta456#379, closes avgupta456#319
Krish-Parmar22
force-pushed
the
table-row-numbers
branch
from
September 15, 2026 20:03
dfc49e4 to
cc1ac27
Compare
This branch has not been deployed
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.
Closes #265, closes #379, closes #319
All three issues ask for the same thing: a row number that reflects the current sort and filter, and continues across pages. Today, sorting the Teams table by e.g. Energized RP leaves "EPA Rank" showing total-EPA ranks (28, 16, 25, 10…), so there's no way to read off "this team is 3rd in Energized RP", and page 4 gives no hint whether you're looking at row 31 or 40.
Changes
frontend/src/components/Table/Table.tsx— newshowRowNumbersprop renders a leading#column. The number ispageIndex * pageSize + i + 1over TanStack's sorted+filtered row model, so it follows whatever sort is active and reads 11–20 on page 2. It is rendered outside the column map, so the existing column-divider logic (which indexes columns by position) and the CSV export are unaffected. The header cell spans all header rows for tables with grouped headers (BreakdownTable).frontend/src/components/Table/InsightsTable.tsx— a list-numbered icon in the toolbar toggles the column, on by default (defaultShowRowNumbersprop to change it per table).filteredDatais nowuseMemo'd on[currData, search, searchCols]; without that, toggling the column handed TanStack a newdataarray every render and reset pagination to page 1.Verified
next lint,tsc --noEmit,next buildpass. Checked in the browser against prod bucket data:#reads 1–10 while EPA Rank shows 28, 16, 25, 10…#reads 11–20, footer "11 – 20 of 3724".