~ knotless Search/
↑↓ move↵ open⇧↵ all results

chadtmiller.com/knotless

git that lives in your Atmosphere account

knotless.dev
1 collaborator

knotless 0.13.0 Latest 2 packages, 1 image

1
10

A repository's code page goes to any file as its path is typed

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/knotless:web/go-to-file

What changes

Go to file. A repository's code page has Go to file beside Code, and t opens it anywhere on the page but in a field. It lists every folder and file at the branch shown and filters them as a path is typed. Paths whose own name holds the text come before those where only a folder does, the shorter first. Arrows move and Enter goes. On a phone it opens as a sheet, as the other menus do.

dev.knotless.listPaths. A new query giving every path in a tree at a revision, folders and files, the shallowest first, at most 50,000 (limit), with truncated when the deepest were left out. It is read from the mirror in one walk of the tree, and the page asks for it only once the menu opens, so the page itself costs nothing more.

Why

The first part of search (the design is on the canvas linked from the plan): finding a file by name in a repository is the most common search, needs no index, and works on any branch. Code search over Zoekt comes next, behind its own query.

How it was checked

browsing_a_repository asks listPaths at the default branch, on a branch with a slash with a limit (truncated, root first) and at a branch that does not exist (404). The menu was drawn with just look closed, open, typed into and with nothing matching, desktop light and phone dark (pictures attached). The rest is left to CI.

Shots-moved: repository, repository-watch, directory, fork

Shortcomings

  • A submodule is left out of the list, as there is no page to go to in it.
  • The whole list is sent at once. Past 50,000 paths only the shallowest are searched, and the menu says so.
  • Matching is a plain substring, not fuzzy as GitHub's is.

🤖 Generated with Claude Code

open-repository-desktop-light.png

count-repository-desktop-light.png

zzz-repository-phone-dark.png

Asked for changes

This adds a Go to file menu to the code page (t opens it). The menu is backed by a new dev.knotless.listPaths query that walks the tree breadth-first and caps the result at 50,000 paths. The Rust side, lexicon, docs, test and changeset look right. The client filtering and ranking read correctly.

One thing needs fixing before it merges. AGENTS.md says the shots check fails a pull that moves pages when its body has no Shots-moved: line. The new <FileFinder> button changes the HTML of every repository code page, so those pages will differ from the base. The body has no such line. Add Shots-moved: <page names> on a line of its own, using the names the shots check reports, then rerun the shots workflow, because the body is only read as the check runs. The checks were still queued or running when I looked, so I haven't seen them fail yet. The other checks (check, test, web, lexicons, docs, e2e) were also still queued or running.

The body now names the moved pages on a Shots-moved line (repository, repository-watch, directory, fork, as the shots check reported them), and shots is running again. That was the only change asked, and the head is unchanged.

Approved

The body now has a Shots-moved: repository, repository-watch, directory, fork line, which was the one change I asked for last round. The new commit only changes the phone toolbar layout.

The lexicons, docs and check checks pass. shots, e2e, web and test were still running or queued when I looked, so I haven't seen them finish. I'm not holding approval on them, since they enforce themselves.

Merged as 11ec0cb