chadtmiller.com/knotless
git that lives in your Atmosphere account
⌘K on a repository's pages jumps around that repository
MergedThis pull adds a repository-scoped ⌘K palette: a list of the repository's pages, open pulls and issues searched through listItems, and Backspace on an empty field to widen to all of knotless. It also adds just look --press and a docs paragraph. The listItems parameters match the lexicon (q, kind, limit), and the page.data.repo.owner.did used for the Settings row is on every repo page's data. The docs are updated, and no change file is needed because only the web changes.
One bug to fix. Backspace clears scope but leaves items as they were. After typing and then deleting back to empty, items still holds the last results until the debounced look (120 ms) returns. A held Backspace repeats faster than that, so the next press can clear the scope while items is non-empty. The hrefs derived then evaluates scope!.authority on null and throws during render. Clear items when the scope is dropped.
web/src/lib/organisms/SearchPalette.svelteline 144Outdated
go(e.shiftKey ? all : hrefs[at]); | |
} else if (e.key === 'Backspace' && scope && !input.value) { | |
e.preventDefault(); | |
scope = null; |
items is not cleared here, so hrefs runs scope!.authority on null while stale items remain (type, delete, then hold Backspace within 120 ms). Set items = [] together with scope = null.
Fixed in 587f67bbbd7f. Backspace clears the items along with the scope, and hrefs builds item links only while there is a scope, so stale items can't reach scope! either way.
This pull adds a repository-scoped ⌘K palette and a --press option for just look, and updates the docs. The bug from my earlier review is fixed: Backspace now clears items as it drops scope (SearchPalette.svelte, the Backspace branch). The hrefs derived also guards its scope! access behind scope ?, so a stale response arriving after the scope is dropped cannot throw. I found nothing else that must change.
8 passed, 2 skipped
What changes
⌘K on a repository's pages opens the palette on that repository. The field shows
owner / name /before it. With nothing typed, it lists the repository's pages: Code, Issues, Pulls, Commits, Branches, Tags, Releases, Checks, Merge queue, and Settings for its owner. Typing narrows the pages by name and shows its open pulls and issues that match, four of each, then a row searching all of knotless for the same words. Backspace with nothing typed drops the repository, leaving the palette as it is everywhere else./and the header's search always open that one, as before. On a phone the scope shows only the repository's name.just look --press <key>presses a key in turn with the clicks, as Playwright names it (Meta+k), so a state a key opens can be drawn.Why
Moving between a repository's tabs, or to one of its pulls, took going back to its header. GitHub's ⌘K does this within a repository, and
/stays the search of everything.How it was checked
just look /alice.test/tally --signed-in --press Meta+k, with and without--type 'dialog input=i', desktop light and phone dark (attached). The same page as bob.test with--press /still opens the global palette, with no Settings anywhere. svelte-check passes. The palette is closed in every page the shots check draws, so no page should move.Shortcomings
Only open pulls and issues are searched:
listItemstakes one state per call, and closed ones would double the requests per keystroke. A phone has no ⌘K, so a touch screen cannot reach the repository's palette yet.🤖 Generated with Claude Code