Skip to content

Read CSV and TSV as a table on every surface (v0.24.0) - #56

Merged
ralyodio merged 1 commit into
mainfrom
feat/csv-table-viewer
Oct 26, 2026
Merged

ralyodio merged 1 commit into
mainfrom
feat/csv-table-viewer

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

Anthony asked for a native CSV viewer on every readm3 surface, modelled on tabiew. The terminal grid is a new hqtui widget, dataGrid (hqtui#139, released as 0.11.0). Parsing is native TS in src/csv.ts, shared by every surface.

Shared (src/csv.ts): RFC 4180 parser (quotes, embedded delimiters and newlines, BOM). It detects comma/tab/semicolon/pipe and the header row (a file with no header gets lettered columns), types each column as number, date, boolean or text, and sorts by type with empties always last. It also has a filter language (london city:london status=open age>30 joined>=2024-01-01 #3>10 !draft city:"new york") and column stats.

Surface What changed
readm3 TUI CSV/TSV appear in the tree and render through ui.dataGrid. Keys: arrows/hjkl for the cell cursor, 0/$ for first/last column, o sorts, / filters rows, Enter opens the row as a sheet, c shows column stats, v toggles raw text, e edits. Mouse: click a cell, double-click for the sheet, click a header to sort.
/viewer + desktop The file reads as a table: sticky header, click to sort, Σ for stats, a filter box (/ focuses it), click a row for the sheet, Copy view and Download view, 500 rows at a time. It is still a text kind, so edit, history, sync and summarize are unchanged.
/p/ pastes csv is a language (text/csv). An unnamed paste is sniffed as a table only by a strict rule; prose and code are not sniffed as tables.
--print Prints an aligned table.
MCP table_query: source, path, paste link or URL, plus filter, sort, page and stats. Runs locally.
Site Homepage card, paste card, llms.txt, welcome note, README section, desktop file associations.

src/csv.ts is added to the Dockerfile's explicit runtime COPY list because server/pastes.ts imports code.ts.

Tests: 225 unit (23 new in test/csv.test.ts, 3 new in test/code.test.ts), 97 server, 44 Playwright (2 new: local CSV round trip, sniffed TSV paste). I also drove the TUI in a real pty and took screenshots of the web view at 1280 and 390 px wide.

🤖 Generated with Claude Code

Inspired by tabiew. src/csv.ts parses RFC 4180 (quotes, embedded delimiters
and newlines, BOM), sniffs comma/tab/semicolon/pipe and the header row, types
each column, and sorts, filters (col:text col>n col=v !x #3) and summarises.

- terminal reader: CSV/TSV in the tree, drawn with hqtui 0.11's dataGrid:
  cell cursor, o sort, / row filter, enter row sheet, c column stats, v raw
- web editor, desktop app and /p/ paste links: sticky sortable header,
  filter, row sheet, column stats, Copy/Download view; still editable
- pastes: csv is a language, sniffed from unnamed content
- --print prints an aligned table; MCP table_query for agents
- site, llms.txt, README, desktop file associations

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​profullstack/​hqtui@​0.5.0 ⏵ 0.11.086 +2100100 +197 +2100

View full report

@ralyodio
ralyodio merged commit 63ba549 into main Oct 26, 2026
14 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.

1 participant