feat(ui): add "follow rename" to file commit history list (#34994)

Fix #28253

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
Thomas Sayen
2026-06-03 17:40:38 +00:00
committed by GitHub
co-authored by wxiaoguang
parent 735e940a61
commit b2748d7654
17 changed files with 169 additions and 82 deletions
+10
View File
@@ -24,3 +24,13 @@ export function initCommitStatuses() {
});
});
}
export function initCommitFileHistoryFollowRename() {
registerGlobalInitFunc('initCommitHistoryFollowRename', (el: HTMLInputElement) => {
el.addEventListener('change', () => {
const url = new URL(window.location.toString());
url.searchParams.set('follow-rename', `${el.checked}`);
window.location.assign(url.toString());
});
});
}
+2 -1
View File
@@ -21,7 +21,7 @@ import {initMarkupContent} from './markup/content.ts';
import {initRepoFileView} from './features/file-view.ts';
import {initUserExternalLogins, initUserCheckAppUrl} from './features/user-auth.ts';
import {initRepoPullRequestReview, initRepoIssueFilterItemLabel} from './features/repo-issue.ts';
import {initRepoEllipsisButton, initCommitStatuses} from './features/repo-commit.ts';
import {initRepoEllipsisButton, initCommitStatuses, initCommitFileHistoryFollowRename} from './features/repo-commit.ts';
import {initRepoTopicBar} from './features/repo-home.ts';
import {initAdminCommon} from './features/admin/common.ts';
import {initRepoCodeView} from './features/repo-code.ts';
@@ -123,6 +123,7 @@ const initPerformanceTracer = callInitFunctions([
initRepoCodeView,
initBranchSelectorTabs,
initRepoEllipsisButton,
initCommitFileHistoryFollowRename,
initRepoDiffCommitBranchesAndTags,
initRepoEditor,
initRepoGraphGit,