Public: anyone can read this; the crew can change it.
Find a lead on the desk by name, email or phone #21
Check · Review · Land · Live done — Landed and live in production.
The signed-in desk now has a search box that finds a lead by name, email or phone, and the pull is pushed. The search tests, the server tests and the other touched suites pass, as does the design lint. I didn't run bun test over the whole suite, since the forge runs that on push.
shipped production is serving it deploy aba151a
The signed-in desk now has a search box that finds a lead by name, email or phone, and the pull is pushed. The search tests, the server tests and the other touched suites pass, as does the design lint. I didn't run bun test over the whole suite, since the forge runs that on push. Three checks didn't run:
bun x tsc --noEmit: it printed only its help text and checked nothing, because the clone has notsconfig.json.scripts/gate.tsandscripts/fast.ts: these don't exist in this clone.- Live refresh: I read the code but didn't run it.
static/live.jsrefetcheslocation.href, so it should keepqandshow.
What changed
- Search:
src/leads.tshasqueryOf, which trims the text, caps it at 80 characters and refuses control characters.desk()matches name or email case-insensitively. It matches phone by digits only, so "555 0101" finds "(206) 555-0101". - Safety: the query is parameterised and
%,_and\are escaped, so a%matches literally. - Desk page: a plain GET form at the top, with
showcarried in a hidden field. The view links keepq. Below the form it says "N leads match 'x'" with a Clear link, or "No lead matches 'maria'." when nothing does. - Bad search on the page: a too-long or control-character query still shows the desk with the refusal above it, instead of the signed-out page.
- JSON and MCP:
GET /leads?q=…returns the same list, and a refused query gets a 422./openapi.jsonandcontract/openapi.jsondescribeq. The MCPlist_leadstool takesq. - Terminal:
/opens a search prompt. Enter applies it, an empty search clears it, esc cancels. - Counts: the view counts show how many of the matches fall in each view, not the whole desk.
- Access and docs: access is
list leadthroughpermit, and no contract cell changed. The README desk section mentions it, andstatic/app.cssadds a one-row.searchform. - Tests:
src/search.test.tscovers name, email and phone matches, a view combined with a search, a literal%, a refused over-long query, the page wording and escaping, and the terminal.src/server.test.tschecks that the JSON matches the HTML and that MCPqworks.
Not done
- No search-as-you-type JavaScript.
- No fuzzy matching: it is substring only.
Try it: open /?q=maria, /?show=open&q=555+0102, or /leads?q=555%200101. In the terminal, press / and type.
🤖 Generated with Claude Code
I merged main into the branch, resolved the two conflicts, and pushed. The full bun test run passes (114 tests, 0 failures) and the design lint is clean. I didn't run a type check or scripts/gate.ts, because the clone has neither a tsconfig.json nor that script.
src/terminal.ts: the three conflicts were the key-help lines and theViewtype. I kept both sides, so the terminal desk has/to find a lead andafor activity, and itsViewtype has bothsearchandactivity.static/app.css: I kept the.searchand.foundrules and the.activityrule.contract/openapi.json: I re-emitted it after the merge so it matches the routes from both sides.
Clean. Search goes through listLeads and permit (list lead), so every door is gated the same way. The query is parameterised with %, _ and \ escaped, and queryOf caps it at 80 characters and refuses control characters. Output is escaped. No contract cell changes and there are no new dependencies. Tests cover name, email and phone matches, the view combined with a search, literal %, the refusal, the page wording, the terminal, the JSON route and MCP. The README is updated. I could only fetch the signed-out preview, so I did not see the signed-in search in use. Nits only: src/mcp.ts and Q_HELP hardcode 80 instead of using MAX_QUERY, and the signed-out test only asserts ok is false.
The signed-in desk now has a search box that finds a lead by name, email or phone, and the pull is pushed. The search tests, the server tests and the other touched suites pass, as does the design lint. I didn't run
bun testover the whole suite, since the forge runs that on push. Three checks didn't run:bun x tsc --noEmit: it printed only its help text and checked nothing, because the clone has notsconfig.json.scripts/gate.tsandscripts/fast.ts: these don't exist in this clone.static/live.jsrefetcheslocation.href, so it should keepqandshow.What changed
src/leads.tshasqueryOf, which trims the text, caps it at 80 characters and refuses control characters.desk()matches name or email case-insensitively. It matches phone by digits only, so "555 0101" finds "(206) 555-0101".%,_and\are escaped, so a%matches literally.showcarried in a hidden field. The view links keepq. Below the form it says "N leads match 'x'" with a Clear link, or "No lead matches 'maria'." when nothing does.GET /leads?q=…returns the same list, and a refused query gets a 422./openapi.jsonandcontract/openapi.jsondescribeq. The MCPlist_leadstool takesq./opens a search prompt. Enter applies it, an empty search clears it, esc cancels.list leadthroughpermit, and no contract cell changed. The README desk section mentions it, andstatic/app.cssadds a one-row.searchform.src/search.test.tscovers name, email and phone matches, a view combined with a search, a literal%, a refused over-long query, the page wording and escaping, and the terminal.src/server.test.tschecks that the JSON matches the HTML and that MCPqworks.Not done
Try it: open
/?q=maria,/?show=open&q=555+0102, or/leads?q=555%200101. In the terminal, press/and type.🤖 Generated with Claude Code
Closes #19