Public: anyone can read this; the crew can change it.
A Find box on the clock narrows it to the deals whose address, client or party name matches what the agent types, and works without JavaScript #43
Check · Review · Land · Live done — Landed and live in production.
The clock now has a Find box that narrows the deals, This week and today's reminders to the deals matching what you type, and it works without JavaScript. The route tests, the new find tests and the design and timeline tests pass.
shipped production is serving it deploy d2eada7
1 earlier comment · 1 event
The clock now has a Find box that narrows the deals, This week and today's reminders to the deals matching what you type, and it works without JavaScript. The route tests, the new find tests and the design and timeline tests pass. I did not run the full suite, bun x tsc --noEmit or scripts/gate.ts, because the repo has no tsconfig.json and no scripts/gate.ts. bun scripts/design-lint.ts doesn't exist either; the repo's scripts/lint-design.ts ran with no output.
- Matching:
src/find.tsdoes the work.find(deals, q)takes plain deals and returns plain deals. It matches on address and on every party's name and contact, trimmed and case-insensitive.query(value)is the boundary check: at most 100 characters, no control characters, otherwise it returnsundefined.src/find.test.tscovers address, party name, contact, case, empty and no-match. - The form:
src/pages/clock.tsadds a<form method=get role=search>above the clock, with oneqfield labelled "Find a deal". The echoed value is escaped, and a Clear link appears once something is typed. - Narrowing: the clock, Closed, This week and today's drafts all use the filtered list. Header untouched.
- No match: the page shows "No deal matches “…”" with a Clear link, and the This week and reminders cards are hidden so it stays one line. An empty
qis the whole clock. - Bad input:
src/routes.tsreturns a 400 in the app's refused style, with no stack trace. - Live refresh:
static/live.jsalready refetcheslocation.href, so/eventsrefreshes keep?q=with no change to the script. - Docs and styling: the README's sample-deals walk now says how to find a deal. The new
.findclass is instatic/app.css, placed before the print rules thattimeline.test.tsguards, and named indocs/design/areas/find.md. - Route test: the new test in
src/server.test.tscovers narrowing by address fragment, escaping, the no-match line and the 400s. It checks that a harbor search leaves exactly one lane, not that a specific other deal is absent, because deal ids in that suite aren't fixed.
The issue says to match "client name", but a deal has no client field. The client is the buyer or seller party, so party names already cover it.
I did not touch the contract table, the API, MCP or the terminal. Find is a page filter only; the other doors are unchanged.
To try it, open /?q=harbor on the preview.
🤖 Generated with Claude Code
The web side is sound: the query is bounded and control characters are refused at the boundary, the echo is escaped, GET only, no contract cell touched. Two changes are needed.
- (Fix first) The terminal has no Find. The review rule is that what a person does on the page they can do in src/tty.ts. src/terminal.ts has dates, week and reminders views, and none of them can be narrowed. Add a find key, for example
/, that takes a query. It must go throughquery()andfind()and narrow all three views, with a way to clear it. It also needs a test in src/terminal.test.ts, and the README must say how to use it in the terminal. The pull said it left the terminal alone; the direction asks for both doors.
- Tests. The README promises that This week and today's reminders narrow, but no test checks that. Add a server test that a search for one deal leaves the other deal out of This week and out of the reminders. Add one for the no-match page hiding the
#todaycard. The Closed card is also untested.
Smaller points are in the line comments.
The Find box now has a terminal door too, and the untested claims have tests. The find, server, terminal, timeline and design tests pass (68 tests). I did not run the full suite or a type check, because the repo has no tsconfig.json or scripts/gate.ts. scripts/lint-design.ts ran with no output.
- Terminal:
- / in the dates, week or reminders view opens a "Find a deal" prompt. It goes through query() and find(), the same two functions the page uses.
- All three views narrow to the match. Pressing / and then enter with nothing typed clears it.
- While a find is active, a "Finding “…”" line shows above the view. A miss says "No deal matches “…”".
- The prompt stops accepting text at 100 characters, so an over-long query is truncated and not refused with a message. Control characters are refused by query().
- The key hints list / find, and src/terminal.ts carries a header note about it.
- The test in src/terminal.test.ts covers narrowing, the miss, the 100-character cap and clearing. The README now says how to use it in the terminal.
- Server tests:
- A new test searches for one sample deal and checks the other is gone from This week and from today's reminders.
- A miss hides the #today and #week cards.
- A deal I closed in the test shows in the Closed card when searched for, and is absent when another deal is searched.
- Code tidy: the nested ternary in
src/pages/clock.tsis now a separatenothingconst, and.findsits above the "On paper" comment instatic/app.css.
I did not add the terminal command to docs/TECHNICAL.md; the README covers it.
🤖 Generated with Claude Code
Approved. The earlier asks are met: the terminal door exists (/ prompt, uses the same query()/find() as the page, reads still go through listDeals for the caller so a guest sees nothing private), the server tests cover week, reminders, Closed and the miss, the README covers page and terminal, and the nested ternary is gone. Input is bounded and control characters refused at the boundary, the echo is escaped (tested), the filter is read-only, and contract.json is untouched. I could not diff against 207754eca37e (commit not in the clone), so I judged the full change. Non-blocking: docs/TECHNICAL.md does not mention the terminal key.
The clock now has a Find box that narrows the deals, This week and today's reminders to the deals matching what you type, and it works without JavaScript. The route tests, the new find tests and the design and timeline tests pass. I did not run the full suite,
bun x tsc --noEmitorscripts/gate.ts, because the repo has notsconfig.jsonand noscripts/gate.ts.bun scripts/design-lint.tsdoesn't exist either; the repo'sscripts/lint-design.tsran with no output.src/find.tsdoes the work.find(deals, q)takes plain deals and returns plain deals. It matches on address and on every party's name and contact, trimmed and case-insensitive.query(value)is the boundary check: at most 100 characters, no control characters, otherwise it returnsundefined.src/find.test.tscovers address, party name, contact, case, empty and no-match.src/pages/clock.tsadds a<form method=get role=search>above the clock, with oneqfield labelled "Find a deal". The echoed value is escaped, and a Clear link appears once something is typed.qis the whole clock.src/routes.tsreturns a 400 in the app's refused style, with no stack trace.static/live.jsalready refetcheslocation.href, so/eventsrefreshes keep?q=with no change to the script..findclass is instatic/app.css, placed before the print rules thattimeline.test.tsguards, and named indocs/design/areas/find.md.src/server.test.tscovers narrowing by address fragment, escaping, the no-match line and the 400s. It checks that a harbor search leaves exactly one lane, not that a specific other deal is absent, because deal ids in that suite aren't fixed.The issue says to match "client name", but a deal has no client field. The client is the buyer or seller party, so party names already cover it.
I did not touch the contract table, the API, MCP or the terminal. Find is a page filter only; the other doors are unchanged.
To try it, open
/?q=harboron the preview.🤖 Generated with Claude Code
Closes #38