Repository navigation
feat(table): add spreadsheet selection aggregates in CsvTable toolbar - #230
Merged
Merged
Conversation
Compute live cell, distinct, empty, and numeric (Sum, Avg, Min, Max) aggregates across multi-cell rectangular ranges, selected rows, and selected columns in CsvTable, and surface them in the selection toolbar strip alongside Copy as CSV. Co-authored-by: David Boskovic <david@obvious.ai>
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.
Why
Selecting rows, columns, or rectangular cell ranges in the CSV grid previously offered no way to inspect counts, distinct values, blank cells, or numeric totals without copying the selection into an external spreadsheet. Furthermore, selecting a multi-cell rectangular range with the mouse or keyboard did not surface the selection toolbar strip or its
Copy as CSVbutton unless a full row or column header was clicked.What
app/src/lib/tableSelection.ts): AddedSelectionStatsandcomputeSelectionStats(table, view, selection, gutterColumns), collecting unique(viewRow, dataCol)coordinates across rectangularranges(skipping gutter columns< gutterColumns), selectedrows, and selectedcolumns(capped at100,000cells so huge tables stay instantaneous). Returnsnullwhen nothing is selected or when only a single cell (cellCount < 2) is focused without a row or column selection.CsvTable.tsx: Extended the selection toolbar strip to activate wheneverselectedInView.length > 0 || selectedColumnCount > 0 || selectionStats !== null, enablingCopy as CSVfor multi-cell rectangular ranges and renderingdata-testid="{testId}-selection-stats"withCells · Distinct, conditionalEmpty, andIntl.NumberFormat("en-US", { maximumFractionDigits: 4 })-formattedSum · Avg · Min · Maxwhen numeric cells are present.#18(2026-10-20, tag"new"), unit tests inapp/src/lib/tableSelection.test.ts, and component tests inapp/src/components/CsvTable.test.tsx. Rebuiltapp/dist.How to Review
app/src/lib/tableSelection.ts&app/src/lib/tableSelection.test.ts— coordinate deduplication across ranges/rows/columns, gutter exclusion, 100k-cell cap, and numeric parsing (/^[-+]?(?:\d+\.?\d*|\.\d+)(?:[eE][-+]?\d+)?$/).app/src/components/CsvTable.tsx&app/src/components/CsvTable.test.tsx— memoizedselectionStats, toolbar visibility for multi-cell ranges, and formatted live readout pill.Test Evidence
AC-17: Spreadsheet selection aggregates (Cells · Distinct · Empty · Sum · Avg · Min · Max) in CsvTable toolbar


AC-17: Spreadsheet selection aggregates (Cells · Distinct · Empty · Sum · Avg · Min · Max) in CsvTable toolbar — recording
cd app && npm run lint && npx tsc -b --noEmit && npm test && npm run build(34 test files, 568 tests passing)bash .github/scripts/verify-seo.sh(passed, 45,103 bytes of prerendered HTML)agent-browserat1440×900) and uploaded QA evidence (tc-17).Human author: David Boskovic (david@obvious.ai)
🔗 Obvious Project · 🧵 Obvious Thread · 🔀 Obvious PR Artifact