Skip to content

web: show community files in tabs below the file list - #8615

Merged
unknwon merged 2 commits into
mainfrom
overview-tabs
Nov 16, 2026
Merged

unknwon merged 2 commits into
mainfrom
overview-tabs

Conversation

@unknwon

@unknwon unknwon commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Describe the pull request

Stacked on #8536.

The box below the file list of the code browser now works like GitHub's repository overview:

  • A tab for each of the README, code of conduct, contributing guide, license and security policy that exists. ?tab=readme-ov-file, coc-ov-file, contributing-ov-file, license-ov-file and security-ov-file pick one, the same values as GitHub. The first tab keeps the URL clean.
  • In the root directory, the code of conduct, contributing guide and security policy are looked up in .github, then in the root, then in docs, as on GitHub. A subdirectory shows only its README.
  • An outline button lists the headings of the shown document, indented by level, with a filter. Picking a heading jumps to it.
  • Plain-text files, e.g., LICENSE, show in monospace.

/api/web/{owner}/{repo}/src returns all overview files already rendered in overview, in place of readme, so switching tabs needs no request and keeps the scroll position. Below sm, extra tabs fold into the "More" menu of PageTabs.

Link to the issue: n/a

Checklist

  • I agree to follow the Code of Conduct by submitting this pull request.
  • I have read and acknowledge the Contributing guide.
  • I have added test cases to cover the new code or have provided the test plan. (if applicable)
  • I have added an entry to CHANGELOG. (if applicable)

Screenshots

Repository home: overview tabs with the outline open

README tab beside Code of conduct, Contributing, License and Security tabs, with the outline listing the README headings and a filter

License tab, picked with ?tab=license-ov-file

License tab showing the plain-text LICENSE in monospace

Subdirectory at 375px: only the README tab

The sub directory at 375px wide with a single README tab and no sideways scrolling

Test plan

  1. Push this repository to a local instance and open its home page. The box shows README, Contributing (from .github), License and Security tabs, and only the shown tab is marked current.
  2. Switch tabs. The URL gets ?tab=... without a reload, and License shows the text in monospace.
  3. Open the outline, type inst, and pick "Installation". The page jumps to the heading and the menu closes.
  4. Open /src/main/docs. Only the README tab shows. /src/main/internal shows no box.
  5. Repeat in dark mode and at 375px wide. Extra tabs fold into "More" and nothing scrolls sideways.

go test ./cmd/gogs/internal/web/, golangci-lint, tsc, eslint and prettier pass.

AI usage

Written with Amp.

Base automatically changed from code-react-flamego to main November 16, 2026 17:35
The box below the file list of the code browser now has a tab for each of
the README, code of conduct, contributing guide, license and security
policy, as on GitHub, and ?tab=license-ov-file and the like pick one. The
root directory looks up the code of conduct, contributing guide and
security policy in .github, then in the root, then in docs. An outline
button lists the headings of the shown document with a filter.
unknwon added a commit that referenced this pull request Nov 16, 2026
@unknwon
unknwon merged commit 8343a47 into main Nov 16, 2026
12 checks passed
@unknwon
unknwon deleted the overview-tabs branch November 16, 2026 20:09
@unknwon unknwon mentioned this pull request Nov 16, 2026
2 of 4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant