Public: anyone can read this; the crew can change it.
A search with no results offers one next step: the same words across all repositories, or a tell to the crew #13149
Check · Review · Land · Live done — Landed and live in production.
An empty /search now offers two links under the "Nothing matches" sentence. They are "Search “q” across every repository" and "Tell the crew about “q”". I ran bun x tsc --noEmit, bun test test/search-page.test.ts and bun scripts/design-lint.ts, and all pass.
shipped production is serving it deploy 59903fa
6 earlier comments · 1 event
An empty /search now offers two links under the "Nothing matches" sentence. They are "Search “q” across every repository" and "Tell the crew about “q”".
I ran bun x tsc --noEmit, bun test test/search-page.test.ts and bun scripts/design-lint.ts, and all pass. I did not run the whole suite; the forge runs the full check on this push. The change is in src/web/pages/search.ts.
- Every-repository link: it goes to
/search?q=…with the kind, live and code-all filters dropped./searchhas no per-repository scope, so on the plain all-kinds page this link points at the same page. I kept it because the issue asks for both links. It only does something after a narrowed search, which already shows its own empty-section message. - Tell link: it goes to
/?text=<query>, which opens the composer with the words filled in, the same entry the share target uses. It is only a link and sends nothing. The query is escaped in the page and URL-encoded in both links. - When it shows: only when the query is non-empty and an all-kinds search finds nothing. It adds no extra query, and an empty query shows neither link.
- Test:
test/search-page.test.tscovers three cases. A no-hit query with<,&and quote characters shows both encoded links and the escaped text. An empty query shows neither link. A query with hits shows neither link.
The first push was blocked by a pre-push hook that wants a "Try:" commit message. I added an empty commit with one, which is why the history has a commit with no change.
To try it, open /search?q=zzz-nothing and follow "Tell the crew about".
🤖 Generated with Claude Code
An empty /search now says nothing matches and offers two links: the same words across every repository, and "tell the crew" with the query filled in.
The check failed because this pull changes src/web/pages/search.ts and no commit had a Looks: or No look: line. I pushed an empty commit with a No look: line, because no page in app.looks shows an empty search. I did not add one to forge.json. bun scripts/gate.ts printed nothing after that commit, and I did not re-run the tests, since the commit changes no code.
- What changed: under the "Nothing matches" sentence,
src/web/pages/search.tsrenders a "Search “q” across every repository" link to/search?q=…with the kind, live and code-all filters dropped. It also renders a "Tell the crew about “q”" link to/?text=<query>, which opens the composer with the words filled in. The query is escaped in the page and encoded in both links. An empty query shows neither link, and no extra query runs. - Test:
test/search-page.test.tscovers the links with a query containing<,&and quotes, an empty query, and a query that has hits. - Left out:
/searchhas no per-repository scope, so on the plain all-kinds page the first link points at the page you are already on. I kept it because the issue asks for both links. - To try it: open
/search?q=zzz-nothingand follow "Tell the crew about".
🤖 Generated with Claude Code
An empty /search result now offers one next step: the same words searched across every repository, or a "Tell the crew about" link into the composer with the words filled in. The last check failed only the gate's 100-column comment rule. I rewrapped two over-long comment lines in test/search-page.test.ts and changed no behaviour.
bun scripts/gate.ts --fix rewrote nothing, so I found and wrapped the two lines by hand. After that the gate and bun x tsc --noEmit pass, and the 7 tests in test/search-page.test.ts pass. I didn't run other test files or bun scripts/design-lint.ts; the forge runs the full check on this push.
To try it, open /search?q=zzz-nothing and follow "Tell the crew about" to the composer.
The 'across every repository' link is a dead end. On the preview, /search?q=zzz-none (the all-kinds empty page) renders a link to /search?q=zzz-none, the page you are already on. The PR description admits this. A reader who clicks it sees no change, which is worse than no link. Fix first: show that link only when the search was narrowed (a.kind !== 'all', or live/codeAll set) so it widens to something real. On the plain page offer only the tell-the-crew link. Add a test for the narrowed case and for the plain case.
Second: the empty state now has three exits (Explore, the widen link, tell the crew) where the issue asks for one next step; drop the 'Explore instead' sentence or fold it so there is one ask (principle 1, nothing explains itself twice).
Third: the two links are separated by a middle dot inside a bare <p>, so on a 360px phone they wrap into a run-on and the tap targets sit close together. Make them two rows (principle 7), with enough vertical space between them to hit with a thumb.
Also: the link text is long and quotes the query twice; plain words (principle 8) would be 'Search all repositories' and 'Tell the crew'. The query is already printed one line above. Check that a very long query does not overflow the 360px width.
Both doors: the terminal has no search screen counterpart for this empty state; confirm src/tui covers search or say why it does not. docs/features/search-is-palette.md should mention the next step.
An empty search now offers one next step, "Tell the crew", which opens the composer with the query filled in. "Search all repositories" appears only when the search was narrowed with live=1 or code=all, and it drops that narrowing. test/search-page.test.ts (8 tests), the gate, tsc and design-lint pass.
- Dead-end link: on the plain page the widen link is gone, so it can no longer point at the page you are on.
- One ask: I dropped the "Explore instead" sentence.
- Two rows: each link is its own block with 0.7rem of padding above and below. The middle-dot run-on is gone.
- Plain words: the links read "Search all repositories" and "Tell the crew". The query is not repeated, since it is printed in the line above.
- Long queries:
[data-search]already setsoverflow-wrap: anywhere, so a long query wraps rather than overflowing. I did not check this at 360px in a browser. - Tests:
- The plain page has no widen link and no Explore sentence.
- live=1 and code=all each show the widen link, pointing at /search?q=zzz-none.
- The "Tell the crew" link is encoded, and the next-step block is absent for an empty query or a hit.
- The next-step block is asserted on class="next-step", because the CSS string also contains [data-next-step].
- Docs: I added the next step to
docs/features/search-is-palette.md. - Terminal:
src/tuihas no search results screen, only the finder and palette, which keep their own ranking. The doc now says so.
This empty state only renders for an all-kinds search. A kind=repos search that finds nothing still shows its empty sections, so a.kind !== 'all' can never trigger the widen link here. I left that case alone because it is outside this issue.
An empty search page now ends in one muted line that links to Explore and to "tell the crew". When the search was narrowed (live=1 or code=all), it also links to "search all repositories". The first-view budget test and the Explore test both pass again, along with test/search-page.test.ts, gate, tsc and design-lint.
Why the check failed: the earlier version put the links in a second paragraph. That pushed the /search?q=forge page past its first-view budget (59 words against 58, 6 blocks against 5). It also dropped the Explore link, which test/search-more-code.test.ts requires.
What changed:
- Everything now sits in a single
<p class="muted next-step" data-next-step>, so the page is back to 56 words and 5 blocks. - The "Search all repositories" link is still left out on the plain page, because it would point at itself.
- I removed the extra CSS rule for the two stacked link rows, since they are now inline.
- I dropped the paragraph I had added to
docs/features/search-is-palette.md. - In
test/search-page.test.tsI changed the selector fromclass="next-step"todata-next-step. I also removed the assertion that "Explore instead" is absent, because the Explore link is now kept. - I merged
origin/maininto the branch before pushing.
What I left out: the terminal has no search results screen, so there is no counterpart there.
To try it: open /search?q=zzz-nothing, then add &live=1 to see the widen link. "Tell the crew" opens the composer with the words filled in.
An empty search on the web page now offers one muted next-step line. It links to Explore and, when the search was narrowed, to "search all repositories". With a non-empty query it also offers "tell the crew".
The check failed on the "both doors" rule because the pull edits src/web/pages/search.ts with no matching terminal change or how-to. I added an empty commit with a "No door:" line instead. The terminal has no cross-repository search page, and its Explore line already reports its own empty result (src/actions/explore.ts).
bun scripts/gate.ts passes locally with that commit. I did not run tsc or the tests, because only a commit message changed. The forge's check will run against the push.
To try it, search for a nonsense word at /search?q=zzzz on the preview.
The one failure this pull caused is fixed and pushed. test/search-language.test.ts still looked for the old bare <p class="muted"> in the empty-search sentence. The new next-step line has an extra class, so I changed the test to look for the data-next-step marker. The bare form still must not show it, and a no-result query must. test/search-language.test.ts and test/search-page.test.ts pass locally (10 tests).
The other three failures are not from this change:
- Thread window: the check itself found
test/thread-window.test.tsred on main too. - Forks screen and header: the two shard 47 tests passed when I reran
test/tui-forgeview-live.test.tsandtest/tui-data.test.ts. They did not point at anything in this pull, so I left them alone. If they fail again on the new push, send me the log.
Earlier asks (no dead-end self-link, first-view budget kept, Explore link kept, both-doors note, search-language test updated) are met. Preview checked: the empty search says one sentence, escapes the query, and encodes both links; live=1 adds the widen link. Non-blocking: 1) "Explore or search all repositories or tell the crew" reads clumsily; a comma list or separate verbs would read better. 2) On the plain page only the tell link is new, since the page is already the widest search; fine, but say so in the pull.
An empty
/searchnow offers two links under the "Nothing matches" sentence. They are "Search “q” across every repository" and "Tell the crew about “q”".I ran
bun x tsc --noEmit,bun test test/search-page.test.tsandbun scripts/design-lint.ts, and all pass. I did not run the whole suite; the forge runs the full check on this push. The change is insrc/web/pages/search.ts./search?q=…with the kind, live and code-all filters dropped./searchhas no per-repository scope, so on the plain all-kinds page this link points at the same page. I kept it because the issue asks for both links. It only does something after a narrowed search, which already shows its own empty-section message./?text=<query>, which opens the composer with the words filled in, the same entry the share target uses. It is only a link and sends nothing. The query is escaped in the page and URL-encoded in both links.test/search-page.test.tscovers three cases. A no-hit query with<,&and quote characters shows both encoded links and the escaped text. An empty query shows neither link. A query with hits shows neither link.The first push was blocked by a pre-push hook that wants a "Try:" commit message. I added an empty commit with one, which is why the history has a commit with no change.
To try it, open
/search?q=zzz-nothingand follow "Tell the crew about".🤖 Generated with Claude Code
Closes #13143