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
Merged 34d 11h ago, 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.
-
Reviews
Changes requested — before the latest pushThe 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.
ApprovedApproved. 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.
- (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
-
Checks
shipped production is serving it deploy d2eada7
-
History
- Find in the terminal on / and tests for the narrowed cards; tidy the no-match branch and the css order 4f71851
- A Find box on the clock narrows it to matching deals, without JavaScript 207754e
- Every reminder signs off with the agent's name, brokerage, phone and email, and the README says how to make the app carry your own (#41) 051e5ff
- After a demo, one Restore the sample deals action brings back the four sample deals exactly as the README describes, leaving every real deal untouched (#40) 7b82088
- A signed-out visitor lands on a page that shows what deal-clock does, with a picture of the clock made from made-up data, and one Sign in button (#32) ec11a46
- A date that slips past due without being marked done drafts a follow-up to whoever owes it, which the agent approves like any reminder (#35) b83509d
- Each deal has a client timeline: one printable page of its dates and who owes each, to hand to buyers or sellers, without the agent's controls (#33) c28a514
- A deal whose closing is marked done leaves the clock for a Closed list, and can be reopened (#28) 4f83b8c
- Under the clock, a This week list gives every open date in the next seven days, day by day, readable on a phone without scrolling sideways (#27) cfd3c1e
- Each deal shows a Messages record: every reminder sent for it, newest first, with who, when and the exact words approved (#26) 2f6d6ec
- The agent can decline a reminder with a reason, so a message they chose not to send stops asking and the record says why (#24) ec4452c
- An agent over MCP can correct or remove a party, remove a dropped date and remove a deal, as the page and the terminal can (#19) 6354d9b
- New deal shows every computed date before it is opened, and a refused form keeps what was typed (#22) 6c86e19
- A realtor reads the README in one go: what it does, a five-minute walk through the sample deals, and what is not real yet, with the technical part kept separate (#18) eec530a
- The agent can correct a party's name or contact, remove a party, and remove a date the contract dropped (#16) f62bfce
- The agent can edit a reminder's words before sending, and the sent record keeps exactly what was approved (#10) fa34ea2
- An agent can open a deal, add a date, add a party and reopen a date over MCP, like on the page (#14) d8f7cb2
- Sample deals look like today on every boot, not like the day the database was made (#11) 7eadc93
- The template's notes scaffold is gone, so every door is about deals (#8) ab2ee77
- Build deal-clock (#2) 8969e75
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 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 throughquery()andfind(), 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, andsrc/terminal.tscarries a header note about it. - The test in
src/terminal.test.tscovers 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
#todayand#weekcards. - 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
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