在提交区域添加“刷新”和“推送”右键快捷操作

This commit is contained in:
xintaofei
2026-03-21 20:48:04 +08:00
parent d9032f1c82
commit 8432475ca6
11 changed files with 79 additions and 20 deletions

View File

@@ -21,6 +21,7 @@ import {
GitBranchPlus,
GitCompare,
RefreshCw,
Upload,
} from "lucide-react"
import {
Commit,
@@ -82,6 +83,7 @@ import {
gitListAllBranches,
gitLog,
gitNewBranch,
openPushWindow,
} from "@/lib/tauri"
import type { GitBranchList, GitLogEntry, GitLogFileChange } from "@/lib/types"
import { toast } from "sonner"
@@ -1168,6 +1170,28 @@ export function GitLogTab() {
<GitCompare className="h-3.5 w-3.5" />
{tCommon("viewDiff")}
</ContextMenuItem>
<ContextMenuItem
onSelect={() => {
void fetchLog()
}}
>
<RefreshCw className="size-3.5" />
{tCommon("refresh")}
</ContextMenuItem>
<ContextMenuItem
onSelect={() => {
if (!folder) return
openPushWindow(folder.id).catch((err) => {
const msg = toErrorMessage(err)
toast.error(t("toasts.openPushWindowFailed"), {
description: msg,
})
})
}}
>
<Upload className="size-3.5" />
{tCommon("push")}
</ContextMenuItem>
</ContextMenuContent>
</ContextMenu>
)
@@ -1180,8 +1204,23 @@ export function GitLogTab() {
void fetchLog()
}}
>
<RefreshCw className="size-3.5" />
{tCommon("refresh")}
</ContextMenuItem>
<ContextMenuItem
onSelect={() => {
if (!folder) return
openPushWindow(folder.id).catch((err) => {
const msg = toErrorMessage(err)
toast.error(t("toasts.openPushWindowFailed"), {
description: msg,
})
})
}}
>
<Upload className="size-3.5" />
{tCommon("push")}
</ContextMenuItem>
</ContextMenuContent>
</ContextMenu>