Skip to content

feat(table): add per-column type override pills in CsvTable (AC-16) - #229

Merged
obvious-autobuild-staging[bot] merged 1 commit into
masterfrom
feat/column-type-overrides
Oct 20, 2026
Merged

obvious-autobuild-staging[bot] merged 1 commit into
masterfrom
feat/column-type-overrides

Conversation

@obvious-autobuild-staging

@obvious-autobuild-staging obvious-autobuild-staging Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Why

Global number and JSON literal parsing (Parse numbers, Parse JSON) works well for uniform tables, but real-world CSVs frequently mix numeric postal codes or numeric IDs (90210, 1001) that must stay strings alongside numeric amount columns, or contain yes/no / 1/0 columns that should emit JSON booleans. Previously, users had to toggle global Parse numbers off for the entire dataset or manually edit the JSON output.

What

  • Per-column type overrides in app/src/lib/convert.ts (AC-16 / D15):
    • Exported ColumnTypeOverride = "auto" | "string" | "number" | "boolean" and extended ConverterOptions / Csv2JsonOptions with optional columnTypes?: Record<string, ColumnTypeOverride>.
    • Applied per-column overrides in applySmartValues before global pass(v) rules while preserving emptyFields: "skip" and nullLiterals: "null" precedence:
      • "string" keeps the cell as a raw string even when global parseNumbers or parseJSON is enabled.
      • "number" coerces numeric strings via toSmartNumber even when global parseNumbers is disabled.
      • "boolean" coerces case-insensitive true/false/1/0/yes/no to booleans and preserves unrecognized strings.
      • "auto" falls through to the global smart pass.
  • Contextual selection toolbar pills & header badges in CsvTable.tsx:
    • When one or more columns are selected in the editable CSV → JSON input table, the selection toolbar renders Type: Auto · String · Number · Boolean (data-testid="input-table-column-type-{auto|string|number|boolean}") with aria-pressed state.
    • Pinned columns display a compact header badge ([STR], [NUM], [BOOL]) in the grid column title and surface a contextual "N column types pinned" reset chip (data-testid="input-table-column-types-reset") in the table toolbar.
    • Renaming a column header preserves its pinned type override under the new header name; clearing the input resets columnTypes.
  • Recent history & changelog:
    • Preserved columnTypes in recentHistory.ts snapshots and added bundled changelog entry #18.

How to Review

  • app/src/lib/convert.ts & app/src/lib/__tests__/convert.test.ts: per-column coercion logic and composition with array/hash modes, emptyFields, and nullLiterals.
  • app/src/components/CsvTable.tsx & app/src/components/CsvTable.test.tsx: selection toolbar segmented control, header badge rendering, header rename migration, and reset chip.
  • app/src/App.tsx, app/src/components/InputPane.tsx, & app/src/App.test.tsx: end-to-end state wiring and reset on Clear.

Test Evidence

AC-16: Per-column type overrides (Auto · String · Number · Boolean) in CsvTable selection toolbar with header badges and reset chip
AC-16: Per-column type overrides (Auto · String · Number · Boolean) in CsvTable selection toolbar with header badges and reset chip — before
AC-16: Per-column type overrides (Auto · String · Number · Boolean) in CsvTable selection toolbar with header badges and reset chip — after

  • cd app && npm run lint && npx tsc -b --noEmit && npm test && npm run build (33 test suites, 562 tests passing)
  • bash .github/scripts/verify-seo.sh (prerendered HTML check passing)
  • Interactive agent-browser verification at 1440×900 attached via autobuild-qa.

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

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

…CsvTable

Allow users to pin individual CSV column output types (Auto, String, Number, Boolean) directly from the CsvTable column selection toolbar without altering raw CSV text or global parse settings.

Co-authored-by: David Boskovic <david@obvious.ai>
@obvious-autobuild-staging
obvious-autobuild-staging Bot force-pushed the feat/column-type-overrides branch from 527fca9 to bc990ca Compare October 20, 2026 02:41
@obvious-autobuild-staging
obvious-autobuild-staging Bot marked this pull request as ready for review October 20, 2026 02:42
@obvious-autobuild-staging
obvious-autobuild-staging Bot merged commit c935050 into master Oct 20, 2026
2 checks passed
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