Repository navigation
web: make the code browser look like GitHub's - #8630
Merged
Merged
Conversation
unknwon
added a commit
that referenced
this pull request
Nov 16, 2026
The repository home gets an About column, branch and tag counts, "Go to file", an "Add file" menu, a one-line latest commit bar with co-authors, and flattened single-child folders. Files and folders below the root get a file tree sidebar, a copy path button, a "..." menu with the permalink and "Go to line", and a file toolbar with lines of code, Raw, Copy and Download. The paths endpoint and git.Repository.TreePaths come from #8551.
unknwon
force-pushed
the
code-browser-github-look
branch
from
November 16, 2026 17:42
815aa89 to
229c1d5
Compare
unknwon
added a commit
that referenced
this pull request
Nov 16, 2026
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe the pull request
Stacked on #8536.
The code browser now looks and works like GitHub's, using only data Gogs already has or that #8551 adds:
tfocuses it, as on GitHub. Matching letters in order only counts when nothing contains the query as typed.Co-authored-bytrailers shows "alice and carol", or "alice and 3 others", which lists everyone on a click. The commits page shows co-authors the same way.cmd/gogs, with filled folder icons. This applies to directories with at most 100 subdirectories, since each level costs a tree read.New endpoint
GET /api/web/{owner}/{repo}/paths[/{ref}]lists every file path of a ref, at most 50,000, from #8551 withgit.Repository.TreePaths. Commit list items now havecoAuthors.Link to the issue: n/a
Checklist
Screenshots
Repository home: About column, counts, Go to file, Add file, co-authors and flattened folders
Go to file
Add file menu
More than two authors
Commits page with co-authors
File with the tree sidebar and the file toolbar
"..." menu and Go to line
Tree hidden
Folder page with the folder open in the tree
Dark mode
375px
Test plan
Co-authored-by: Carol <[email protected]>and open the repository home. The commit bar shows both avatars and "alice and Carol", and About lists the README, license and security policy that exist in the root.tand typemain.go. Only paths that contain it are listed, file names first. Enter opens the first one.#L40and line 40 is selected and scrolled into view.go test ./internal/git/ ./cmd/gogs/internal/web/(withTestCoAuthorsOfandTestRepository_TreePaths),golangci-lint,tsc,eslint,prettierand the web build pass.AI usage
Written with Amp.