From 8432475ca62ab70376179d92f8e4f39480cd8da4 Mon Sep 17 00:00:00 2001 From: xintaofei Date: Sat, 21 Mar 2026 20:48:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8=E6=8F=90=E4=BA=A4=E5=8C=BA=E5=9F=9F?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E2=80=9C=E5=88=B7=E6=96=B0=E2=80=9D=E5=92=8C?= =?UTF-8?q?=E2=80=9C=E6=8E=A8=E9=80=81=E2=80=9D=E5=8F=B3=E9=94=AE=E5=BF=AB?= =?UTF-8?q?=E6=8D=B7=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../layout/aux-panel-git-log-tab.tsx | 39 +++++++++++++++++++ src/i18n/messages/ar.json | 6 ++- src/i18n/messages/de.json | 6 ++- src/i18n/messages/en.json | 6 ++- src/i18n/messages/es.json | 6 ++- src/i18n/messages/fr.json | 6 ++- src/i18n/messages/ja.json | 6 ++- src/i18n/messages/ko.json | 6 ++- src/i18n/messages/pt.json | 6 ++- src/i18n/messages/zh-CN.json | 6 ++- src/i18n/messages/zh-TW.json | 6 ++- 11 files changed, 79 insertions(+), 20 deletions(-) diff --git a/src/components/layout/aux-panel-git-log-tab.tsx b/src/components/layout/aux-panel-git-log-tab.tsx index 7b2d6c0..dd069b8 100644 --- a/src/components/layout/aux-panel-git-log-tab.tsx +++ b/src/components/layout/aux-panel-git-log-tab.tsx @@ -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() { {tCommon("viewDiff")} + { + void fetchLog() + }} + > + + {tCommon("refresh")} + + { + if (!folder) return + openPushWindow(folder.id).catch((err) => { + const msg = toErrorMessage(err) + toast.error(t("toasts.openPushWindowFailed"), { + description: msg, + }) + }) + }} + > + + {tCommon("push")} + ) @@ -1180,8 +1204,23 @@ export function GitLogTab() { void fetchLog() }} > + {tCommon("refresh")} + { + if (!folder) return + openPushWindow(folder.id).catch((err) => { + const msg = toErrorMessage(err) + toast.error(t("toasts.openPushWindowFailed"), { + description: msg, + }) + }) + }} + > + + {tCommon("push")} + diff --git a/src/i18n/messages/ar.json b/src/i18n/messages/ar.json index 188cf3e..9238b95 100644 --- a/src/i18n/messages/ar.json +++ b/src/i18n/messages/ar.json @@ -678,7 +678,8 @@ "create": "إنشاء", "createAndSwitch": "إنشاء والتبديل", "openFile": "فتح الملف", - "viewDiff": "عرض Diff" + "viewDiff": "عرض Diff", + "push": "دفع..." }, "modes": { "conversation": "وضع المحادثة", @@ -1083,7 +1084,8 @@ "toasts": { "createdAndSwitchedNewBranch": "تم إنشاء فرع جديد والتبديل إليه", "newBranchFromCommit": "{name} (من {shortHash})", - "createBranchFailed": "فشل إنشاء الفرع" + "createBranchFailed": "فشل إنشاء الفرع", + "openPushWindowFailed": "فشل فتح نافذة الدفع" }, "branchSelector": { "selectBranchPlaceholder": "اختر فرعًا...", diff --git a/src/i18n/messages/de.json b/src/i18n/messages/de.json index 1f61d54..c5360ce 100644 --- a/src/i18n/messages/de.json +++ b/src/i18n/messages/de.json @@ -678,7 +678,8 @@ "create": "Erstellen", "createAndSwitch": "Erstellen und wechseln", "openFile": "Datei öffnen", - "viewDiff": "Diff anzeigen" + "viewDiff": "Diff anzeigen", + "push": "Pushen..." }, "modes": { "conversation": "Konversationsmodus", @@ -1083,7 +1084,8 @@ "toasts": { "createdAndSwitchedNewBranch": "Neuen Branch erstellt und gewechselt", "newBranchFromCommit": "{name} (aus {shortHash})", - "createBranchFailed": "Branch konnte nicht erstellt werden" + "createBranchFailed": "Branch konnte nicht erstellt werden", + "openPushWindowFailed": "Push-Fenster konnte nicht geöffnet werden" }, "branchSelector": { "selectBranchPlaceholder": "Branch auswählen...", diff --git a/src/i18n/messages/en.json b/src/i18n/messages/en.json index 893d06c..dc52258 100644 --- a/src/i18n/messages/en.json +++ b/src/i18n/messages/en.json @@ -678,7 +678,8 @@ "create": "Create", "createAndSwitch": "Create and Switch", "openFile": "Open File", - "viewDiff": "View Diff" + "viewDiff": "View Diff", + "push": "Push..." }, "modes": { "conversation": "Conversation Mode", @@ -1083,7 +1084,8 @@ "toasts": { "createdAndSwitchedNewBranch": "Created and switched to new branch", "newBranchFromCommit": "{name} (from {shortHash})", - "createBranchFailed": "Failed to create branch" + "createBranchFailed": "Failed to create branch", + "openPushWindowFailed": "Failed to open push window" }, "branchSelector": { "selectBranchPlaceholder": "Select branch...", diff --git a/src/i18n/messages/es.json b/src/i18n/messages/es.json index 1bbfee4..f012064 100644 --- a/src/i18n/messages/es.json +++ b/src/i18n/messages/es.json @@ -678,7 +678,8 @@ "create": "Crear", "createAndSwitch": "Crear y cambiar", "openFile": "Abrir archivo", - "viewDiff": "Ver Diff" + "viewDiff": "Ver Diff", + "push": "Enviar..." }, "modes": { "conversation": "Modo conversación", @@ -1083,7 +1084,8 @@ "toasts": { "createdAndSwitchedNewBranch": "Nueva rama creada y activada", "newBranchFromCommit": "{name} (desde {shortHash})", - "createBranchFailed": "No se pudo crear la rama" + "createBranchFailed": "No se pudo crear la rama", + "openPushWindowFailed": "No se pudo abrir la ventana de envío" }, "branchSelector": { "selectBranchPlaceholder": "Seleccionar rama...", diff --git a/src/i18n/messages/fr.json b/src/i18n/messages/fr.json index a022b1f..5711b75 100644 --- a/src/i18n/messages/fr.json +++ b/src/i18n/messages/fr.json @@ -678,7 +678,8 @@ "create": "Créer", "createAndSwitch": "Créer et basculer", "openFile": "Ouvrir le fichier", - "viewDiff": "Voir le Diff" + "viewDiff": "Voir le Diff", + "push": "Pousser..." }, "modes": { "conversation": "Mode conversation", @@ -1083,7 +1084,8 @@ "toasts": { "createdAndSwitchedNewBranch": "Nouvelle branche créée et activée", "newBranchFromCommit": "{name} (depuis {shortHash})", - "createBranchFailed": "Échec de la création de la branche" + "createBranchFailed": "Échec de la création de la branche", + "openPushWindowFailed": "Échec de l'ouverture de la fenêtre de push" }, "branchSelector": { "selectBranchPlaceholder": "Sélectionner une branche...", diff --git a/src/i18n/messages/ja.json b/src/i18n/messages/ja.json index 72bf3c4..0095656 100644 --- a/src/i18n/messages/ja.json +++ b/src/i18n/messages/ja.json @@ -678,7 +678,8 @@ "create": "作成", "createAndSwitch": "作成して切り替え", "openFile": "ファイルを開く", - "viewDiff": "差分を見る" + "viewDiff": "差分を見る", + "push": "プッシュ..." }, "modes": { "conversation": "会話モード", @@ -1083,7 +1084,8 @@ "toasts": { "createdAndSwitchedNewBranch": "新しいブランチを作成して切り替えました", "newBranchFromCommit": "{name}({shortHash} から)", - "createBranchFailed": "ブランチ作成に失敗しました" + "createBranchFailed": "ブランチ作成に失敗しました", + "openPushWindowFailed": "プッシュウィンドウを開けませんでした" }, "branchSelector": { "selectBranchPlaceholder": "ブランチを選択...", diff --git a/src/i18n/messages/ko.json b/src/i18n/messages/ko.json index 8b972b1..a3303a7 100644 --- a/src/i18n/messages/ko.json +++ b/src/i18n/messages/ko.json @@ -678,7 +678,8 @@ "create": "생성", "createAndSwitch": "생성 후 전환", "openFile": "파일 열기", - "viewDiff": "Diff 보기" + "viewDiff": "Diff 보기", + "push": "푸시..." }, "modes": { "conversation": "대화 모드", @@ -1083,7 +1084,8 @@ "toasts": { "createdAndSwitchedNewBranch": "새 브랜치를 생성하고 전환했습니다", "newBranchFromCommit": "{name} ({shortHash}에서 생성)", - "createBranchFailed": "브랜치 생성에 실패했습니다" + "createBranchFailed": "브랜치 생성에 실패했습니다", + "openPushWindowFailed": "푸시 창을 열지 못했습니다" }, "branchSelector": { "selectBranchPlaceholder": "브랜치 선택...", diff --git a/src/i18n/messages/pt.json b/src/i18n/messages/pt.json index 63d17be..16165cf 100644 --- a/src/i18n/messages/pt.json +++ b/src/i18n/messages/pt.json @@ -678,7 +678,8 @@ "create": "Criar", "createAndSwitch": "Criar e alternar", "openFile": "Abrir arquivo", - "viewDiff": "Ver Diff" + "viewDiff": "Ver Diff", + "push": "Enviar..." }, "modes": { "conversation": "Modo conversa", @@ -1083,7 +1084,8 @@ "toasts": { "createdAndSwitchedNewBranch": "Nova branch criada e selecionada", "newBranchFromCommit": "{name} (de {shortHash})", - "createBranchFailed": "Falha ao criar branch" + "createBranchFailed": "Falha ao criar branch", + "openPushWindowFailed": "Falha ao abrir a janela de push" }, "branchSelector": { "selectBranchPlaceholder": "Selecionar branch...", diff --git a/src/i18n/messages/zh-CN.json b/src/i18n/messages/zh-CN.json index 1cb4537..8ae1554 100644 --- a/src/i18n/messages/zh-CN.json +++ b/src/i18n/messages/zh-CN.json @@ -678,7 +678,8 @@ "create": "创建", "createAndSwitch": "创建并切换", "openFile": "打开文件", - "viewDiff": "查看差异" + "viewDiff": "查看差异", + "push": "推送..." }, "modes": { "conversation": "会话模式", @@ -1083,7 +1084,8 @@ "toasts": { "createdAndSwitchedNewBranch": "已创建并切换到新分支", "newBranchFromCommit": "{name}(来自 {shortHash})", - "createBranchFailed": "新建分支失败" + "createBranchFailed": "新建分支失败", + "openPushWindowFailed": "打开推送窗口失败" }, "branchSelector": { "selectBranchPlaceholder": "选择分支...", diff --git a/src/i18n/messages/zh-TW.json b/src/i18n/messages/zh-TW.json index 9065901..10665aa 100644 --- a/src/i18n/messages/zh-TW.json +++ b/src/i18n/messages/zh-TW.json @@ -678,7 +678,8 @@ "create": "建立", "createAndSwitch": "建立並切換", "openFile": "打開檔案", - "viewDiff": "查看差異" + "viewDiff": "查看差異", + "push": "推送..." }, "modes": { "conversation": "會話模式", @@ -1083,7 +1084,8 @@ "toasts": { "createdAndSwitchedNewBranch": "已建立並切換到新分支", "newBranchFromCommit": "{name}(來自 {shortHash})", - "createBranchFailed": "新增分支失敗" + "createBranchFailed": "新增分支失敗", + "openPushWindowFailed": "開啟推送視窗失敗" }, "branchSelector": { "selectBranchPlaceholder": "選擇分支...",