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

Contraction: fold the no-JS search page into the search route #432

Merged opened this

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

Merged

I merged the studio search into the single `/search` page (`src/web/pages/search.ts`) and deleted `src/web/studio/search.ts`. Search code drops from 807 to 702 lines (−105); the whole diff is +288 / −345 including docs and tests. The full `forge.json` check passes (578 tests), and so do `test/web-ui.test.ts`, `test/web-code.test.ts` and `test/search.test.ts`.

shipped production is serving it deploy 4345bb2

opened this

I merged the studio search into the single /search page (src/web/pages/search.ts) and deleted src/web/studio/search.ts. Search code drops from 807 to 702 lines (−105); the whole diff is +288 / −345 including docs and tests. The full forge.json check passes (578 tests), and so do test/web-ui.test.ts, test/web-code.test.ts and test/search.test.ts.

What changed

  • One renderer for both faces. Studio mode and dev mode now share one page, built on the same search() action the API and the command palette use. It works without JavaScript. The two faces differ only in their words: "Apps" / "Tells and changes" in the studio, "Repositories" / "Issues and pull requests" / "Code" in dev.
  • The studio now finds every repository the viewer can see (the rule carried over from #241), not just apps. Before, a repository the person owned came back as "Nothing matched". Apps still show whether they are live. Tells and changes on an app link to /tells/N and /changes/N; on any other repository they link to dev's /issues/N and /pulls/N. Which hits are apps is worked out with one lookup for the whole page, not one per row.
  • Code search stays in dev. The studio face doesn't search code (so no git grep on every studio search). Instead it shows a Search the code link to /search?…&kind=code&mode=dev. A hand-typed kind=code in studio mode shows all results rather than an error.
  • ?mode=dev now sticks. It is kept on the kind chips, the live toggle, the "show only" links and as a hidden field in the form, so dev mode survives a re-search. Before, submitting the form dropped it.
  • Docs. docs/STUDIO.md now describes the one route. docs/DESIGN.md only mentions /search, which survives, so it is unchanged.

What I chose not to do

  • No redirect. Both old pages were already served at /search, picked by the mode cookie or ?mode=dev, so there was no second URL to redirect from. Both old addresses now answer the merged page:

- /search in studio mode: the existing tests in "finding things in the studio" plus the new ones. - /search?mode=dev: the existing "?mode=dev on the same route still answers in dev's own words" test plus the new one.

  • Search terms are no longer highlighted in titles or descriptions. The old studio page marked matches in result titles and descriptions; the merged page marks them only in code lines, as dev's page did.
  • No test assertions changed. I only rewrote a stale comment in test/web-ui.test.ts that pointed at the removed studioSearchPage. The release workflow and chart are untouched.

New tests (in test/studio.test.ts; both fail on the old code)

  • A private repository that isn't an app is found by its name and by its description, and so is a tell on it, linked at its /issues/N address. A signed-out reader doesn't see it.
  • The studio face has no code section but links to dev's code search; dev's face has the code section and keeps mode=dev on its links and form.

To try it: sign in, create a plain repository (not an app), and search a word from its name in studio mode. It now appears under "Apps", where it used to say "Nothing matched". Then follow Search the code.

🤖 Generated with Claude Code

Closes #397

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs