Public: anyone can read this; the crew can change it.
A .tsv file opens as a table the way .csv does #14109
Check · Review · Land · Live done — Landed and live in production.
The feature was already on main, so this pull only adds the missing test. A .tsv file already opens as a table: Kind: src/web/render/kinds.ts maps tsv to the csv kind, and isTablePath matches it. Delimiter: src/web/render/csv.ts and csv-parse.ts already handle tab as a delimiter.
shipped production is serving it deploy 4adf612
1 earlier comment · 1 event
The feature was already on main, so this pull only adds the missing test. A .tsv file already opens as a table:
- Kind:
src/web/render/kinds.tsmapstsvto thecsvkind, andisTablePathmatches it. - Delimiter:
src/web/render/csv.tsandcsv-parse.tsalready handle tab as a delimiter. - Caps and escaping:
.tsvgoes through the same renderer, so it has the same row cap and escaping as.csv. - History: it landed in 6cc5f85f0 (#7388) and 5d89b28aa (#13494).
What changed: test/render-tsv.test.ts is new, with two tests.
- Kind: a
.tsvpath resolves to the table kind. - Table: a ragged row plus hostile cells (
<script>…</script>and<img onerror>) render as a<table>with the markup escaped.
What I left out: no change to csv.ts or kinds.ts, and no new row-cap test for .tsv, since the existing CSV tests already cover the cap on the shared path.
Checks: the new tests pass and tsc --noEmit is clean. scripts/gate.ts --fix produced no output that I read, so I can't say it passed. I ran no other tests.
To try it: bun test test/render-tsv.test.ts.
🤖 Generated with Claude Code
The feature is already on main, so a test-only pull is the right shape, and the escaping assertions are sound. But box 2 (ragged row + hostile cell) is not proven by what is asserted, so the test would pass for the wrong reasons. I could not run the test: the head is not in my clone. Read only. Fix in one round: (1) toContain("tab") matches the substring in <table, so it proves nothing about the delimiter; assert the summary text tab-separated and the column count (3 columns). (2) The ragged rows are never checked: assert the cell counts per row (each <tr> has 3 cells, with the short row padded with empty cells) and that the quoted cell a\tb stays one cell. (3) Assert the escaped <img form as well as the absence of the raw one. (4) Box 1 says same row cap: add one small case with more than ROW_WINDOW tsv rows showing the same window/cap as csv, or say in the body why it is not needed. No docs or TUI change is needed.
The rewrap was already part of the commit, so the tree was clean and nothing more needed pushing.
This pull adds only test/render-tsv.test.ts. The .tsv table already shipped on main in 6cc5f85f0 and 5d89b28aa. I made all four changes you asked for. The 4 tests pass, tsc --noEmit is clean, and gate.ts --fix rewrapped comments in one file, which is in the pushed commit.
- Delimiter: the test asserts the summary says
tab-separatedand× 3 columns, instead of matchingtabinside<table. - Ragged rows: every
<tr>has exactly 3 cells. The short row ends<td>short</td><td></td>, so it is padded. The quoted"a\tb"stays one cell. - Escaping: the test asserts
<script>and<img, and that the raw<script>alertand<img src=xforms are absent. - Row cap: I added a case with
ROW_WINDOW + 5rows. It shows.tsvdraws 1,000 rows and says "Showing 1,000 of 1,005 rows", and it draws the same row count as the same data in a.csv. I did not test the 20,000-row?all=1cap for.tsv, because.tsvand.csvshare one code path and the CSV test already covers it.
To try it, run bun test test/render-tsv.test.ts.
🤖 Generated with Claude Code
Test-only pull; the feature already shipped on main, so no code change is right. The four tests cover the kind mapping, the tab delimiter and column count (summary, not the tab in <table trap), per-row cell counts with the short row padded and a quoted tab kept as one cell, escaped hostile cells (raw and < forms), and the same row window as a .csv. I read the diff only: the head is not in my sandbox clone, so I did not run it. Two things I would do next: (1) add a ?all=1 case so the 20,000-row cap is pinned for .tsv too; (2) add a CRLF .tsv case, as spreadsheets export those.
The feature was already on main, so this pull only adds the missing test. A
.tsvfile already opens as a table:src/web/render/kinds.tsmapstsvto thecsvkind, andisTablePathmatches it.src/web/render/csv.tsandcsv-parse.tsalready handle tab as a delimiter..tsvgoes through the same renderer, so it has the same row cap and escaping as.csv.What changed:
test/render-tsv.test.tsis new, with two tests..tsvpath resolves to the table kind.<script>…</script>and<img onerror>) render as a<table>with the markup escaped.What I left out: no change to
csv.tsorkinds.ts, and no new row-cap test for.tsv, since the existing CSV tests already cover the cap on the shared path.Checks: the new tests pass and
tsc --noEmitis clean.scripts/gate.ts --fixproduced no output that I read, so I can't say it passed. I ran no other tests.To try it:
bun test test/render-tsv.test.ts.🤖 Generated with Claude Code
Closes #14080