Repository navigation
PR files: github.com commit box with Prev / Next for a single commit - #4
Merged
Merged
Conversation
When a PR's Files changed tab shows one commit, github.com puts the commit's message box above the diff: title, body, a Prev / Next ButtonGroup to step through the PR's commits, Browse files, and an author row with the short SHA. Gitea only shows the "showing only changes of commit X" banner. The custom footer renders the box from CompareInfo.Commits and replaces that banner (no box.tmpl override, which differs between 1.27 and 28). github-* themes only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On a PR's Commits tab Gitea links the SHA to /pulls/N/commits/<sha> but the title to the repository's /commit/<sha> page, which is outside the PR (no Prev / Next). github.com opens the PR commit view from both. github-* themes only; the repository commit list is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
|
@zo-ly Thanks for your contribution! can you also make sure your PR work with v28.1.0 as well? |
Author
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.

What
When a pull request's Files changed tab shows a single commit (
/pulls/N/commits/<sha>), github.com puts the commit's message box above the diff: title, body, a Prev / Next ButtonGroup to step through the PR's commits, Browse files, and an author row with the short SHA. Gitea only shows a "Showing only changes of commit X – Show all commits" banner, so you have to go back to the commit dropdown for every step and you can't see the commit message.This PR replaces that banner with the github.com commit box (github-* themes only):
style/whitespace/show-outdatedparameters, as Gitea's commit selector does.commit <sha>with a copy button./commit/<sha>page, which is outside the PR and has no Prev / Next. github.com opens the PR view from both. The repository commit list is unchanged.Screenshots (Gitea 1.27.3)
A PR with three commits, oldest to newest: C → B → A.
Middle commit (B), github-light: both buttons enabled. B's committer differs from its author.
Oldest commit (C), with a message body: Prev disabled, Next → B
Newest commit (A): Prev → B, Next disabled
A 120-line squash-merge body, folded to 8 lines
github-dark
How
templates/custom/footer.tmpl: on the single-commit PR files page, walkCompareInfo.Commits(newest first,git log base..head) to find the current commit and its neighbours, render the box into a<template>, and swap it in for the banner.repo/diff/box.tmplis not overridden because it differs between 1.27 and 28; the banner markup is identical in both. On 28.x the author row uses itsrepo.diff.authored_committed_at/committed_atsentence; 1.27.x does not have those keys, so it uses the commit page's "committed by" layout.templates/repo/commits_list.tmpl: whenPageIsPullCommitsand a github-* theme is active, the title link uses the same/pulls/N/commits/<sha>base as the SHA link.src/code/diff.css: the box styles (Primer tokens only). The buttons reuse the existing ButtonGroup and Button styles.Testing
npm run lintandnpm run buildpass.gitea-lightand on the repository commit list the links are unchanged. No page errors.🤖 Generated with Claude Code