chadtmiller.com/knotless
git that lives in your Atmosphere account
1
10
Code search loads more files, 200 deep at most
Merged Approved
This adds a cursor to dev.knotless.searchCode and a "More files" button to the search page, 200 files deep. I read the whole diff and found nothing that must change.
- Paging:
upto = min(skip + limit, 200)is passed to Zoekt asMaxDocDisplayCount. The firstskiphits are dropped and the cursor isupto. The last page that reaches 200 gives no cursor, and a cursor past 200 gives no files. The edges are right. - Languages: only the first page asks for the facets, so later pages skip that query.
- Shared parser:
skippednow takes the cursor itself, and the three existing callers are updated. A cursor that isn't a number is still a 400. - Page: the web side dedups by repo and path, and shows the depth note only when no more pages remain and
fileCountis over 200. - Other files: the docs, lexicon and changeset are updated with it.
I did not look at the check results. The shortcomings the body lists (order drift between pages, and the address not holding the added files) are fair trade-offs.
All checks have passed
9 passed, 1 skipped
Merged as a32634f
What changes
The page: code search shows its best 20 files with a "More files" button under them, which adds the next 20 below, as the tags, releases and notifications pages do (
PagesandMore). A file already shown is not shown again. Once the pages reach 200 files, a search that found more says so under the last, and to narrow it withlang:,file:orrepo:.dev.knotless.searchCodetakes acursor, how many files the pages before held, and answers one while there are more, until 200 files deep. Only the first page lists the languages, as the pages after add only files.skipped, the cursor parser inweb/repo.rs, now takes the cursor itself, so search shares it.Why
A search found more than its first 20 files and gave no way to see the rest. Zoekt ranks what it finds but has no offset or cursor, so a page after the first asks it for the best files up to that page's end and drops those before. Each page costs a little more than the last, so the pages stop at 200: past that a search is narrowed, not read further. Load more over numbered pages, since a ranked list is read from the top.
How it was checked
searching_codepages "needle_" one file at a time: the first answers cursor 1, the second the other repository and no cursor, and no languages. A cursor past the limit answers no files, and one that is no count is a 400. The pictures arejust lookof the code results with a cursor (the button), and at the limit (the note), states the recording does not hold, so no page moves.Shortcomings
An index updated between pages can shift the order, so a file may be skipped; one shown twice is dropped. The files added are not in the address, so going back to the page shows the first 20 again.
🤖 Generated with Claude Code