feat(folder): add commit reset action in git log

Add a "Reset to Here" context action for git log commit items in the folder page.

Show a reset dialog with branch, target commit, commit message, and reset mode details for soft, mixed, hard, and keep.

Disable reset when viewing a non-current branch filter and keep the action ordering under commit diff.

Add git_reset support across Rust commands, Tauri invoke registration, web handlers/routes, and frontend API/type bindings.

Add localized reset labels, mode descriptions, and toast messages across all supported languages.
This commit is contained in:
xintaofei
2026-04-15 11:14:37 +08:00
parent 66549ce2f7
commit f3630ba48a
18 changed files with 600 additions and 21 deletions

View File

@@ -27,6 +27,7 @@ import type {
GitPushInfo,
GitMergeResult,
GitRebaseResult,
GitResetMode,
GitConflictFileVersions,
GitCommitResult,
GitRemote,
@@ -1125,6 +1126,14 @@ export async function gitCommitBranches(
return invoke("git_commit_branches", { path, commit })
}
export async function gitReset(
path: string,
commit: string,
mode: GitResetMode
): Promise<void> {
return invoke("git_reset", { path, commit, mode })
}
// Terminal commands
export async function terminalSpawn(