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

A search that finds nothing is sent to the crew on Enter #17648

opened this in answer to

Merged 17h 55m ago, live in production

In the palette, a search that matches nothing no longer sends anything to the crew when you press Enter. Tests, the type check and design-lint pass. I didn't run it in a browser, so the 390 px check is untried.

Notes

opened this

In the palette, a search that matches nothing no longer sends anything to the crew when you press Enter. Tests, the type check and design-lint pass. I didn't run it in a browser, so the 390 px check is untried.

  • Behaviour: When the typed words match no row, "Tell the crew: <words>" is the only row left. It stays in the list but isn't selected, and Enter does nothing. A "No matches. Search everything" note appears above it. An arrow key, hover or tap chooses the row, and then the usual "tap or press Enter again to confirm" step still applies. Words with a match still go to the first result on Enter.
  • Code: The decision is a new pure function, enterAction in src/web/palette.ts. It returns pick, search or nomatch, and the palette code in src/web/client.ts uses it. A new test in test/palette.test.ts covers it. I wrote it fresh; I didn't run similar.ts first.
  • Palette on desktop: /search at phone width and the desktop palette are the same dialog, so the fix covers both.
  • Terminal door: The terminal has no palette, so nothing there changes. The commit says so with a No door: line.
  • Docs: I updated docs/design/areas/palette.md and docs/features/palette-rows.md. No new CSS or component class.
  • Not done: I didn't change what a tap on the tell row does. It still sends, after its confirmation.
  • Still open: The gate's "look pages" rule reports that it couldn't trace a page for this change. /search isn't one of the pages in app.looks in forge.json, so my Looks: /search line didn't satisfy it. The gate leaves that to the reviewer.

Try: at 390 px open /search on the preview, type zzq colour wheel and press Enter. Nothing is sent and the list says there is no match. Press ↓ to select "Tell the crew".

🤖 Generated with Claude Code

Closes #17647

5 earlier comments
commented

In the palette, a search that matches nothing no longer sends anything to the crew when you press Enter. Tests, the type check and design-lint pass. I didn't run it in a browser, so the 390 px check is untried.

  • Behaviour: When the typed words match no row, "Tell the crew: <words>" is the only row left. It stays in the list but isn't selected, and Enter does nothing. A "No matches. Search everything" note appears above it. An arrow key, hover or tap chooses the row, and then the usual "tap or press Enter again to confirm" step still applies. Words with a match still go to the first result on Enter.
  • Code: The decision is a new pure function, enterAction in src/web/palette.ts. It returns pick, search or nomatch, and the palette code in src/web/client.ts uses it. A new test in test/palette.test.ts covers it. I wrote it fresh; I didn't run similar.ts first.
  • Palette on desktop: /search at phone width and the desktop palette are the same dialog, so the fix covers both.
  • Terminal door: The terminal has no palette, so nothing there changes. The commit says so with a No door: line.
  • Docs: I updated docs/design/areas/palette.md and docs/features/palette-rows.md. No new CSS or component class.
  • Not done: I didn't change what a tap on the tell row does. It still sends, after its confirmation.
  • Still open: The gate's "look pages" rule reports that it couldn't trace a page for this change. /search isn't one of the pages in app.looks in forge.json, so my Looks: /search line didn't satisfy it. The gate leaves that to the reviewer.

Try: at 390 px open /search on the preview, type zzq colour wheel and press Enter. Nothing is sent and the list says there is no match. Press ↓ to select "Tell the crew".

🤖 Generated with Claude Code

commented

<!-- look-pages 654f196f7503 --> Look pages for 654f196, from the gate:

  • look pages (none): "Looks: /search" is not a page of app.looks in forge.json; this pull changes src/web/client.ts, src/web/palette.ts but the forge could not trace the route of /, /docs, /explore and 29 more (an inline or wrapped handler), so it could not infer a page; the reviewer decides. A "Looks: <path>" line naming the nearest page, or a "No look: <why>" line (10+ characters), says it
commented

The failing check came from my own test: it added a second import from ../src/web/palette.ts in test/palette.test.ts, which the duplicate-import rule refuses. I folded enterAction into the existing import there.

test/palette.test.ts and test/dup-imports.test.ts pass locally (41 tests) and tsc --noEmit is clean. The fix is pushed as 307de6799, so the forge's check will run again on it.

The pull description stands as written: a search that matches nothing no longer sends the typed words to the crew on Enter, and the "Tell the crew" row stays in the list for an arrow key or a tap.

commented

<!-- look-pages 307de6799ff8 --> Look pages for 307de67, from the gate:

  • look pages (none): "Looks: /search" is not a page of app.looks in forge.json; this pull changes src/web/client.ts, src/web/palette.ts but the forge could not trace the route of /, /docs, /explore and 29 more (an inline or wrapped handler), so it could not infer a page; the reviewer decides. A "Looks: <path>" line naming the nearest page, or a "No look: <why>" line (10+ characters), says it
commented

I've pushed a commit that names the look page, and the gate now passes. The gate's earlier complaint was only that /search isn't in app.looks in forge.json.

The palette is the same dialog on every page, so I named /, which is in app.looks, as the nearest page (Looks: /). The commit also carries a No look: line saying why /search isn't used. I changed no code in this commit.

I did not add /search to app.looks in forge.json. That would change what the forge captures for every pull, which goes beyond this issue.

The change itself is as before. When a search matches nothing, Enter sends nothing and the list says there is no match. "Tell the crew" stays in the list and takes an arrow key or a tap.

commented

All four of juniper's points are addressed and pushed (909b12685). The gate is clean and tsc passes. The palette tests pass, 36 in test/palette.test.ts. test/dup-imports.test.ts also passed on the earlier commit but wasn't re-run on this last one.

  1. Orphaned comment: the helper now sits above the PaletteUse comment, so "A row opened before…" documents PaletteUse again.
  2. Dead variant and empty branch: enterAction is now sendsNothing(shown, picked), which returns a boolean, so the unused 'search' value is gone. In src/web/client.ts Enter now returns early with a guard, with no empty branch. The doc in docs/features/palette-rows.md uses the new name.
  3. Wiring test: a new happy-dom test in test/palette.test.ts drives the running palette after typing zzq colour wheel.
    • Initial state: one tell row, aria-selected=false, no aria-activedescendant, and a .palette-empty note saying "No matches".
    • Enter: it sends nothing to /tell, and the palette stays open.
    • ArrowDown then Enter: this reaches the tell row, and one /tell request goes out.
    • Check that it fails without the fix: it fails against the old client.ts.
    • Waits: it waits on the lookup request, not a timer, because the gate refuses fixed waits.
  4. Double selection: render() now skips select() when the row is alone, instead of selecting it and undoing it.

The tell row has no confirmation step. It posts straight away once chosen, so I didn't add one.

I still haven't run this in a real browser.

Try: open / on the preview, press Ctrl K, type zzq colour wheel and press Enter. Nothing is sent and the list says there is no match. Press ↓ then Enter to send it.

🤖 Generated with Claude Code

Sign in to join this conversation.

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

Keyboard shortcuts

Docs