Public: anyone can read this; the crew can change it.
The Data tab of an SQLite file filters a table by one column's value, from the address #16823
Check · Review · Land · Live done — Landed and live in production.
The Data tab now has one filter box per column under the header, and the MCP data tool takes the same filter. bun test on the three files this change touches (the new test, test/data-top-values.test.ts and test/mcp-size.test.ts), bun x tsc --noEmit, design-lint and gate --explain pass.
-
Reviews
Changes requested — before the latest pushThe query side is sound: bound parameter, column checked against the table's real columns, LIKE wildcards escaped, sealed columns match nothing, and the tests cover hostile names and values. Three things to fix in one round:
- Terminal door: the Data tree in
src/tui/has no per-column filter, and the commit only saysNo door:. A person can do this on the page, so they must be able to in the terminal (samerowsbyoption, a filter entry on the table screen), anddocs/features/data-browser.mdshould name it. - MCP: a
filtercolumn the table lacks returnsnot_found: no such table, which is wrong and misleading. Say the column is unknown (invalid). Alsoformat: csvsilently ignoresfilter; either apply it or refuse the combination. - Web: when a filter names a column the table lacks, the fallback drops every filter but keeps the bad
f.<column>inbase, so the sort and pager links carry it forever. Drop unknown columns frombasewhen the note shows. Add a test for the MCP unknown-column answer.
Boxes: 1, 2 and 4 are met. Box 3 is met for rows only; fix the csv case.
ApprovedEarlier asks are met: the terminal door (
f, samerowsbyoption, sealed column matches nothing, unknown column shown asno such column), the MCPinvalidfor an unknown column versusnot_foundfor a missing table,filterrefused with csv, and filter keys for unknown columns dropped from sort and pager links. The query binds the value and checks the column against the table's real columns. A sealed column matches nothing, and%and_are escaped. Tests cover a hostile name and value on the library, page, MCP and terminal. The how-to is in docs/features/data-browser.md, not the README. No new dependency. Non-blocking: incolumnFilters,out.has(k)tests the prefixed key against a map keyed without the prefix, so it is always false. It only affects the cap-break edge, but compare the stripped name. - Terminal door: the Data tree in
-
Checks
shipped production is serving it deploy 9bea861
-
History
- Data filters: a terminal door (f), invalid for an unknown column, csv refuses filter, bad f.<column> dropped from links (#16315) b095a0f
- The Data tab filters a table by one box per column, from the address and the MCP (#16315) 2ffae4d
- Delete the dead exports scripts/unused-exports.ts finds, area by area (#16800) 7f8d28a
- The terminal opens the board's returns, in the same rows as /board/returns (#16798) 6c3a514
- Reverts need two reds on the same test, and close themselves when main goes green (#16721) 62b9907
- The crew says why it is waiting: the pace's reason on the tick, in flow why, and in the idle words (#16722) ab7816e
- A forge revert is exempt from both doors and the test-with-change rule (#16719) 7eb9bda
- Motion that feels native: one strong ease-out, transform and opacity only, interruptible enters, no motion on frequent actions, lint-enforced (#16816) c5744d4
- Crew accounts you can understand: one pool, the account each run spends said plainly, held runs released on any change (#16498) 00fa396
- Stall log: a long-polled runner claim is resting, not in flight (#16712) 708e62f
- Main's full check gets its own shard count (default 8): about 43 → 21 min (#16723) fe10a9b
- Looks write and read through a theme key, so a release that drops the "dark:" prefix can roll safely (#16807) a55af95
- A Windows .reg file reads as a table of keys and values, with what it deletes called out (#16786) 197d228
- Infrastructure keeps what ended in view, offers End only where something exists, and filters places (#16771) 3e3b7ca
- Connect's first step opens the provider's token page with a 44px button (#16805) fc58724
- src/tui/screens/workspace.ts and src/web/highlight.ts split by concept, highlighter grammars loaded only for the file kind opened (#16784) f8c6a37
- src/crew/runner.ts and src/crew/autonomy.ts split into modules of one concept each, with the same behaviour (#16785) 5c1611e
- src/http/server.ts hands each route family to its own small module, with the same answers (#16782) 6e40585
- An outsider's report or offer is rate-limited per address with a plain 429 and Retry-After (#14524) a70b09a
- An app gets an ordered change stream: rooms, presence and durable order, with no dependency (#16751) 3f72871
The Data tab now has one filter box per column under the header, and the MCP data tool takes the same filter. bun test on the three files this change touches (the new test, test/data-top-values.test.ts and test/mcp-size.test.ts), bun x tsc --noEmit, design-lint and gate --explain pass. I did not run the full suite; the forge runs it on push.
- Address: each box is
f.<column>=<text>in the URL (for example?table=t&f.city=Par&f.kind=cafe). The boxes sit in the table's own form, so Enter in any of them applies all of them, and every box must match. Sorting, paging and Clear keep the filters. The boxes stay visible when nothing matches, so you can edit them. A table with no rows and no filter still shows only the empty message. - Query: each filter is one
CAST("col" AS TEXT) LIKE ? ESCAPE '\'condition with the value bound as a parameter, and%and_in the value are treated literally. The column name has to be one the table reports (the same checkrowsalready did), and a name that isn't one gets the table back unfiltered with the existing "cannot be … searched" note. A sealed column matches nothing, so it can't be guessed a character at a time. At most 20 filters, 200 characters each. - MCP:
datatakesfilter: {column: text}on both itsrepopath and itssourcepath. A bad shape returnsinvalid.test/mcp-size.test.tspasses without raising any ceiling. - Reused:
rowsinbrowse.tsis extended with abyoption, androwPageis extended and now used by both MCP paths.src/data/column_filters.tsis the one new module, for reading the address and the tool object. - Tests:
test/data-column-filters.test.tscovers a hostile value (x' OR 1=1 --,'; DROP TABLE t; --),%and_as literals, hostile column names (includingsqlite_master), the sealed column, and the page's boxes and escaping.
Left out:
- The committed-file SQLite viewer (
src/web/render/sqlite.ts) is unchanged. I took "Data tab" to mean the data browser. That viewer would need new fields onRenderInputand the cache key, so it deserves its own pull. - The terminal data tree has no per-column filter; the commit line says
No door:for that. data-browser.mdis updated.- No
app.lookspage shows the Data tab, so the commit saysNo look:.
Try it: open /data?source=<file>&table=<table>, type in a box under a column header and press Enter.
[{"go":"/data?source=<file>&table=<table>","look":"A second header row with one filter box per column","expect":"Typing a value and pressing Enter puts f.<column>=<value> in the URL and narrows the rows; a value that matches nothing keeps the boxes visible"},{"go":"/data?source=<file>&table=<table>&f.city%22%20OR%201%3D1%20--=x","look":"The table with a note","expect":"The note says that column cannot be sorted or searched, and the rows are not filtered"}]
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
🤖 Generated with Claude Code
The Data tab's per-column filter now works from the terminal too. Both MCP problems and the bad f.<column> in the web links are fixed. The tests I ran pass (63 across the data suites), tsc is clean and design-lint is clean. I didn't run the full suite; the forge runs it on the push.
- Terminal door:
fon a table or one of its rows asks forcolumn=text. It filters through the samerowsbyoption as the page. Empty text lifts that column's filter, and every column named must match. A sealed column matches nothing, and an unknown column labels the tableno such column. While a filter is on, the table line shows the filtered count (users 0 rows of 1, where name~zzz).src/data/tree.tstakes the per-table filters.docs/features/data-browser.mdnames the key. The earlierNo door:line no longer applies. A newtui-datatest covers a match, a miss, a sealed column and a hostile column name. - MCP unknown column: a
filtercolumn the table lacks now answersinvalid: filter names a column the table does not have. A missing table still answersnot_found: no such table. - MCP
format: csvwithfilter: I refused the combination (invalid) instead of applying the filter, because the CSV export has no filter path. The tool answersinvalidbefore reading anything. A test covers this and the unknown-column answer. - Web links: after the "cannot be sorted or searched" note,
baseno longer carriesf.<column>for columns the table lacks. Sort and pager links drop them, and filters on real columns stay. The page test asserts the hostile key is gone from the links.
No look block this time either: the Data tab has no before/after page in app.looks, and the visible change is the terminal key.
The Data tab now has one filter box per column under the header, and the MCP
datatool takes the same filter.bun teston the three files this change touches (the new test,test/data-top-values.test.tsandtest/mcp-size.test.ts),bun x tsc --noEmit,design-lintandgate --explainpass. I did not run the full suite; the forge runs it on push.f.<column>=<text>in the URL (for example?table=t&f.city=Par&f.kind=cafe). The boxes sit in the table's own form, so Enter in any of them applies all of them, and every box must match. Sorting, paging and Clear keep the filters. The boxes stay visible when nothing matches, so you can edit them. A table with no rows and no filter still shows only the empty message.CAST("col" AS TEXT) LIKE ? ESCAPE '\'condition with the value bound as a parameter, and%and_in the value are treated literally. The column name has to be one the table reports (the same checkrowsalready did), and a name that isn't one gets the table back unfiltered with the existing "cannot be … searched" note. A sealed column matches nothing, so it can't be guessed a character at a time. At most 20 filters, 200 characters each.datatakesfilter: {column: text}on both itsrepopath and itssourcepath. A bad shape returnsinvalid.test/mcp-size.test.tspasses without raising any ceiling.rowsinbrowse.tsis extended with abyoption, androwPageis extended and now used by both MCP paths.src/data/column_filters.tsis the one new module, for reading the address and the tool object.test/data-column-filters.test.tscovers a hostile value (x' OR 1=1 --,'; DROP TABLE t; --),%and_as literals, hostile column names (includingsqlite_master), the sealed column, and the page's boxes and escaping.Left out:
src/web/render/sqlite.ts) is unchanged. I took "Data tab" to mean the data browser. That viewer would need new fields onRenderInputand the cache key, so it deserves its own pull.No door:for that.data-browser.mdis updated.app.lookspage shows the Data tab, so the commit saysNo look:.Try it: open
/data?source=<file>&table=<table>, type in a box under a column header and press Enter.Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
🤖 Generated with Claude Code
Closes #16315