Skip to content

Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins

fix(desktop): tidy worktree setup menu

vastsa34e1af139483
diff --git a/apps/desktop/src/features/worktree/WorktreeSidebarParts.tsx b/apps/desktop/src/features/worktree/WorktreeSidebarParts.tsx
index 75c2fc3d9..5019e9c9e 100644
--- a/apps/desktop/src/features/worktree/WorktreeSidebarParts.tsx
+++ b/apps/desktop/src/features/worktree/WorktreeSidebarParts.tsx
@@ -115,13 +115,14 @@ export function WorktreeProjectMenuItems({
type="button"
role="menuitem"
data-action="worktree-setup-command"
+ title={t("worktree.setupCommand.menu")}
onClick={() => {
onDone();
open({ kind: "setupCommand", projectPath, projectName });
}}
>
<IconWrench size={14} />
- {t("worktree.setupCommand.menu")}
+ <span className="worktree-menu-label">{t("worktree.setupCommand.menu")}</span>
</button>
</>
);
diff --git a/apps/desktop/src/styles/worktree.css b/apps/desktop/src/styles/worktree.css
index 2cdc8691c..e0ac0ed60 100644
--- a/apps/desktop/src/styles/worktree.css
+++ b/apps/desktop/src/styles/worktree.css
@@ -6,6 +6,15 @@
margin-inline-end: 4px;
}
+/* Keep long localized project-menu labels aligned without widening the menu. */
+.worktree-menu-label {
+ min-width: 0;
+ flex: 1 1 auto;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
.worktree-dialog-body {
display: flex;
flex-direction: column;
diff --git a/apps/desktop/test/worktree-menu-user-path.test.mjs b/apps/desktop/test/worktree-menu-user-path.test.mjs
index d60c97ac4..c58290d1e 100644
--- a/apps/desktop/test/worktree-menu-user-path.test.mjs
+++ b/apps/desktop/test/worktree-menu-user-path.test.mjs
@@ -95,6 +95,12 @@ window.menuProbe = async () => {
check(item().disabled, "switching project re-probes");
await answer();
check(!item().disabled && !reason(), "a git project must enable the item");
+ const setupCommandItem = document.querySelector('[data-action="worktree-setup-command"]');
+ check(
+ setupCommandItem?.querySelector(".worktree-menu-label")?.textContent === i18n.t("worktree.setupCommand.menu"),
+ "setup command label must use the shrinkable text container",
+ );
+ check(setupCommandItem?.getAttribute("title") === i18n.t("worktree.setupCommand.menu"), "full label must remain available on hover");
item().click();
await answer();
await settle();
diff --git a/packages/i18n/src/locales/en/index.ts b/packages/i18n/src/locales/en/index.ts
index 1a38ec96c..d6cf547cb 100644
--- a/packages/i18n/src/locales/en/index.ts
+++ b/packages/i18n/src/locales/en/index.ts
@@ -37,7 +37,7 @@ export const en = {
conflict: "These files conflict with the project. Resolve them in the session: {{files}}",
},
setupCommand: {
- menu: "Worktree setup command…",
+ menu: "Setup command…",
title: "Worktree setup command",
description: "Runs in every new isolated worktree of this project, for example to install dependencies. A failure is shown but does not stop the session.",
label: "Command",
diff --git a/packages/i18n/src/locales/ko/index.ts b/packages/i18n/src/locales/ko/index.ts
index 24c992907..68559465d 100644
--- a/packages/i18n/src/locales/ko/index.ts
+++ b/packages/i18n/src/locales/ko/index.ts
@@ -39,7 +39,7 @@ export const ko = {
conflict: "이 파일들이 프로젝트와 충돌합니다. 세션에서 해결하세요: {{files}}",
},
setupCommand: {
- menu: "Worktree 설정 명령…",
+ menu: "초기화 명령…",
title: "Worktree 설정 명령",
description: "이 프로젝트의 새 격리 worktree마다 실행됩니다(예: 의존성 설치). 실패해도 알림만 표시되고 세션은 계속 사용할 수 있습니다.",
label: "명령",
diff --git a/packages/i18n/src/locales/pt-BR/index.ts b/packages/i18n/src/locales/pt-BR/index.ts
index c1771e395..58491bc13 100644
--- a/packages/i18n/src/locales/pt-BR/index.ts
+++ b/packages/i18n/src/locales/pt-BR/index.ts
@@ -39,7 +39,7 @@ export const ptBR = {
conflict: "Estes arquivos conflitam com o projeto. Resolva-os na sessão: {{files}}",
},
setupCommand: {
- menu: "Comando de preparação do worktree…",
+ menu: "Comando de setup…",
title: "Comando de preparação do worktree",
description: "Executa em cada novo worktree isolado deste projeto, por exemplo para instalar dependências. Uma falha é exibida, mas não interrompe a sessão.",
label: "Comando",
diff --git a/packages/i18n/src/locales/tr/index.ts b/packages/i18n/src/locales/tr/index.ts
index 96226e893..63a08e057 100644
--- a/packages/i18n/src/locales/tr/index.ts
+++ b/packages/i18n/src/locales/tr/index.ts
@@ -39,7 +39,7 @@ export const tr = {
conflict: "Bu dosyalar projeyle çakışıyor. Bunları oturumda çözün: {{files}}",
},
setupCommand: {
- menu: "Worktree hazırlık komutu…",
+ menu: "Hazırlık komutu…",
title: "Worktree hazırlık komutu",
description: "Bu projenin her yeni yalıtılmış worktree'sinde çalışır, örneğin bağımlılıkları kurmak için. Hata gösterilir ancak oturumu durdurmaz.",
label: "Komut",
diff --git a/packages/i18n/src/locales/zh-CN/index.ts b/packages/i18n/src/locales/zh-CN/index.ts
index 9a221a64a..11df7b16f 100644
--- a/packages/i18n/src/locales/zh-CN/index.ts
+++ b/packages/i18n/src/locales/zh-CN/index.ts
@@ -39,7 +39,7 @@ export const zhCN = {
conflict: "这些文件与项目冲突,请在会话中解决:{{files}}",
},
setupCommand: {
- menu: "Worktree 初始化命令…",
+ menu: "初始化命令…",
title: "Worktree 初始化命令",
description: "在本项目每个新的隔离 worktree 中运行,例如安装依赖。失败会提示,但不影响会话使用。",
label: "命令",
diff --git a/packages/i18n/src/locales/zh-TW/index.ts b/packages/i18n/src/locales/zh-TW/index.ts
index 0f567bb6a..27467e44b 100644
--- a/packages/i18n/src/locales/zh-TW/index.ts
+++ b/packages/i18n/src/locales/zh-TW/index.ts
@@ -39,7 +39,7 @@ export const zhTW = {
conflict: "這些檔案與專案衝突,請在工作階段中解決:{{files}}",
},
setupCommand: {
- menu: "Worktree 初始化指令…",
+ menu: "初始化指令…",
title: "Worktree 初始化指令",
description: "在本專案每個新的隔離 worktree 中執行,例如安裝相依套件。失敗會提示,但不影響工作階段使用。",
label: "指令",