feat: repository quick-switcher dropdown in repo header #39
No reviewers
Labels
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
codefloe/forgejo-codefloe!39
Loading…
Reference in a new issue
No description provided.
Delete branch "t3code/7fc28a38"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Adds a GitHub-style repository quick-switcher to the repo header.
A caret button next to the
owner / repobreadcrumb opens a searchable dropdown listing the current owner's other repositories, so you can jump between repos of the same user/org without leaving the page.How it works
GET /{owner}/{repo}/repo-switcher/listreturns the owner's repositories as JSON, capped at 100 and sorted by most-recently-updated.Visibility is delegated entirely to
SearchRepository'sActorfilter, so private repos only appear for viewers allowed to see them; anonymous users see only public repos.Collaborate: falsescopes results to repos the owner actually owns, not repos they merely collaborate on elsewhere.RepoSwitcher.vuecomponent (mirroring the existingRepoBranchTagSelector.vuepattern) mounts on a caret in the header.It fetches the list once on first open, then filters client-side as you type.
Keyboard navigation (arrow keys, Enter, Escape) and click-outside-to-close are supported; the current repo is highlighted.
Scope
Intentionally limited to the current owner's repositories — no cross-owner search and no recent-visit tracking.
Tests
TestRepoSwitcherListcovers three permission paths: anonymous (public only), owner (sees own private repos), and a third-party authenticated user (cannot see the owner's private repos).filterReposcase-insensitive substring helper.