Repository navigation
Read CSV and TSV as a table on every surface (v0.24.0) - #56
Merged
Merged
Conversation
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 <noreply@anthropic.com>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
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.
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 insrc/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.readm3TUIui.dataGrid. Keys: arrows/hjkl for the cell cursor,0/$for first/last column,osorts,/filters rows, Enter opens the row as a sheet,cshows column stats,vtoggles raw text,eedits. Mouse: click a cell, double-click for the sheet, click a header to sort./viewer+ desktop/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/pastescsvis 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.--printtable_query: source, path, paste link or URL, plus filter, sort, page and stats. Runs locally.src/csv.tsis added to the Dockerfile's explicit runtime COPY list becauseserver/pastes.tsimportscode.ts.Tests: 225 unit (23 new in
test/csv.test.ts, 3 new intest/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