The /search page keeps to the repository repo:owner/name names in q, as /api/v1/search and the MCP tool do
Live: /search?q=repo%3Atrevato%2Fforge+Modrinth says "Nothing matches" though #17865/#17867 are titled Modrinth. #17906 fixed the API; src/web/pages/search.ts still searches the literal "repo:…" text over the first 50 visible repos.
Patch, src/web/pages/search.ts only:
core/search.ts import: add repoQualifier,. core/repos.ts import: add canRead and type Repo.
interface Asked, after query:
/** What is searched for: `query` less its `repo:owner/name`, which is the scope (#16463). */readonly words:string;
Above find:
/** The repository `repo:` names if the viewer may read it; undefined alike for malformed, missing or unreadable, so a private one is never told. */functionreadableRepo(ctx:Ctx, named:string):Repo|undefined{const[owner, name,...rest]= named.split("/");if(!owner ||!name || rest.length>0)returnundefined;const repo =getRepo(ctx.app.db, owner, name);return repo !==undefined&&canRead(ctx.app.db, repo, ctx.auth.user)? repo :undefined;}
find(ctx, a, only: Repo | undefined): greppable(a.query) -> greppable(a.words); search input q: a.words, plus ...(only === undefined ? {} : { repo: only }),.
searchPage:
const typed =cleanQuery(cappedQuery(params.get("q")));// `repo:owner/name` keeps the search to that repository, as on the API and the MCP tool (#16463).const qualified =repoQualifier(typed);const a:Asked={
query: typed,
words: qualified.q,
(rest unchanged). After the if (a.query === "") branch:
const named = qualified.repo;const only = named ===undefined?undefined:readableRepo(ctx, named);if(named !==undefined&& only ===undefined){const rendering = performance.now();const none =page({
ctx,
title:`Search · ${echoed(a.query)}`,
styleCss:SEARCH_CSS,
body: html`<div data-search>${pageHead(html`Results for “${echoed(a.query)}”`)} ${form}${trimmed} <p class="muted" role="status" data-repo-unknown>No repository you can read is called “${echoed(named)}”; repo: takes owner/name.</p> </div>`,});notePhase(ctx.request,"render", performance.now()- rendering);return none;}
then find(ctx, a) -> find(ctx, a, only); codeHitRow(hit, a.query), !greppable(a.query) and guideTitleMatches(a.query, …) take a.words. Links, form value and title keep a.query, so chips stay scoped.
Test, test/mcp-search.test.ts, in describe("MCP search") after "/api/v1/search takes the same scope…" (reuses pebble, secretpebble, noisy):
test("/search, the page, keeps to the repository repo: names in q; an unreadable one reads as a missing one",async()=>{const page =async(q:string)=>(awaitfetch(`${servers.url}/search?${new URLSearchParams({ q, kind: "issues" })}`)).text();expect(awaitpage("glow")).not.toContain("alice/pebble #");const scoped =awaitpage("glow repo:alice/pebble");expect(scoped).toContain("alice/pebble #1");expect(scoped).not.toContain("alice/noisy #");expect(awaitpage("REPO:alice/pebble glow")).toContain("alice/pebble #1");const secret =awaitpage("glow repo:alice/secretpebble");expect(secret).not.toContain("secretpebble #");const said =(text:string)=>/<p[^>]*data-repo-unknown[^>]*>([\s\S]*?)<\/p>/.exec(text)?.[1]?.replace(/secretpebble|nothing-here/,"X");expect(said(secret)).toBeDefined();expect(said(secret)).toBe(said(awaitpage("glow repo:alice/nothing-here")));expect(awaitpage("glow repo:pebble")).toContain("data-repo-unknown");});
On main it fails at toContain("alice/pebble #1"). No change to a query without repo:. Not here: the TUI palette's same gap.
The /search page keeps to the repository repo:owner/name names in q, as /api/v1/search and the MCP tool do
Live: /search?q=repo%3Atrevato%2Fforge+Modrinth says "Nothing matches" though #17865/#17867 are titled Modrinth. #17906 fixed the API; src/web/pages/search.ts still searches the literal "repo:…" text over the first 50 visible repos.
Patch, src/web/pages/search.ts only:
repoQualifier,. core/repos.ts import: addcanReadandtype Repo.interface Asked, afterquery:find:find(ctx, a, only: Repo | undefined):greppable(a.query)->greppable(a.words); search inputq: a.words,plus...(only === undefined ? {} : { repo: only }),.searchPage:(rest unchanged). After the
if (a.query === "")branch:then
find(ctx, a)->find(ctx, a, only);codeHitRow(hit, a.query),!greppable(a.query)andguideTitleMatches(a.query, …)takea.words. Links, form value and title keepa.query, so chips stay scoped.Test, test/mcp-search.test.ts, in describe("MCP search") after "/api/v1/search takes the same scope…" (reuses pebble, secretpebble, noisy):
On main it fails at toContain("alice/pebble #1"). No change to a query without repo:. Not here: the TUI palette's same gap.