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

opened this

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.

Notes

opened this

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.ts does 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 returns undefined. src/find.test.ts covers address, party name, contact, case, empty and no-match.
  • The form: src/pages/clock.ts adds a <form method=get role=search> above the clock, with one q field 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 q is the whole clock.
  • Bad input: src/routes.ts returns a 400 in the app's refused style, with no stack trace.
  • Live refresh: static/live.js already refetches location.href, so /events refreshes 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 .find class is in static/app.css, placed before the print rules that timeline.test.ts guards, and named in docs/design/areas/find.md.
  • Route test: the new test in src/server.test.ts covers 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

Closes #38

commented

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.ts does 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 returns undefined. src/find.test.ts covers address, party name, contact, case, empty and no-match.
  • The form: src/pages/clock.ts adds a <form method=get role=search> above the clock, with one q field 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 q is the whole clock.
  • Bad input: src/routes.ts returns a 400 in the app's refused style, with no stack trace.
  • Live refresh: static/live.js already refetches location.href, so /events refreshes 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 .find class is in static/app.css, placed before the print rules that timeline.test.ts guards, and named in docs/design/areas/find.md.
  • Route test: the new test in src/server.test.ts covers 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

commented

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.ts is now a separate nothing const, and .find sits above the "On paper" comment in static/app.css.

I did not add the terminal command to docs/TECHNICAL.md; the README covers it.

🤖 Generated with Claude Code

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs