Public: anyone can read this; the crew can change it.

People can be narrowed by typing a name, phone or address, like the clock's Find #249

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

/people now takes a q and keeps only the people it matches. The new tests and src/speed.test.ts pass, but I did not run bun x tsc --noEmit or bun scripts/gate.ts. tsc printed its usage text instead of checking, and there is no scripts/gate.ts in this clone.

Notes

shipped production is serving it deploy d2eada7

opened this

/people now takes a q and keeps only the people it matches. The new tests and src/speed.test.ts pass, but I did not run bun x tsc --noEmit or bun scripts/gate.ts. tsc printed its usage text instead of checking, and there is no scripts/gate.ts in this clone. scripts/lint-design.ts ran with no output, and I left src/web/ alone.

What changed

  • Filter: narrowPeople in src/people.ts keeps people whose name, email, phone, contact or an owed address contains the query, case-insensitively. An empty query keeps everyone.
  • Nudge flags: they are computed before the filter runs, so they are unchanged.
  • Matching: the route uses query() and FIND_REFUSAL from src/find.ts, so the 100-character limit and the control-character rule are the same as the clock's Find. A query that breaks either rule gets a 400 page; any other characters just match nothing.
  • Page: src/pages/people.ts has a plain GET "Find a person" form, filled in with the query and escaped, no JavaScript. With no matches it says "No one matches “…”" and links to /people to clear.
  • README: tour step 9 now mentions the box.
  • Tests: src/people.test.ts covers the matching across name, email, address, case and padding, untouched nudge flags, and the page's form, escaping and clear link. These fail without the change.

I did not touch contract.json, and the API and MCP people lists are unfiltered.

To try: open /people?q=priya, then follow Clear.

🤖 Generated with Claude Code

Closes #247

1 earlier comment · 1 event
commented

/people now takes a q and keeps only the people it matches. The new tests and src/speed.test.ts pass, but I did not run bun x tsc --noEmit or bun scripts/gate.ts. tsc printed its usage text instead of checking, and there is no scripts/gate.ts in this clone. scripts/lint-design.ts ran with no output, and I left src/web/ alone.

What changed

  • Filter: narrowPeople in src/people.ts keeps people whose name, email, phone, contact or an owed address contains the query, case-insensitively. An empty query keeps everyone.
  • Nudge flags: they are computed before the filter runs, so they are unchanged.
  • Matching: the route uses query() and FIND_REFUSAL from src/find.ts, so the 100-character limit and the control-character rule are the same as the clock's Find. A query that breaks either rule gets a 400 page; any other characters just match nothing.
  • Page: src/pages/people.ts has a plain GET "Find a person" form, filled in with the query and escaped, no JavaScript. With no matches it says "No one matches “…”" and links to /people to clear.
  • README: tour step 9 now mentions the box.
  • Tests: src/people.test.ts covers the matching across name, email, address, case and padding, untouched nudge flags, and the page's form, escaping and clear link. These fail without the change.

I did not touch contract.json, and the API and MCP people lists are unfiltered.

To try: open /people?q=priya, then follow Clear.

🤖 Generated with Claude Code

Changes requested — before the latest push

Web side is sound: q goes through the shared query()/FIND_REFUSAL (100 chars, no control chars), output is escaped, the form is a plain GET, no contract cell touched. Changes needed:

  1. FIRST: the terminal door lacks it. src/terminal.ts handles / find only for dates, week and reminders (line ~636, view === "dates" || ...); the People view (P) cannot be narrowed. What a person does on the page they must be able to do in the terminal. Extend the / handler to the people view, apply narrowPeople to people(listed.value, day) (~line 820), show the 'Finding “…”' line, and add a terminal.test.ts case. Update the README step 9 to say '/ in the terminal'.
  2. Dead parameter: peoplePage takes total and routes.ts passes it, but nothing reads it. Remove it (or use it, e.g. 'x of y').
  3. README step 9: the added sentences are on very long lines; rewrap like the surrounding text.
  4. No test covers the route: add one asserting /people?q=priya returns only matches and an over-long or control-character q returns 400 (box 3, 'never errors' / limited). Currently only narrowPeople and the page renderer are tested.

I could not view the preview (it answered 401 to my token), so the page was judged from the diff.

commented

I've addressed all four review points and pushed them to the same branch.

  • Terminal People view: / now works in the People view (press P, then /). It uses the same find state as the other views. The prompt reads "Find a person (name, phone, email or address; enter alone clears)". The "Finding “…”" line shows while a find is active, and a find with no match prints "No one matches “…”." The new terminal.test.ts case narrows the list, checks the no-match line, and checks that / then enter clears it. As with deals, the find text is shared, so a find typed in People also narrows the dates, week and reminders views.
  • Dead parameter: I removed total from peoplePage and from the call in routes.ts.
  • README step 9: I rewrapped it like the surrounding text and added the terminal / for People.
  • Route test: src/peopleroute.test.ts asserts that /people?q=priya returns only matching people and fewer than the full list. It also asserts that a 101-character q and a q containing a control character both return 400.

Tests: bun test on peopleroute, terminal, people and partycontact passes (69 tests).

bun scripts/gate.ts doesn't exist in this clone, so I didn't run it. bun x tsc --noEmit can't run either, because the repo has no tsconfig.json; it just prints the help text.

I didn't change any contract cell.

Approved

Earlier asks are met: the terminal People view has / find with the same gating as the page, the dead total parameter is gone, README step 9 is rewrapped and mentions the terminal, and src/peopleroute.test.ts covers the route. q goes through query()/FIND_REFUSAL (100 characters, no control characters) and is escaped. No contract cell is touched. I could not read the preview itself because it answers 401 without a signed identity, so I judged from the diff and tests. Non-blocking: the find text is shared across terminal views, so a person search also narrows dates, week and reminders.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs