Skip to content

Browse only searches what you have checked out - #299

Merged
Mpdreamz merged 3 commits into
mainfrom
fix/browse-unscoped
Nov 19, 2026
Merged

Mpdreamz merged 3 commits into
mainfrom
fix/browse-unscoped

Conversation

@Mpdreamz

Copy link
Copy Markdown
Contributor

Why

On a fresh machine Browse's starter queries counted and listed issues from all of GitHub (rail counts like 579.689 and 143.037.165, and a list of issues from repos the user has nothing to do with). The queries carried no org or repo, and nothing was scoped, so the search was unbounded.

What

Browse works inside what is checked out.

  • The universe is the orgs and accounts of the repos in repos (BrowseCheckouts: no network, nothing stored, always live).
  • A query with no place of its own runs inside org: qualifiers for every checked-out org, chunked to 240 characters (at most 6 groups), counts summed, lists merged newest first. The scope chip reads "All checkouts · N orgs".
  • Everything else is refused before anything is sent. BrowseFetch.search and count take a required checkouts: and throw notCheckedOut or unbounded, so no call site can forget. A repo: qualifier is allowed when its org has a checkout. The list shows " isn't checked out. Browse searches orgs and repos you have checked out. Clone it, then it shows up here." with a button that opens Add or clone prefilled; with nothing checked out it says "Check out a repo first".
  • The rail leads with "All checkouts", then the checked-out orgs (most repos first, capped at 6 with "+ N more: ⌘K"). Refused queries show a dash; the local Agent-ready count is a dash until heed has read something. Large counts are compact (1.2K, 579K, 143M).
  • Quiet cleanup: BrowseStore.prune(keepingOrgs:) removes cached items and reads for orgs with no checkout, in 500-row batches at utility priority, shortly after launch and when the checkouts change. It does nothing while the repo list is empty (so it cannot wipe the cache before repos load), never touches saved queries or pinned scopes, and touches browse.sqlite only, never attention.sqlite.
  • A saved query with its own place is not widened or narrowed by the active scope; picking a scope keeps the saved query you are on.

Behaviour changes to know

  • "Assigned to me" now also runs inside the checkouts, so an issue assigned to you in a repo you have not cloned does not show in Browse (Attention still shows it).
  • An org-wide search still lists every repo of a checked-out org; the "only my N checked-out repos" variant is a follow-up.

Verified

mise run lint, the full suite (2961 tests; 252 Browse, with new bounded, prune and rail/number suites), 9 mutations of the new logic each failing the suite, a full app swift build. org: and user: counts were checked equal for personal accounts against real GitHub (read-only). Not run locally: bundle, tutor check, text check (CI runs them); the two new shots (github/browse-fresh, github/browse-none) are defined but not rendered; no live run of the chunked search against the real viewer.

🤖 Generated with Claude Code

Mpdreamz and others added 3 commits November 19, 2026 14:23
A query with no scope searched all of public GitHub (579 thousand "bugs nobody touched" on a fresh
install). Browse now works inside what is checked out: BrowseCheckouts reads the orgs of the repo
records, a query with no place runs inside every one of them (chunked to GitHub's 256 characters,
counts added up), and BrowseFetch refuses any org or repo with no checkout (notCheckedOut) or no
checkout at all (unbounded) before anything is sent. Also: the cache prune for orgs outside the
checkouts, compact counts, the rail's seeded scopes as pure functions, and the palette dimming orgs
with no checkout.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…and the quiet cache prune

The list says "Check out a repo first" or "<name> isn't checked out" with a button into Add or clone
(prefilled), counts are dashes for what is not searched, the rail leads with All checkouts and the
checked-out orgs, counts are compact, and the cache drops other orgs' items shortly after launch.
docs/github/browse.md and the browse-fresh and browse-none shots.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@github-actions github-actions Bot added the bug Something isn't working label Nov 19, 2026
@Mpdreamz
Mpdreamz merged commit 7747fe7 into main Nov 19, 2026
5 checks passed
@Mpdreamz
Mpdreamz deleted the fix/browse-unscoped branch November 19, 2026 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant