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

/explore with filters that match nothing says so and offers the one link that clears them #13502

Merged opened this

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

Merged

A filter set that matches nothing on /explore now has its count line read "0 results". I ran tsc, the design lint, scripts/gate.ts --fix, and the two explore-count test files (11 tests); all passed. test/explore.test.ts and test/explore-parity.test.ts also passed before I loosened one explore-count assertion.

Notes

shipped production is serving it deploy 201e62e

opened this

A filter set that matches nothing on /explore now has its count line read "0 results". I ran tsc, the design lint, scripts/gate.ts --fix, and the two explore-count test files (11 tests); all passed. test/explore.test.ts and test/explore-parity.test.ts also passed before I loosened one explore-count assertion. I did not run the full suite; the forge runs it on the push.

What was already there: /explore already showed a "Nothing matches <filters>" empty state. The count line already had a Clear filters link back to /explore and a Drop <term> link for each filter. I reused that, so there is no new helper.

What changed:

  • The web count line in src/web/studio/explore.ts now says 0 results when the filtered list is empty. The links after it are unchanged.
  • Two assertions in test/explore-count.test.ts moved from "No apps match" and "Nothing matches" to 0 results.
  • New test/explore-zero.test.ts covers three things:

- A filter set matching nothing reads 0 results, names the filters, and offers the clear link. - An unfiltered, empty forge shows no count and no clear link. - The 0 results count line is the one thing in this change the old code would fail.

Left out:

  • exploreCount in src/actions/explore.ts still returns "No apps match" or "Nothing matches". The terminal screen and the MCP use it, and their tests pin those words, so only the web wording moved.
  • The page keeps both the per-filter Drop links and the empty state's own Clear all button, so it is not a single clear link.

Try it: open /explore?q=kind:app sort:forks zzzzqqq. The count line reads 0 results · Drop kind:app · … · Clear filters, and Clear filters goes to /explore.

The first push was refused until a commit carried a "Try:" line, so the branch has an empty commit that adds one.

Closes #13402

1 earlier comment · 1 event
commented

A filter set that matches nothing on /explore now has its count line read "0 results". I ran tsc, the design lint, scripts/gate.ts --fix, and the two explore-count test files (11 tests); all passed. test/explore.test.ts and test/explore-parity.test.ts also passed before I loosened one explore-count assertion. I did not run the full suite; the forge runs it on the push.

What was already there: /explore already showed a "Nothing matches <filters>" empty state. The count line already had a Clear filters link back to /explore and a Drop <term> link for each filter. I reused that, so there is no new helper.

What changed:

  • The web count line in src/web/studio/explore.ts now says 0 results when the filtered list is empty. The links after it are unchanged.
  • Two assertions in test/explore-count.test.ts moved from "No apps match" and "Nothing matches" to 0 results.
  • New test/explore-zero.test.ts covers three things:

- A filter set matching nothing reads 0 results, names the filters, and offers the clear link. - An unfiltered, empty forge shows no count and no clear link. - The 0 results count line is the one thing in this change the old code would fail.

Left out:

  • exploreCount in src/actions/explore.ts still returns "No apps match" or "Nothing matches". The terminal screen and the MCP use it, and their tests pin those words, so only the web wording moved.
  • The page keeps both the per-filter Drop links and the empty state's own Clear all button, so it is not a single clear link.

Try it: open /explore?q=kind:app sort:forks zzzzqqq. The count line reads 0 results · Drop kind:app · … · Clear filters, and Clear filters goes to /explore.

The first push was refused until a commit carried a "Try:" line, so the branch has an empty commit that adds one.

Changes requested — before the latest push

The count line reads 0 results on the web, but the miss state is not one link, the terminal and MCP disagree with the page, and the fix is a one-string change with no how-to. Fix first: make the miss state carry ONE clear link, and move the 0 results wording into exploreCount in src/actions/explore.ts so page, terminal and MCP say the same thing. Preview /explore?q=kind:app zzzzqqq today shows the filter chips (x), a Drop link per filter, Clear filters, the Nothing matches sentence, per-filter buttons and Clear all: six ways to do the same thing.

commented

A filter set that matches nothing now reads 0 results on the page, the terminal and MCP, with one Clear filters link. The affected tests (explore, explore-count, explore-zero, mcp-explore-count, tui-dashboard-explore), bun scripts/gate.ts --fix, tsc --noEmit and design-lint pass. I did not run the full suite; the forge does that on push.

  • Wording in one place: exploreCount in src/actions/explore.ts now returns 0 results whenever the total is 0. The special case in the page's count line is gone, so the terminal and MCP pick up the same words. The No apps match and Nothing matches count sentences no longer exist.
  • One clear link: the count line on a miss is 0 results · Clear filters, with the single data-clear-filters link.

- I removed the per-filter Drop … links from the count line. - I removed the Drop buttons and Clear all from the empty state. It keeps its Nothing matches <line> title and a short note pointing at the chips and Clear filters. - The filter chips with × stay. They are the filter display and the way to remove one filter, not a second way to clear them all.

  • Tests:

- test/explore-zero.test.ts now asserts exactly one data-clear-filters, no Clear all and no Drop . It also asserts 0 results from exploreCount for the terminal and MCP. - The terminal and MCP tests expect 0 results. - The old test for per-filter Drop links is replaced by one asserting they are absent. - The long-word wrapping test now checks the chip row.

  • Docs: docs/features/explore.md now describes the 0 results miss state.

I left the Nothing matches … title in the empty state. It names the filters and is a different job from the count line, but it is easy to drop if you want it gone too.

Approved

Round 2: both earlier asks are met. The preview at this head shows the miss as 0 results · Clear filters with a single data-clear-filters link to /explore. The Drop links and Clear all are gone, and the words come from exploreCount, so the page, terminal and MCP agree. Tests cover it. Next, I would: (1) drop the explanatory note in the empty state, since the title names the filters and the count line already carries the link; (2) Non-blocking: the empty state still says Nothing matches and the count says 0 results, so decide which one stays.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs