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

/explore filters by kind (apps, forges, people) with a ?kind= parameter and chips, and the MCP explore tool takes the same `kind` #15673

Merged opened this

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

Merged

/explore?kind= already worked when I started. The one thing missing was the 400, and that is what this pull adds. A bad kind on the page used to redirect (303) with a note; it now answers 400 with kind is not a kind — use app, person, forge, and the unfiltered list is shown under that message.

Notes

shipped production is serving it deploy 3fede26

opened this

/explore?kind= already worked when I started. The one thing missing was the 400, and that is what this pull adds. A bad kind on the page used to redirect (303) with a note; it now answers 400 with kind is not a kind — use app, person, forge, and the unfiltered list is shown under that message.

I ran bun x tsc --noEmit, bun scripts/gate.ts --fix, bun scripts/design-lint.ts and test/explore-kind.test.ts, test/explore-url.test.ts, test/mcp-size.test.ts. All passed. I also ran test/explore-url-filters.test.ts, test/explore-unknown-params.test.ts and test/explore-unknown-words.test.ts, which passed before the final test-file edits; I did not re-run those three afterwards, so the forge's check will be their first run on the pushed state. The change is in src/web/studio/explore.ts.

  • Filtering: kind=app|person|forge (and all) already narrowed the list. Forge rows are visible to site admins only, as before.
  • Chips: the "Kind" tabs (All, Apps, People, plus Forges for admins) are plain links, with the current one marked aria-current.
  • MCP: the existing explore tool already takes kind, as an argument or typed as kind: in q. A bad value is an unknown_filter error with the same words. No new tool, and I did not touch the size ceilings.
  • Tests: the new test/explore-kind.test.ts covers the filter, the 400, the chips and the tool. I changed three older tests that expected a 303 or 200 for ?kind=bogus: explore-url.test.ts, explore-url-filters.test.ts and explore-unknown-params.test.ts. They tested the old behaviour, not a bug.

What I left out: a bad kind: typed inside q on the page still gets the 303 with a note, because the issue only asks for the parameter. Other bad parameters (sort, updated, since) are unchanged.

To try it, open /explore?kind=bogus for the 400, then use the Apps and People tabs on /explore.

The pre-push hook refused the push until a commit message carried a Try: line, so the commit has one.

Closes #15653

5 earlier comments · 1 event
commented

/explore?kind= already worked when I started. The one thing missing was the 400, and that is what this pull adds. A bad kind on the page used to redirect (303) with a note; it now answers 400 with kind is not a kind — use app, person, forge, and the unfiltered list is shown under that message.

I ran bun x tsc --noEmit, bun scripts/gate.ts --fix, bun scripts/design-lint.ts and test/explore-kind.test.ts, test/explore-url.test.ts, test/mcp-size.test.ts. All passed. I also ran test/explore-url-filters.test.ts, test/explore-unknown-params.test.ts and test/explore-unknown-words.test.ts, which passed before the final test-file edits; I did not re-run those three afterwards, so the forge's check will be their first run on the pushed state. The change is in src/web/studio/explore.ts.

  • Filtering: kind=app|person|forge (and all) already narrowed the list. Forge rows are visible to site admins only, as before.
  • Chips: the "Kind" tabs (All, Apps, People, plus Forges for admins) are plain links, with the current one marked aria-current.
  • MCP: the existing explore tool already takes kind, as an argument or typed as kind: in q. A bad value is an unknown_filter error with the same words. No new tool, and I did not touch the size ceilings.
  • Tests: the new test/explore-kind.test.ts covers the filter, the 400, the chips and the tool. I changed three older tests that expected a 303 or 200 for ?kind=bogus: explore-url.test.ts, explore-url-filters.test.ts and explore-unknown-params.test.ts. They tested the old behaviour, not a bug.

What I left out: a bad kind: typed inside q on the page still gets the 303 with a note, because the issue only asks for the parameter. Other bad parameters (sort, updated, since) are unchanged.

To try it, open /explore?kind=bogus for the 400, then use the Apps and People tabs on /explore.

The pre-push hook refused the push until a commit message carried a Try: line, so the commit has one.

commented

<!-- look-pages 60d9d224350b --> Look pages for 60d9d22, from the gate:

  • look pages (inferred): this pull changes src/web/studio/explore.ts; the forge pictures /explore (src/web/studio/explore.ts), the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
commented

The look-pages comment asked for no code change, so I made none. I pushed an empty commit with a Looks: /explore line to confirm the page the forge inferred. I didn't re-run the tests or the type check for it.

/explore is the right page to picture. It now filters by ?kind= and shows the chips, and src/web/studio/explore.ts is the only page code this pull touches.

The MCP explore tool takes the same kind. A bad ?kind= still gets a 400 that names the valid kinds. Both are covered by tests.

[
  {"go": "/explore", "look": "chips for all, apps, forges and people", "expect": "all is selected and the list is unfiltered"},
  {"go": "/explore?kind=apps", "look": "the list and the chips", "expect": "only apps are listed and the apps chip is selected"},
  {"go": "/explore?kind=nope", "look": "the response", "expect": "a 400 that names the valid kinds"}
]

🤖 Generated with Claude Code

Changes requested — before the latest push

Works in the preview: /explore?kind=bogus answers 400 with 'kind is not a kind — use app, person, forge' over the unfiltered list; the kind tabs are plain links; the MCP tool takes kind. One thing to fix: docs/features/explore.md now says the opposite of the code. Line 68 says a bad kind parameter on the page answers 303 and line 74 lists 'kind' among the 303-dropped words. Change both to say a bad kind is a 400 on the page with the sentence over the unfiltered list (still 422 from the API), and that a bad kind: typed in q still takes the 303. Also add a test for kind=forge (admin sees forge rows, guest does not), since the 400 message names it. Note that the chip, filter and MCP tests pass without this change because those parts already existed; only the 400 is new and it is tested.

commented

I fixed both doc lines and added the kind=forge test, then pushed. The new test and the other four in test/explore-kind.test.ts pass, and tsc is clean. I did not run the rest of the suite; the forge runs the full check on push.

bun scripts/gate.ts --fix printed three "one implementation?" notices for the small helpers in test/explore-kind.test.ts (get, call, seen). I read them as advisory and did not act on them, so I pushed anyway; say if you want them pulled into a shared helper.

  • Docs: docs/features/explore.md now says a bad kind parameter on the page is a 400 with kind is not a kind — use app, person, forge over the unfiltered list, with no redirect. The API still answers 422. A bad kind: typed in q still takes the 303. I also changed "unknown sort, kind" to "kind in q" in the sentence listing what is dropped with a 303.
  • Test: kind=forge shows a seeded forge row to the admin, and neither a signed-in non-admin nor a guest sees it.
[
  {"go": "/explore?kind=forge", "look": "signed in as admin, then as a non-admin", "expect": "the admin sees forge rows; the non-admin sees none"},
  {"go": "/explore?kind=bogus", "look": "status and message", "expect": "400, and the message says kind is not a kind — use app, person, forge"}
]

🤖 Generated with Claude Code

commented

<!-- look-pages b21a6686d540 --> Look pages for b21a668, from the gate:

  • look pages (named): this pull changes src/web/studio/explore.ts; a commit names /explore
commented

This feedback is the gate's note that it will picture /explore because a commit names it. It asks for no change, so I made none and pushed nothing.

The page change is the same as before: ?kind= filters and shows the chips on /explore. A bad kind is a 400 that names the valid kinds. The docs and the kind=forge test were updated in the last push.

[
  {"go": "/explore?kind=app", "look": "the chips and the list", "expect": "only apps are listed and the apps chip is marked current"},
  {"go": "/explore?kind=bogus", "look": "status and message", "expect": "400 with the sentence naming app, person and forge over the unfiltered list"}
]

🤖 Generated with Claude Code

Approved

Works in the preview: /explore?kind=bogus answers 400 with "kind is not a kind — use app, person, forge" over the unfiltered list, and /explore?kind=app marks the Apps chip aria-current. Chips are plain links, the docs are corrected, and the kind=forge test now covers admin vs guest. Small, single-purpose, and it keeps the page working with JavaScript off. Next two things I would do: (1) Non-blocking: make a bad kind: typed in q answer 400 too, so the two doors agree; (2) Non-blocking: fold the get/call helpers in test/explore-kind.test.ts into a shared helper.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs