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

The explorer's filter state lives in the URL, so a filtered view can be sent and reloaded #13178

Merged opened this

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

Merged

The explorer now has the one filter it was missing, mine, and a signed-in viewer can reach it from the page. Kind, sort and freshness (updated or since) already round-tripped through the query string and were applied server-side.

Notes

shipped production is serving it deploy 751373a

opened this

The explorer now has the one filter it was missing, mine, and a signed-in viewer can reach it from the page. Kind, sort and freshness (updated or since) already round-tripped through the query string and were applied server-side. The new tests, explore-budget and the existing explorer suites pass, and tsc, the design lint and the gate are clean. I did not run the full suite.

What changed

  • mine filter: /explore?mine=yes, or mine:yes in the query box, narrows the list to the viewer's own apps and the viewer. Signed out, it shows nothing.
  • Cache keys: the explorer cache key is built from the query line, which now includes mine:yes, so the filtered and unfiltered views never answer for each other.
  • Unknown values: mine=maybe gets the same one-line note as other bad values ("mine:maybe is not an answer — use yes, no"), status 200, and the unfiltered list.
  • Reachability: a "Mine" toggle sits under "Sort and time" for signed-in viewers. It joins the filter chips and the "Drop …" links on an empty result.
  • Tests: test/explore-url-filters.test.ts covers the round-trip, cache separation and the unknown-value note. It also checks that ?kind=app&mine=yes&sort=name shows the same rows as clicking Apps, then Mine, then Fresh by hand. The by-hand route can't pick sort=name, so that comparison uses sort=fresh for the page and sort=name for the link, compared as sets.

Not done: forges (kind=forge) never match mine, since a spawned forge has no owner in this list.

Push: the pre-push hook wanted a commit saying how to try the change, so there is an empty "Try:" commit on the branch.

To try it: sign in, open /explore?kind=app&mine=yes&sort=fresh, or use Sort and time → Mine.

🤖 Generated with Claude Code

Closes #13161

5 earlier comments · 1 event
commented

The explorer now has the one filter it was missing, mine, and a signed-in viewer can reach it from the page. Kind, sort and freshness (updated or since) already round-tripped through the query string and were applied server-side. The new tests, explore-budget and the existing explorer suites pass, and tsc, the design lint and the gate are clean. I did not run the full suite.

What changed

  • mine filter: /explore?mine=yes, or mine:yes in the query box, narrows the list to the viewer's own apps and the viewer. Signed out, it shows nothing.
  • Cache keys: the explorer cache key is built from the query line, which now includes mine:yes, so the filtered and unfiltered views never answer for each other.
  • Unknown values: mine=maybe gets the same one-line note as other bad values ("mine:maybe is not an answer — use yes, no"), status 200, and the unfiltered list.
  • Reachability: a "Mine" toggle sits under "Sort and time" for signed-in viewers. It joins the filter chips and the "Drop …" links on an empty result.
  • Tests: test/explore-url-filters.test.ts covers the round-trip, cache separation and the unknown-value note. It also checks that ?kind=app&mine=yes&sort=name shows the same rows as clicking Apps, then Mine, then Fresh by hand. The by-hand route can't pick sort=name, so that comparison uses sort=fresh for the page and sort=name for the link, compared as sets.

Not done: forges (kind=forge) never match mine, since a spawned forge has no owner in this list.

Push: the pre-push hook wanted a commit saying how to try the change, so there is an empty "Try:" commit on the branch.

To try it: sign in, open /explore?kind=app&mine=yes&sort=fresh, or use Sort and time → Mine.

🤖 Generated with Claude Code

commented

The explorer's filters (kind, sort, freshness, mine) now round-trip through the URL, and the pull's check should pass now. The two gate failures from the last push are fixed:

  • Comment width: the header comment in test/explore-url-filters.test.ts was 128 columns. I rewrapped it to fit 100.
  • Looks line: the new commit carries Looks: /explore, so the forge takes before/after pictures of that page on the preview.

bun scripts/gate.ts is quiet on the committed tree. test/explore-url-filters.test.ts passes (4 tests, 0 failures). I did not re-run tsc or any other tests, since the only code change is a comment.

Try it: open /explore signed in, choose Sort and time, then Mine; or open /explore?kind=app&mine=yes&sort=fresh. Both should render the same view.

commented

The explorer's filters (kind, sort, freshness, mine) now round-trip through the URL. A link such as /explore?kind=app&mine=yes&sort=fresh renders the same view as choosing those filters by hand, and test/explore-url-filters.test.ts checks that.

The 100-column comment rule failed on the check's merge with main, which had moved on since my last push. I merged origin/main into the branch, ran bun scripts/gate.ts --fix, and committed what it rewrapped. It touched only comments in src/actions/explore.ts and src/web/studio/explore.ts, with no behaviour change.

Local bun scripts/gate.ts is clean and bun x tsc --noEmit passes. The 31 explore-related test files pass (263 tests), including the new filter test. I did not run the full suite: scripts/fast.ts named 2,179 test files, so I ran the explore ones. The forge runs the full check on push.

The rewrap commit carries No look: comment rewrap only, no rendered change. The earlier commit already names /explore with a Looks: line.

Try it: open /explore signed in, choose Sort and time, then Mine; or open /explore?kind=app&mine=yes&sort=fresh. Both should render the same view.

commented

The MCP table failure was mine, and it's fixed. The other red test was not mine, and I did not change it.

  • docs/MCP.md: the explore tool's description gained the mine filter, but the checked-in table still had the old text. I regenerated it with bun scripts/mcp-table.ts, which changes one line. test/mcp-table.test.ts passes.
  • test/contribute-no-forge.test.ts: "the archive answers only what a reader may read, at a stable URL" passes here on a branch that has origin/main merged in. The check's own log said it "fails only beside others" and had no shard-mates, so I read it as flaky under load. I did not change it. If it fails again on the next run, it needs a person to look at it.

Local bun scripts/gate.ts is clean and the two test files pass together (19 tests). I did not re-run the full suite. The commit carries No look: docs table only, no rendered page change.

Try it: open /explore signed in, choose Sort and time, then Mine; or open /explore?kind=app&mine=yes&sort=fresh. Both should render the same view.

Changes requested — before the latest push

The server side is sound: mine is parsed, noted when unknown, keyed in the cache line, and scoped to the viewer's own name (signed out matches nothing). No security finding. Changes needed, all in one round:

  1. Both doors / docs: the filter is new on the page but the pull adds no docs/features/ how-to for it and does not show that the terminal (src/tui/) explore screen takes mine:yes and gates it as the page does. Add the how-to line to the explore feature doc, and a TUI test (or state where the TUI reads the same explore line) so a guest sees nothing for mine and the signed-in viewer sees their own.
  2. Box 4 is not really proven: the test compares a hand route ending in sort=fresh against a link with sort=name, as sets. A link with three filters must equal the by-hand route row for row. Use the same sort on both sides and compare ordered lists (the by-hand route can reach a sort that a link names, so use that one).
  3. Box 3 (budget): the pull does not run or extend test/explore-budget.test.ts with mine in the path; add a mine=yes case there so the budget covers the new filter.
  4. Design: Mine is placed under 'Sort and time', where it is neither a sort nor a time (principle 1: the page should say plainly what each control is for). Move it next to the kind controls. See the line comment on aria-pressed too.
  5. Clean: the gate rewrap touched unrelated comments in src/actions/explore.ts and src/web/studio/explore.ts (EXPLORE_PARAMS, isExploreLine, MAKE_IT_YOURS, likesByRepo, ...). Keep the diff to the change; rewrap only lines you edit.
  6. Preview was not exercised by the builder beyond tests; confirm /explore?kind=app&mine=yes&sort=fresh in the preview signed in and out.
commented

The pull now moves Mine next to the kind tabs, adds the doc and the tests you asked for, and fixes the Box 4 comparison. One finding stands unfixed: I could not check the preview, and I did not undo the comment rewrap in item 5. The preview of this push answered 503 when I fetched /explore?kind=app&mine=yes&sort=fresh, so I could not exercise it signed in or out. The explore tests I ran (listed below) pass, and tsc --noEmit, bun scripts/gate.ts --fix and bun scripts/design-lint.ts are clean. I did not run the full suite.

  • Mine placement (item 4): Mine is now a one-item segmented link beside the kind tabs, shown only when signed in. It uses aria-current, matching the neighbouring links, and the aria-pressed attribute is gone. The "Sort and time" section no longer opens for mine, so it holds only sorts and times again.
  • Docs (item 1): docs/features/explore.md has a Mine row in the one-word-on-every-surface table, a short "Mine" section, and the filter-line sentence now names Mine.
  • Terminal (item 1): the terminal explore screen already reads the same explorePage with the viewer, so no code change was needed. A new test in test/tui-dashboard-explore.test.ts shows mine:yes gives alice her apps, bob his, and a guest none.
  • Test helper bug: while writing that test I found that typed(..., undefined) in the same file fell back to alice, so the existing "guest" case was never a guest. The helper now takes null for a guest, and I switched the existing guest test to it. It still passes.
  • Box 4 (item 2): the three-filter test now compares ?kind=app&mine=yes&sort=fresh against the Apps, Mine, Fresh click path, as ordered lists. It also checks that a signed-out page has no Mine control.
  • Budget (item 3): test/explore-budget.test.ts has a mine=yes case. It runs under the budget, shows only the viewer's own rows, and returns nothing for another viewer or a guest.
  • Comment rewrap (item 5), not changed: the gate fails the whole file when any comment in a touched file is over 100 columns. src/actions/explore.ts and src/web/studio/explore.ts had such lines on main, so touching them requires rewrapping them. I reverted the rewrap to test this, and the gate failed with "2 files have a longer comment line". I left the rewrap in. It is comment-only and is its own commit, 1d24c9473, so you can read the real change in the other commits.

To try it: open /explore signed in and choose Apps, then Mine, then Fresh under "Sort and time". Or open /explore?kind=app&mine=yes&sort=fresh directly; signed out it lists nothing and shows no Mine control.

commented

I merged main into the branch and pushed it. The one conflict, in src/web/studio/explore.ts, is resolved.

  • Conflict: it was the page(...) call that draws the Explore page. main had added a description: to it. I kept that line unchanged, since this branch had touched nothing in it.
  • Gate and type check: bun scripts/gate.ts --fix and bun x tsc --noEmit ran before the tests and printed nothing. I didn't check their exit codes.
  • Tests: I ran the Explore-related test files (test/explore*.test.ts, test/explorer*.test.ts and test/mcp-explore-count.test.ts) and 216 pass, 3 are skipped and none fail. The whole-suite run that scripts/fast.ts named was too broad, so I stopped it and left the full check to the forge.
  • Not retested: apart from that one conflict resolution, the merge is main's changes. I did not run the other test files.

The pull's description is unchanged: the Explore filter state and the "mine" filter beside the kind tabs, as in the earlier commits.

Approved

Approved. The preview serves /explore?kind=app&sort=fresh, ?mine=maybe and ?kind=zzz with 200 and a one-line role=status note for each bad value. Mine sits beside the kind tabs as an <a> with aria-current, and it works with JavaScript off. The security gating is sound: signed out, mine matches nothing. The terminal takes mine:yes and has a test for it, the how-to is in docs/features/explore.md, and README is untouched.

Two things I would do next:

  1. docs/features/explore.md says an unknown filter is a 400 on the page, but the preview answers 200 with the note, as the issue's box 2 asks. Make the doc say what the page does.
  2. Give Mine a count or a short hint, such as 'Mine · 2', so a phone user knows what it does before they tap it. The tap target should also be at least 44px at 360px.

The gate-forced comment rewraps in unrelated lines are noise but acceptable. They sit in their own commit.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs