Public: anyone can read this; the crew can change it.
/explore says how many results the filters match and offers one link that clears them #12343
Check · Review · Land · Live done — Landed and live in production.
/explore already counted results, offered a "Clear filters" link and handled the empty case. This pull makes the unfiltered count read as the issue asks and lets a sort alone trigger the clear link. The count, explore and MCP tests I ran pass, along with tsc, the gate and the design lint.
shipped production is serving it deploy 7612a18
7 earlier comments · 2 events
/explore already counted results, offered a "Clear filters" link and handled the empty case. This pull makes the unfiltered count read as the issue asks and lets a sort alone trigger the clear link. The count, explore and MCP tests I ran pass, along with tsc, the gate and the design lint. I did not run the full suite: scripts/fast.ts named 2036 of 3082 files for this change. The forge runs the full check on the push.
What changed
- Count wording: with no kind picked, the count above the list now reads "N apps, forges and people" (singular "1 app, forge or person"). Before, it said "N results". The same sentence feeds the MCP
line, so it still matches the API's count for the same query. - Sort and Clear filters: a sort other than the default ("Best") now shows the "Clear filters" link, which goes to bare
/explore. It showed only for kind, text, archived, freshness or owner before. A sort alone doesn't add "Drop …" links to an empty result, since a sort never empties a list. - Tests:
- test/explore-count.test.ts now expects the new unfiltered wording and has a new case for a sort-only query showing the clear link.
- test/mcp-explore-count.test.ts was updated for the new wording. I changed it because the wording changed, not because it was wrong.
Already in place
- Count query: the count comes from the total the list read already returns, so there is no second query on the warm path.
- Empty result: an empty result already names each filter that can be dropped, and each "Drop …" link goes to the same query without that term.
Left out
- The count says "forges" for every viewer, although forges are listed only for admins. I kept the wording the issue asked for.
- I did not time the page against its budget myself. The change only alters strings and one condition.
Try it: open /explore and read the count. Then open /explore?q=sort:forks and tap "Clear filters".
The pre-push hook refused the push until a commit said how to try it, so there is an empty "Try: …" commit on the branch.
Explore's unfiltered count now reads "N apps, forges and people". A sort alone (for example /explore?q=sort:forks) also offers Clear filters, which goes back to bare /explore.
The check failed on one test this pull caused: each page stays inside its first-view budget. The new count line adds 3 words to Explore's first view, so it read 42 words against a budget of 39. I raised Explore's word budget in docs/design/attention-budget.json from 39 to 42, at both 390 px and 1280 px. The test was right to flag it, and the budget was the thing that needed to follow.
test/attention.test.ts passes after the change. tsc --noEmit is clean. I did not re-run the check's full suite locally.
The other 11 failures were the same tests failing on main at 18f765b, which the forge did not count against this pull. I left them alone.
I did not add a different way to say "all kinds"; the issue only asked for the count and the sort-only Clear filters link.
To try it, open /explore and then /explore?q=sort:forks, and tap Clear filters.
The gate failed because this pull changes src/web/studio/explore.ts and no commit message named the page to take before/after pictures of. I added a commit with a Looks: /explore line. /explore is already in app.looks in forge.json. I ran bun scripts/gate.ts locally and it printed nothing, which I took as passing, and I pushed.
I did not re-run tests or tsc for this push, since the new commit has no code change; the last run of each on the code was clean. I haven't seen the forge's check result for this push yet.
Explore's unfiltered count now reads "N apps, forges and people". A sort alone, such as /explore?q=sort:forks, now also offers Clear filters, which goes back to bare /explore. Explore's first-view word budget in docs/design/attention-budget.json went from 39 to 42 for the 3 extra words.
To try it, open /explore and then /explore?q=sort:forks, and tap Clear filters.
Explore's count line now reads "N apps, forges and people" when nothing is filtered, and a sort alone offers "Clear filters". The attention budget is raised by 3 words for the longer line, in docs/design/attention-budget.json.
The check reported 3 failures, none in code this pull touches. The pull's own diff is five files: src/actions/explore.ts, src/web/studio/explore.ts, docs/design/attention-budget.json and two explore-count tests. I found the cause could not be pinned to it:
- Reproduction: the two failing suites I could name,
security-sweepandrelease-journey, passed here before any change, and passed again after merging main. I never saw the third failure in full, because the check log truncated its name. - Branch drift: the branch was 95 commits behind main, which is what the check compared it with. I merged
origin/maininto it (clean, no conflicts) and pushed, so the check now runs on a current base. - Not run:
tsc --noEmitandscripts/gate.tsprinted nothing, so I take them as clean, but I did not read their exit codes. A wider run of every testscripts/fast.tsnamed for this diff (2066 test files) timed out at 120 seconds and was stopped. I ran onlyexplore-count,mcp-explore-count,security-sweepandrelease-journey, and all 26 tests passed.
To try it: open /explore, which reads "N apps, forges and people". Then open /explore?q=sort:forks and tap Clear filters.
If the forge check fails again on the same three tests, the log for that run should name the third one.
The count, the clear link and the miss line all work in the preview (/explore: '6 apps, forges and people'; /explore?q=sort:forks shows Clear filters to /explore). Two things to fix in one round:
- FIRST: the empty sentence now reads 'No apps, forges and people match', which is not plain words (DESIGN 8, docs/WRITING.md). Give the empty case its own phrase, e.g. 'Nothing matches'. Keep the full 'N apps, forges and people' only for N>0.
- The page and the MCP/terminal doors now disagree: the page offers Clear filters for a sort-only query, but exploreFiltered (src/actions/explore.ts) and so the MCP
clearfield do not. Put the sort rule in the shared action so every door answers the same, and add a test in mcp-explore-count for it.
Also: the count says 'forges' to guests, who never see forges (DESIGN 1, says what is true). Name only the kinds the viewer can see, or say 'results' for them. Confirm the TUI explore screen, if any, shows the same line.
Both of juniper's points and the guest-forges note are fixed and pushed as eeb659cf0. tsc, scripts/gate.ts and design-lint are clean, and 211 explore, TUI and attention-budget tests pass locally. The forge's full check has not run on this push yet.
- Empty sentence: with no kind chosen it now reads "Nothing matches". A single kind still reads "No apps match" or "No people match". The full "N apps and people" only appears when N > 0.
- One sort rule:
exploreFilteredinsrc/actions/explore.tsnow counts a non-default sort as a setting to undo. The page, MCPclearand the terminal's "Esc clears" all use it, and the web page's own sort special-case is gone. - Guests and forges:
exploreCounttakes aseesForgesflag. Only an admin's count says "apps, forges and people"; everyone else gets "apps and people". The page, MCP and the TUI explore screen all pass the viewer's admin standing, so the TUI shows the same line. - Tests:
test/explore-count.test.tsnow asserts "Nothing matches" and that a guest's line never mentions forges.test/mcp-explore-count.test.tscovers sort-onlyclear, the empty wording and the admin-only "forges". The old guest assertion inexplore-countchanged from "66 apps, forges and people" to "66 apps and people", because the old text was wrong for guests.
I left the attention-budget ceiling as it was. The guest line is now shorter, so the +3 words from earlier is slack rather than a failure; a person can tighten it.
The gate is now silent, so it passes. The earlier output came from before the edit landed, because the first output was repeated from the killed run.
Merged origin/main into the branch and pushed (7311a9363).
Conflict: src/actions/explore.ts, the exploreFiltered predicate. Main added forks, ships and live as filters. This branch counts a non-default sort as a setting to undo. The resolved version keeps all of main's conditions and adds q.sort !== "score". I also rewrapped its doc comment to 100 columns because the gate flagged it.
Checks:
bun scripts/gate.tsis clean andbun x tsc --noEmitis clean.- Six explore test files pass (113 tests, 0 fail):
explore,explore-count,explore-parity,mcp-explore-count,tui-dashboard-explore,explore-url. scripts/fast.tsnamed 2,094 test files for this diff, about 177 minutes against the 5-minute budget, so I ran only those six and left the full run to the forge's check on this push.
Works in the preview and the shared rule is good, but two things to fix in one round. FIRST: an admin with exactly one result reads "1 apps, forges and people" (plural, ungrammatical; DESIGN 8, WRITING.md). Give that branch a singular, e.g. "1 app, forge or person", and test total=1 for admin and guest. SECOND: the TUI change (dashboard passes f.user?.isAdmin) has no test; add one in tui-dashboard-explore asserting the admin line names forges and the guest line does not, and that a sort-only query shows "Esc clears" and Esc actually resets the sort. The page also has no admin-viewer test, only the unit test in mcp-explore-count. Also: the attention budget was raised to 42 for the admin line, but the guest line is shorter, so the ceiling is slack; set it to what the measured first view reads, or say why not. Note the guest page prints "apps and people", not the literal issue wording, which is correct for guests.
/explore now says how many results the filters leave, in one count line that the page, the terminal and MCP share, and it offers one way to clear them. A sort by itself also counts as something to clear. This round fixes the points from review:
- Singular for an admin: with one result, an admin now reads "1 app, forge or person" instead of "1 apps, forges and people" (
src/actions/explore.ts).test/mcp-explore-count.test.tschecks the one-result case for an admin and for a guest, who reads "1 app or person". - Terminal tests (
test/tui-dashboard-explore.test.ts):
- The count line names forges only for an admin. A guest and a member read "N apps and people". The admin is created in the last test so the person counts the earlier tests read don't change.
- A sort-only line (sort:forks) shows "Esc clears", and pressing Esc removes the line and its count.
- Page with an admin viewer (
test/explore-count.test.ts): a signed-in admin's/explorereads "N apps, forges and people", and a guest's still reads "N apps and people". - Attention budget (disagreeing): I left explore at 42 words.
test/attention.test.tsloads/exploresigned in as an admin, so the first view it measures has the longer admin line. That view reads exactly 42 words, and setting the budget to 41 makes the test fail at both widths. A guest reads two fewer words, but the guest view is not what gets measured. A note indocs/design/attention-budget.jsonnow says this.
Not done: Esc clears the line only while it is still being typed. After Enter keeps the line, Esc does nothing; that is how the shared filter already behaved before this change, and I did not change it.
To try it: open /explore signed in as an admin and as a guest and compare the count line. Then open /explore?q=sort:forks, check that "Clear filters" appears, and click it. In the terminal, type /sort:forks, check the count line shows "Esc clears", and press Esc.
The gate, tsc --noEmit and the explore, attention and terminal-explore test files pass here. scripts/fast.ts named too many test files to run here, so the full suite is left to the forge's check on this push.
🤖 Generated with Claude Code
Explore's count line ("N apps", or what the filter leaves) now reads the same on the page, the terminal and the MCP explore tool. For an admin, the count also includes forges, and one result reads in the singular. This push merges main, which had moved: #12429 lets strangers call explore and search with no token. To do that it moved the tool's body out of src/http/mcp/tools/explore.ts and into exploreRun in src/http/mcp/reads.ts.
- Conflict resolution: I took
main's version ofsrc/http/mcp/tools/explore.ts, which just callsexploreRun. I then put this branch's admin flag intoexploreRunasexploreCount(query, page.total, user?.isAdmin === true). A stranger has no user, so they get the count without forges. - What to look at:
src/http/mcp/reads.ts:39. - Checks:
bun scripts/gate.tsandbun x tsc --noEmitare clean.scripts/fast.tsnamed 2102 test files, too many to run, so I ran the explore, MCP and token-free test files myself (29 files): 293 pass, 0 fail, 3 skipped.
🤖 Generated with Claude Code
Earlier asks met: the empty case reads "Nothing matches"; the sort rule lives in the shared exploreFiltered, so page, MCP clear and the terminal agree; forges are named only for an admin, and the TUI and MCP pass the same flag. Preview confirms: /explore shows the count, a sort-only query offers Clear filters to /explore, and a miss reads "Nothing matches" with Drop and Clear links. Tests cover the count, the clear link, the empty case, the admin wording and the terminal. Non-blocking: the attention budget is measured as an admin, so guests have slack. Note a guest reads "N apps and people", not the issue literal text, deliberately because guests never see forges.
/explore already counted results, offered a "Clear filters" link and handled the empty case. This pull makes the unfiltered count read as the issue asks and lets a sort alone trigger the clear link. The count, explore and MCP tests I ran pass, along with
tsc, the gate and the design lint. I did not run the full suite:scripts/fast.tsnamed 2036 of 3082 files for this change. The forge runs the full check on the push.What changed
line, so it still matches the API's count for the same query./explore. It showed only for kind, text, archived, freshness or owner before. A sort alone doesn't add "Drop …" links to an empty result, since a sort never empties a list.-
test/explore-count.test.tsnow expects the new unfiltered wording and has a new case for a sort-only query showing the clear link. -test/mcp-explore-count.test.tswas updated for the new wording. I changed it because the wording changed, not because it was wrong.Already in place
Left out
Try it: open
/exploreand read the count. Then open/explore?q=sort:forksand tap "Clear filters".The pre-push hook refused the push until a commit said how to try it, so there is an empty "Try: …" commit on the branch.
Closes #12316