fix(dashboard): fit the whole Member × Month grid on screen - #48
Conversation
The 12-month pivot rendered ~1400px wide, so the late months sat off the right edge behind a horizontal scroll most readers never found. Three changes buy that width back: - The member column is fixed at 9.5rem and ellipsises (full name on hover). It was the main hog: `whitespace-nowrap` over a `minWidth` let the longest roster names take ~245px. - Month cells drop the ₹ prefix — `gridAmount()` keeps the same en-IN lakh grouping `formatRupees` produces, and the unit is stated once in the toolbar, spreadsheet-style. - A new opt-in `.pr-table-dense` class halves cell padding and drops a notch of type size; column min-widths shrink to match. Gridlines + zebra striping (new pass-through props on PrDataTable) keep a cell traceable to its member and month across 12 narrow columns. Exports are untouched — still ₹-labelled headers and raw numbers. Horizontal scroll remains as the phone fallback. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Two mobile follow-ups on the Member × Month grid. `scrollable` disables PrimeReact's card-stacking (datatable.cjs.js:7126 gates the stack stylesheet on `!props.scrollable`), so on a phone this stays a grid that scrolls sideways — and past ~Mar the row label left the screen, leaving unlabelled numbers. The `#` and Member columns are now `frozen`; PrimeReact computes each one's left offset from the preceding frozen siblings, so the pair pins as a unit. The freeze seam lives on the last frozen cell's own right edge, not the first scrolling cell's left edge — the sticky columns paint over the scrolled content, so a border on the far side would slide under them and disappear. Width only; the theme's `border: 1px solid` already set the color on all four sides before narrowing the widths. The "Amounts in ₹" note moves from the toolbar (where it was `hidden sm:inline`, so phones — having also lost the per-cell ₹ — were left with no unit stated anywhere) to an always-visible caption under the table, with a sideways-scroll hint below `sm`. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Two mobile follow-ups pushed (edd9978). Frozen label columns. The freeze seam sits on the last frozen cell's own right edge, not the first scrolling cell's left edge — the sticky columns paint over the scrolled content, so a border on the far side would slide underneath and vanish. Width only; the theme sets ₹ caption. The note was Backgrounds check out for the sticky cells:
|
Problem
The Member × Month tab on
/dashboardrenders a 12-month pivot that measured ~1400px wide against ~1120–1216px of content area (max-w-7xlminuslg:px-8). The late months sat off the right edge behind a horizontal scrollbar most readers never found.Fix
Three changes buy the width back, so the grid lands at ~1076px and fits without scrolling:
title). This was the main hog —whitespace-nowrapover a bareminWidthlet names like "Rallabandi Venkata Narasimha Charlu" take ~245px.gridAmount()helper prints the same en-IN lakh groupingformatRupeesproduces, minus the symbol; the unit is stated once ("Amounts in ₹") beside the export menu, spreadsheet-style..pr-table-denseclass halves horizontal cell padding (0.75rem → 0.4rem) and drops body type to 0.75rem / headers to 0.625rem. Column min-widths shrink to match (#3→2.25rem, months 5.5→3.5rem, Total 6.5→4.5rem) — columns still auto-expand to content, so nothing wraps or clips.Gridlines + zebra striping (new
gridlines/stripedpass-through props onPrDataTable→ PrimeReact'sshowGridlines/stripedRows) keep a cell traceable back to both its member and its month across 12 narrow columns. The dense class also cancels the gridlines theme's outer left/right frame, which would otherwise double up against the rounded card border.Horizontal scroll stays enabled as the fallback on phones. CSV/PDF exports are untouched — still ₹-labelled headers and raw numeric values.
Verification
npm run build— passesnpm run lint— passes (one pre-existing warning inpending-interest-panel.tsx)npm test— 338 passingNot viewed in a browser (the dashboard is behind Google OAuth), so the fit is from measurement rather than a screenshot — worth an eyeball on a real screen before merge.
🤖 Generated with Claude Code