Skip to content

feat(table): add column visibility picker and opt-in Apply view to output - #233

Merged
obvious-autobuild-staging[bot] merged 3 commits into
masterfrom
feat/view-driven-output
Oct 20, 2026
Merged

obvious-autobuild-staging[bot] merged 3 commits into
masterfrom
feat/view-driven-output

Conversation

@obvious-autobuild-staging

Copy link
Copy Markdown
Contributor

Why

Searching or sorting a CSV table in CSVJSON currently acts only as a visual inspection lens — the converted output (JSON / JSONL / SQL / TS) and Copy / Download actions still emit the full, unsorted source table, and users have no way to hide columns without deleting them from their raw input. Power users preparing a filtered or column-subsetted export shouldn't have to destructively mutate their source CSV just to copy or download a slice.

What

Implements AC-11 and Locked Decision D10 from Blueprint art_MJHTha6X:

  • projectCsvView (app/src/lib/tableView.ts): Pure helper that serializes the active visibleColIndices header subset and viewRowIndices row subset via serializeCsvRow joined by \n using table.delimiter, preserving RFC 4180 quoting and custom delimiters (\t, ;, |).
  • Columns visibility popover (app/src/components/CsvTable.tsx):
    • Adds data-testid="{testId}-columns-button" in the table toolbar opening a dialog popover (data-testid="{testId}-columns-popout") with per-column checkboxes (data-testid="{testId}-column-toggle-{colIndex}", enforcing ≥1 visible column) and a contextual Show all reset button (data-testid="{testId}-columns-reset").
    • Maps DataEditorCore visible columns through visibleColIndices and translates grid column indices back to source colIndex across sorting, inline cell editing, rectangular paste/fill, double-click header rename, column deletion, per-column type override badges, selection aggregates, and selection copy (serializeGridSelection).
  • Contextual Apply view to output toggle (CsvTable.tsx → InputPane.tsx / OutputPane.tsx → App.tsx):
    • Appears in the table toolbar (data-testid="{testId}-apply-view", aria-pressed) only when a search filter (query !== ""), sort (sort !== null), or column subset (visibleColIndices.length < table.headers.length) is active.
    • Off by default so table search/sort/column-picking remain non-destructive view lenses unless opted in.
    • In CSV → JSON mode, toggling Apply view to output on feeds projectedInputCsv into convertText so the output pane (JSON / JSONL / SQL / TS), rows · cols status badge, Copy, and Download reflect the exact active table view without mutating raw input.
    • In JSON → CSV mode, toggling Apply view to output on the output CSV table causes Copy and Download to export the projected CSV view.
  • Changelog & Build: Adds changelog entry #20 (2026-10-20) and rebuilds app/dist.

Tradeoffs

  • Opt-in contextual pill vs. always-on view projection: Kept table search, sort, and column hiding non-destructive by default and surfaced Apply view to output only when a view transform is active (per D10), avoiding surprise partial exports when someone merely searches a table to inspect a row.
  • Header-signature reset: hiddenCols resets automatically if the parsed header count or column names change (e.g. uploading a new file or switching examples), while surviving cell edits and in-place single-header renames.

How to Review

  • app/src/lib/tableView.ts & app/src/lib/__tests__/tableView.test.ts — projectCsvView implementation and unit tests.
  • app/src/components/CsvTable.tsx & app/src/components/CsvTable.test.tsx — Columns popover, visibleColIndices grid-to-source column mapping, and Apply view to output toggle.
  • app/src/App.tsx, app/src/components/InputPane.tsx, app/src/components/OutputPane.tsx, & app/src/App.test.tsx — projected CSV wiring for CSV → JSON conversion and JSON → CSV copy/download.

Verification

  • cd app && npm run lint — clean
  • cd app && npx tsc -b --noEmit — clean
  • cd app && npm test — 34 test files, 585 tests passing
  • cd app && npm run build && cd .. && bash .github/scripts/verify-seo.sh — passed
  • Interactive headless Chromium (agent-browser) verification at 1440×900@2x (tc-11)

Human author: David Boskovic (david@obvious.ai)

🔗 Obvious Project · 🧵 Obvious Thread · 🔀 Obvious PR Artifact

@obvious-autobuild-staging
obvious-autobuild-staging Bot marked this pull request as ready for review October 20, 2026 02:52
ObviousApp and others added 3 commits October 20, 2026 03:12
…tput projection

Add projectCsvView to serialize active filtered/sorted rows and checked
columns, a Columns visibility popover in CsvTable with source-column
mapping across sort/edit/paste/delete/selection, and an opt-in Apply
view to output toggle wired through InputPane and OutputPane into App.

Co-authored-by: David Boskovic <david@obvious.ai>
…rsion

Add unit and component integration coverage for projectCsvView,
column visibility toggling, source column mapping when columns are
hidden, and opt-in Apply view to output projection in both directions.

Co-authored-by: David Boskovic <david@obvious.ai>
Add changelog entry #22 for the column visibility picker and Apply view
to output projection and rebuild prerendered production assets.

Co-authored-by: David Boskovic <david@obvious.ai>
@obvious-autobuild-staging
obvious-autobuild-staging Bot merged commit b288fe5 into master Oct 20, 2026
2 checks passed
@obvious-autobuild-staging
obvious-autobuild-staging Bot deleted the feat/view-driven-output branch October 20, 2026 03:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants