chadtmiller.com/knotless
git that lives in your Atmosphere account
Search finds code, with a filter down the side
MergedThis adds a "Filter by" side (Code and Repositories) to /search. It adds a CodeResults box per file, lang: narrowing from the languages of the files found, and repo:owner/name parsing. It adds a "code containing …" row to the palette, scoped to the repository on its pages. It also exposes commit on searchCode so line links point at the searched commit.
I read the web changes (+page.ts, +page.svelte, CodeResults.svelte, SearchPalette.svelte, app.css) and web/search.rs. I found nothing that must change:
- The
repo:→at://…/dev.knotless.repo/<name>conversion matches whatrepo::foundaccepts. - The byte-range marking in
pieceshandles overlaps and non-ASCII text. - The palette's index arithmetic for the new row is consistent in the scoped and unscoped cases.
- A 501 or a Zoekt parse error is shown on the page rather than failing it.
I did not read code.rs, index.rs, lib.rs, the tests, the docs or the workflow/Docker files. They belong to the base code-search pull (3mzfcggqsmjuj), which this branch includes, so it should be reviewed there.
At the time of review only web had passed. check, test, shots, lexicons, docs and e2e were still queued or running, so they are not covered here.
The one new commit (4b5b47f) answers a repo: that names no repository with its own message, instead of blaming the query. +page.ts now returns kind: 'missing' for a 404 when repo: was given. +page.svelte renders it with a link that drops the repo: term and searches everywhere.
I found nothing that must change:
searchCodecallsrepo::foundforrepo, which is where an unknown repository fails. I did not confirm that the 404 comes from there. If it comes back as another status, the page shows the generic "can't be read" message, which is the old behaviour.- The link strips
repo:with a regex that matches the one in+page.tsapart from its trailing lookahead. Where the two differ, the link just leaves a malformedrepo:term in the query.
My earlier approve stands. At this head, check is still queued and test is running, so neither is covered here.
There are two new commits since my last review. d606011 makes the page say which repository a code search is kept to, with a "Search all of knotless" link. The second is a merge of main, which now holds the base code-search pull. After the merge, the diff is the web work plus commit on searchCode: the Hit and ZFile fields, FileView, the lexicon, docs/reference/api.md, docs/guide/server.md, and a test assertion.
I found nothing that must change.
commitcomes from Zoekt'sversion, which defaults to empty.FileViewomits it when empty andCodeResultsfalls back toHEAD, so older shards still link.- The
searching_codetest comparescommittorev-parse HEADof the mirror, which matches what the indexer reads. - The "within" and "everywhere" links on the page use the same
repo:regex as+page.ts. Theeverywherestrip regex has no trailing lookahead, which is the difference I noted before. It only matters for a malformedrepo:term. - The palette's row index (
hrefs.length - (everywhere ? 2 : 1)) matches wherecodesits inhrefs.
I did not confirm that searchCode answers 404 for an unknown repo. If it doesn't, the page shows the generic "can't be read" message instead of the new one.
At this head check and docs are running, and web, test, shots, lexicons and e2e are queued, so none of them is covered here.
9 passed, 1 skipped
What changes
Code on the results page.
/searchhas a "Filter by" side with Code and Repositories, laid out as settings' sections are, and a row of tabs on a phone. Code shows each file found in a box: the repository and path over the lines around each match, with matches marked. Each line number links to that line of the file at the commit that was searched. Under Code, the side also lists the languages of the files found, each narrowing the search withlang:.repo:owner/namein the query searches one repository: the count line then says which, with a link to search all of knotless, and arepo:naming no repository says so rather than blaming the query. Empty, off, and unreadable searches each say so in the list's box, as does arepo:naming no repository.In the palette. With text typed, a "code containing …" row searches code everywhere. On a repository's pages it searches that repository's code instead.
commitinsearchCode. Each file now carries the commit its default branch was indexed at, so its links show the lines that were searched even after the branch moves.It builds on knotless-serve's code search, knotless-serve searches public repositories' code with Zoekt.
A retry for Go's download. The test check's Zoekt step retries go.dev, whose 503 failed one run of this pull.
Why
This is the search page from the design: GitHub's layout, a type picked down the side, over our own
searchCode.How it was checked
Drawn with
just lookfrom answers given by hand, on desktop light and phone dark: results of every kind (a long repository name and path, two runs of lines in one file, a file found by its path alone, non-ASCII text), no results, arepo:naming no repository, and the palette with text typed. Pictures attached. An agent that had not seen the code critiqued them. Long paths now break at slashes, and a match on the path alone now says so. The serve test asserts the newcommit. svelte-check, layers and contrast pass.Shots-moved: search
Shortcomings
🤖 Generated with Claude Code