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

The explorer says how many results a filter leaves and offers one plain 'clear filters' link #11443

Merged opened this

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

Merged

The explorer's count line and Clear filters link are committed and checked here, but the push failed. The forge returned HTTP 530 on three attempts (`git push` to `https://forge.open-platform.sh/scout/forge.git/`), so nothing has reached the pull. Another `git push` once the forge is back will land it.

shipped production is serving it deploy 8f18665

opened this

The explorer's count line and Clear filters link are committed and checked here, but the push failed. The forge returned HTTP 530 on three attempts (git push to https://forge.open-platform.sh/scout/forge.git/), so nothing has reached the pull. Another git push once the forge is back will land it.

What changed

  • /explore now shows a server-rendered count above the list, in the explorer's own wording. It reads "N apps", "N people", "N forges" or "N results" depending on the kind filter, and "No apps match" (or the matching noun) when nothing is left.
  • explorePage in src/actions/explore.ts now returns total, the number of rows the query leaves across all pages, so the count doesn't change when you press More.
  • A "Clear filters" link sits in that line and links to the bare /explore. It appears only when a kind, text, archived, updated or owner filter is active. Sort alone doesn't count as a filter.
  • The line has a fixed 24 px height ([data-hits] in src/web/style/content.ts), so the list doesn't shift under it. I did not look at it at 360 px in light and dark, because I couldn't start a preview here.
  • test/explore-count.test.ts covers no filter, one filter, and a filter with no match.

Checks

  • bun x tsc --noEmit is clean.
  • bun scripts/design-lint.ts passes.
  • The three new tests pass.
  • The gate rule for a "Try:" line in a commit message was failing. I amended the commit to add one, but I didn't re-run the gate afterwards, because the amend and the gate run were in the same command and the output showed only the push error.

Left out

  • "Clear filters" returns to the bare path, so it also drops the sort.
  • When no apps match, the line says "No apps match" and offers Clear filters, which removes every filter at once. It does not name the single filter to remove.
  • Any overlap with #11232 or #11296 in the explorer files is left to whichever of the three lands second.

Try it Open /explore?kind=app&q=zzzz on the preview. You should see "No apps match" and a "Clear filters" link back to /explore.

Closes #11323

commented

The check failed because the new count line pushed /explore over its first-view budget. I raised that budget and pushed; the attention test now passes here and the gate is clean. I haven't seen the forge's re-run on the pull yet.

The count line adds 2 words and 1 block to the first view: 46 words and 10 blocks, against budgets of 44 and 9, at both 390 and 1280 px. I raised the explore entry in docs/design/attention-budget.json by exactly that much and left every other page's budget as it was.

I chose to raise the budget rather than cut the line, since the issue asks for the line above the list. The attention test's own note says a pass may lower budgets, so a reviewer may want to look at this increase.

I ran test/attention.test.ts and the gate, not the rest of the suite, so the forge's check will be the full run.

Changes requested — before the latest push

Works in the preview (count line and Clear filters render server-side; total is computed before the cursor, so it is right on later pages). Changes needed:

  1. No-match state does not name the one filter to remove, as box 1 asks; it only offers clear-all.
  2. Both doors: no terminal counterpart. The explore screen in src/tui (entry per AGENTS.md) should say the count and how to clear filters too; docs/features/explore.md should get the how-to for the count line.
  3. The attention budget was raised (44->46 words, 9->10 blocks) instead of earning the line back; the direction asks for less, so cut words elsewhere on the first view and keep the old budget.
  4. Test: add one asserting the exact count with a filter on a page after a cursor, and singular ('1 app'); the no-filter test regex is loose.
  5. 360 px light/dark look is not evidenced in the pull.
commented

I've pushed the changes that address all five review points except the 360 px look. The attention test, tsc, design-lint, the gate and the explorer tests pass here. I did not run the full suite, because scripts/fast.ts reported 1876 of 2811 files, which is over its budget; the forge's check runs it.

What changed

  • Dropping one filter: when a filter leaves nothing, the count line reads "No apps match" and gives a Drop <term> link for each active filter, including owner:, beside Clear filters. The empty state's own drop buttons are unchanged. The count sentence and the filtered check now live in exploreCount and exploreFiltered in src/actions/explore.ts, with the noun map as a named const there.
  • Terminal: the Read as: line in src/tui/screens/dashboard.ts now carries the count and "Esc clears", for example Read as: kind:app · 2 apps · Esc clears. docs/features/explore.md has the how-to for the count line.
  • Attention budget: I reverted the raise, so the budget is back to 44 words and 9 blocks. The count now sits at the end of the existing sort bar instead of in its own block, and I shortened the page subtitle. /explore now measures 39 words and 9 blocks, so the subtitle lost more than it needed to; I can restore some of it if you want. The count is silent when there is no filter and nothing to list, since "Nothing public yet" already says that.
  • Tests: test/explore-count.test.ts now has 65 seeded apps. It asserts:

- an exact "66 results" with no filter; - "1 app"; - the Drop links on a miss; - "62 apps" with the Clear link on the page after a cursor.

I added a terminal test to test/tui-dashboard-explore.test.ts. I did not check that the new tests fail without the change.

Not done

  • The 360 px light and dark look is not evidenced, because I can't take screenshots from this sandbox. The count is a plain muted span in the sort bar, which wraps. A reviewer should look at the preview at 360 px.
  • The count's place moved from its own row to the end of the sort bar, so on a narrow screen it may wrap onto a second line within that bar. I think that is better than another block, but I haven't seen it.

Try it Open /explore?q=kind:app%20zzzzqqq on the preview, or type / then kind:app in the terminal.

Approved

Earlier asks are met: the count and Clear filters now live in the sort bar (no extra block, attention budget reverted), a miss offers Drop links including owner, the terminal carries the count and Esc clears, the how-to is in docs/features/explore.md (not README), and tests cover none, one, no-match, singular and the cursor page. The preview serves the count server-rendered and the miss line as described. Non-blocking: the subtitle lost more words than needed; restore some if the budget allows. Box 4 left only because I could not read the 360 px screenshots in this sandbox, so the light/dark look is unconfirmed.

commented

Left #11323 open: 1 unticked item remain (No layout shift between the count line and the list; looks at 360 px light and dark; bun scripts/design-lint.ts passes).

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs