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

A search that matches nothing anywhere says so once and offers Explore #8625

Merged opened this

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

Merged

A search with no match in any kind now shows one empty state instead of three empty sections. The new tests, `bun x tsc --noEmit`, `bun scripts/design-lint.ts` and `bun scripts/gate.ts` pass. I ran only `test/search-more-code.test.ts`, not the full suite, and I have not tried the page in a running app.

shipped production is serving it deploy cc21c84

opened this

A search with no match in any kind now shows one empty state instead of three empty sections. The new tests, bun x tsc --noEmit, bun scripts/design-lint.ts and bun scripts/gate.ts pass. I ran only test/search-more-code.test.ts, not the full suite, and I have not tried the page in a running app.

  • All kinds empty: with kind all and nothing found, the page draws "Nothing matches “q”" (q escaped). It adds a note that search reads app and repository names and descriptions, issues, pull requests and the code you can see, with an Explore button to /explore. The three section heads are not drawn.
  • Narrowed kind, no match: it keeps its own empty state ("No line of code matches" and so on) and adds a Search everything button to the same q with kind all. The link keeps live and code=all as they were.
  • Any result in any kind: today's three sections are unchanged. A kind with no hits still shows its own "No … matches".

The change is in src/web/pages/search.ts and uses the existing empty and btn components, so there is no new component class.

I changed one existing test, "a search with no hits…" in test/search-more-code.test.ts. It asserted the three per-section "No … matches" lines, which the issue replaces. The new tests there cover the all-empty case, the escaped query, the narrowed-empty case and the one-result case.

To try it, open /search?q=qqqxnothing, then add &kind=code, then search zebrafish on a forge that has a match.

I did not touch the API or MCP search.

Closes #8484

commented

A search with no match in any kind now shows one empty state instead of three empty sections. The new tests, bun x tsc --noEmit, bun scripts/design-lint.ts and bun scripts/gate.ts pass. I ran only test/search-more-code.test.ts, not the full suite, and I have not tried the page in a running app.

  • All kinds empty: with kind all and nothing found, the page draws "Nothing matches “q”" (q escaped). It adds a note that search reads app and repository names and descriptions, issues, pull requests and the code you can see, with an Explore button to /explore. The three section heads are not drawn.
  • Narrowed kind, no match: it keeps its own empty state ("No line of code matches" and so on) and adds a Search everything button to the same q with kind all. The link keeps live and code=all as they were.
  • Any result in any kind: today's three sections are unchanged. A kind with no hits still shows its own "No … matches".

The change is in src/web/pages/search.ts and uses the existing empty and btn components, so there is no new component class.

I changed one existing test, "a search with no hits…" in test/search-more-code.test.ts. It asserted the three per-section "No … matches" lines, which the issue replaces. The new tests there cover the all-empty case, the escaped query, the narrowed-empty case and the one-result case.

To try it, open /search?q=qqqxnothing, then add &kind=code, then search zebrafish on a forge that has a match.

I did not touch the API or MCP search.

Approved

Works in the preview: /search?q=qqqxnothing draws one empty card, "Nothing matches “qqqxnothing”", with an Explore link (an <a>) to /explore. The three section heads are gone. With &kind=code it keeps "No line of code matches" and adds a Search everything link. It uses the existing empty and btn components, escapes the query, and the tests cover all-empty, escaping, narrowed-empty and one-result.

Two things I would do next:

  1. The all-empty card says "Nothing matches" even when the page also shows a notice that code results are still arriving (the "shortly" notice). Skip the card, or word it differently, while that notice shows, so it never claims no match when the search is incomplete.
  2. Check that the terminal finder screen words a no-result search the same way, so both doors say the same thing.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs