Skip to content

Add Repo: suggest 'All repos in ORG_NAME' while typing an org #360

Description

@jennings

When the user opens the Add Repo dropdown and starts typing, the first autocomplete result should be All repos in "ORG_NAME", where ORG_NAME is the current query text. Selecting it should add a filter that matches all PRs owned by that org (equivalent to GitHub search's org:ORG_NAME qualifier), rather than a single owner/repo.

Once the query contains a / character, the user is narrowing to a specific repo, so the "All repos" suggestion should disappear from the list.

Behavior

  • Query is empty → keep the existing top-level "All Repos" entry (unchanged).
  • Query is non-empty and contains no / → show All repos in "<query>" as the first result, above the repo search results.
  • Query contains / → hide the "All repos in ..." suggestion; only show matching owner/repo results.
  • Selecting the suggestion adds an org-scoped filter (new repo-filter kind) and closes the dropdown.

Changes

  • src/browser/components/home.tsx — around the add-repo dropdown (~L1027-1110): render the new suggestion row conditional on searchQuery.length > 0 && !searchQuery.includes("/").
  • Extend the repo-filter model to represent an org-wide filter alongside the existing owner/repo and ALL_REPOS_KEY cases. PR search calls that build the GitHub query need to emit org:<name> for this filter kind.
  • Dedupe: if an org filter is already present, don't offer to add it again (mirror the existing isAllReposFilter check).

Open questions

  • Display of the active filter chip for an org-scoped filter — reuse the "All Repos" chip styling with the org name, or a distinct treatment?
  • What should the suggestion do if the typed org doesn't exist? Options: (a) add anyway and let the PR query return empty, (b) validate against /orgs/{org} before adding. (a) is simpler and matches how single-repo entries behave today.

Tests

  • Typing anthropic shows All repos in "anthropic" as the first row; typing anthropic/ hides it.
  • Clicking the suggestion adds a filter that produces org:anthropic in the resulting PR search query.
  • Adding the same org twice is prevented.

Metadata

Metadata

Assignees

No one assigned

    Labels

    implementedVerified locally; awaiting merge to main

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions