Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.
Go
fix(projects): drop the rename pencil from local directory resources (MUL-7525) (#8603)
Bohan Jiang6f52e833ce16
diff --git a/packages/views/locales/en/projects.json b/packages/views/locales/en/projects.jsonindex 4231b49769..ecb8aa14dd 100644--- a/packages/views/locales/en/projects.json+++ b/packages/views/locales/en/projects.json@@ -100,16 +100,12 @@"add_local_directory_button": "Add local directory","local_daemon_offline_hint": "Start the local daemon to attach a directory on this machine.","local_daemon_already_attached_hint": "This machine already has a local directory attached. Remove it before adding another.",- "local_rename_tooltip": "Rename",- "local_rename_label": "Local directory label","local_no_daemon_tooltip": "Local daemon isn't reporting an ID yet — the agent can't open this directory.","local_other_machine_tooltip": "Only available on the machine that registered this directory.","chat_hint_prefix": "Agent will work in-place at","chat_hint_worktree_prefix": "Agent will work in an isolated worktree of","chat_hint_worktree_note": "Your working copy stays untouched — each run hands its work back as an agent/… branch.","toast_local_attached": "Local directory attached",- "toast_local_renamed": "Renamed",- "toast_local_rename_failed": "Failed to rename","toast_local_pick_failed": "Failed to pick directory","toast_local_already_attached": "This directory is already attached to the project on this machine.","toast_local_daemon_already_attached": "This machine already has a local directory attached to this project. Remove it before adding another.",diff --git a/packages/views/locales/fr/projects.json b/packages/views/locales/fr/projects.jsonindex 52cc9e5c03..f1978fa495 100644--- a/packages/views/locales/fr/projects.json+++ b/packages/views/locales/fr/projects.json@@ -100,16 +100,12 @@"add_local_directory_button": "Ajouter un répertoire local","local_daemon_offline_hint": "Démarrez le daemon local pour rattacher un répertoire de cette machine.","local_daemon_already_attached_hint": "Cette machine a déjà un répertoire local rattaché. Retirez-le avant d'en ajouter un autre.",- "local_rename_tooltip": "Renommer",- "local_rename_label": "Libellé du répertoire local","local_no_daemon_tooltip": "Le daemon local ne communique pas encore d'identifiant — l'agent ne peut pas ouvrir ce répertoire.","local_other_machine_tooltip": "Disponible uniquement sur la machine qui a enregistré ce répertoire.","chat_hint_prefix": "L'agent travaillera en place dans","chat_hint_worktree_prefix": "L'agent travaillera dans un worktree isolé de","chat_hint_worktree_note": "Votre copie de travail reste intacte : chaque exécution restitue son travail dans une branche agent/….","toast_local_attached": "Répertoire local rattaché",- "toast_local_renamed": "Renommé",- "toast_local_rename_failed": "Échec du renommage","toast_local_pick_failed": "Échec de la sélection du répertoire","toast_local_already_attached": "Ce répertoire est déjà rattaché au projet sur cette machine.","toast_local_daemon_already_attached": "Cette machine a déjà un répertoire local rattaché à ce projet. Retirez-le avant d'en ajouter un autre.",diff --git a/packages/views/locales/ja/projects.json b/packages/views/locales/ja/projects.jsonindex 16f229b067..b4730e602e 100644--- a/packages/views/locales/ja/projects.json+++ b/packages/views/locales/ja/projects.json@@ -99,16 +99,12 @@"add_local_directory_button": "ローカルディレクトリを追加","local_daemon_offline_hint": "このマシンのディレクトリを添付するには、ローカルデーモンを起動してください。","local_daemon_already_attached_hint": "このマシンにはすでにローカルディレクトリが添付されています。新しく追加するには、先に既存のものを削除してください。",- "local_rename_tooltip": "名前を変更",- "local_rename_label": "ローカルディレクトリのラベル","local_no_daemon_tooltip": "ローカルデーモンがまだ ID を報告していないため、エージェントはこのディレクトリを開けません。","local_other_machine_tooltip": "このディレクトリを登録したマシンでのみ利用できます。","chat_hint_prefix": "エージェントは次の場所で直接作業します:","chat_hint_worktree_prefix": "エージェントは次のリポジトリの独立した worktree で作業します:","chat_hint_worktree_note": "作業コピーは変更されません。各実行の成果は agent/… ブランチとして返されます。","toast_local_attached": "ローカルディレクトリを添付しました",- "toast_local_renamed": "名前を変更しました",- "toast_local_rename_failed": "名前を変更できませんでした","toast_local_pick_failed": "ディレクトリを選択できませんでした","toast_local_already_attached": "このディレクトリはすでにこのマシンのプロジェクトに添付されています。","toast_local_daemon_already_attached": "このマシンにはすでにこのプロジェクトのローカルディレクトリが添付されています。新しく追加するには、先に既存のものを削除してください。",diff --git a/packages/views/locales/ko/projects.json b/packages/views/locales/ko/projects.jsonindex 64eec6ad19..acc2801578 100644--- a/packages/views/locales/ko/projects.json+++ b/packages/views/locales/ko/projects.json@@ -99,16 +99,12 @@"add_local_directory_button": "로컬 디렉터리 추가","local_daemon_offline_hint": "이 기기의 디렉터리를 연결하려면 로컬 데몬을 시작하세요.","local_daemon_already_attached_hint": "이 기기에는 이미 로컬 디렉터리가 연결되어 있습니다. 새로 추가하려면 먼저 기존 항목을 제거하세요.",- "local_rename_tooltip": "이름 변경",- "local_rename_label": "로컬 디렉터리 라벨","local_no_daemon_tooltip": "로컬 데몬이 아직 ID를 보고하지 않아 에이전트가 이 디렉터리를 열 수 없습니다.","local_other_machine_tooltip": "이 디렉터리를 등록한 기기에서만 사용할 수 있습니다.","chat_hint_prefix": "에이전트가 다음 위치에서 직접 작업합니다:","chat_hint_worktree_prefix": "에이전트가 다음 저장소의 격리된 worktree에서 작업합니다:","chat_hint_worktree_note": "작업 중인 파일은 그대로 유지되며, 각 실행 결과는 agent/… 브랜치로 전달됩니다.","toast_local_attached": "로컬 디렉터리를 연결했습니다",- "toast_local_renamed": "이름을 변경했습니다",- "toast_local_rename_failed": "이름을 변경하지 못했습니다","toast_local_pick_failed": "디렉터리를 선택하지 못했습니다","toast_local_already_attached": "이 디렉터리는 이미 이 기기의 프로젝트에 연결되어 있습니다.","toast_local_daemon_already_attached": "이 기기에는 이미 이 프로젝트의 로컬 디렉터리가 연결되어 있습니다. 새로 추가하려면 먼저 기존 항목을 제거하세요.",diff --git a/packages/views/locales/zh-Hans/projects.json b/packages/views/locales/zh-Hans/projects.jsonindex 621b671a87..b8b6d87729 100644--- a/packages/views/locales/zh-Hans/projects.json+++ b/packages/views/locales/zh-Hans/projects.json@@ -99,16 +99,12 @@"add_local_directory_button": "添加本地目录","local_daemon_offline_hint": "启动本地守护进程后才能添加本机目录。","local_daemon_already_attached_hint": "本机已经关联了一个本地目录到该项目,先移除现有目录再添加新目录。",- "local_rename_tooltip": "重命名",- "local_rename_label": "本地目录显示名","local_no_daemon_tooltip": "尚未识别到本机守护进程,智能体暂时无法打开此目录。","local_other_machine_tooltip": "此目录仅在最初注册它的电脑上可用。","chat_hint_prefix": "智能体将直接在以下目录中工作:","chat_hint_worktree_prefix": "智能体将在以下仓库的独立 worktree 中工作:","chat_hint_worktree_note": "不会改动你的工作副本,每次运行的结果以 agent/… 分支交回。","toast_local_attached": "已添加本地目录",- "toast_local_renamed": "已重命名",- "toast_local_rename_failed": "重命名失败","toast_local_pick_failed": "选择目录失败","toast_local_already_attached": "该目录已经在本机关联到此项目。","toast_local_daemon_already_attached": "本机已经关联了一个本地目录到该项目,先移除现有目录再添加新目录。",diff --git a/packages/views/projects/components/local-directory-label.test.ts b/packages/views/projects/components/local-directory-label.test.tsindex 8f28035a03..0157847360 100644--- a/packages/views/projects/components/local-directory-label.test.ts+++ b/packages/views/projects/components/local-directory-label.test.ts@@ -4,7 +4,7 @@ import { describe, it, expect } from "vitest";import { localDirectoryLabel } from "./local-directory-label";// Canonical priority matrix for the display name of a local_directory row.-// The component suites (project-resources-rename.test.tsx) keep the wiring+// The component suite (project-resources-local-directory.test.tsx) keeps the wiring// and named regressions; the read-order truth lives here.describe("localDirectoryLabel", () => {const ref = (overrides: Partial<{ label: string }> = {}) => ({@@ -13,7 +13,7 @@ describe("localDirectoryLabel", () => {...overrides,});- it("prefers the top-level column — where renames write — over the ref copy", () => {+ it("prefers the top-level column — where label updates write — over the ref copy", () => {expect(localDirectoryLabel({label: "Renamed Client",diff --git a/packages/views/projects/components/local-directory-label.ts b/packages/views/projects/components/local-directory-label.tsindex 74b0289bc8..33788b6315 100644--- a/packages/views/projects/components/local-directory-label.ts+++ b/packages/views/projects/components/local-directory-label.ts@@ -6,15 +6,14 @@ import type {/*** Display name for a local_directory row.*- * A row's name can live in two places: the top-level `label` column (written- * by renames since they stopped resending the ref — see- * handleRenameLocalDirectory in project-resources-section.tsx) and the legacy- * copy inside the ref (the only home desktop builds up to v0.4.28 knew).- * Current servers keep the two converged on every write, but rows last- * written by an older server can still disagree, and rows created by older- * clients carry only the ref copy. The column outranks the ref copy because- * it is the one current-client renames write; the path is the last resort so- * a row never renders nameless.+ * A row's name can live in two places: the top-level `label` column (what a+ * label update through the API or CLI writes; the panel itself no longer+ * offers a rename) and the legacy copy inside the ref (the only home desktop+ * builds up to v0.4.28 knew). Current servers keep the two converged on every+ * write, but rows last written by an older server can still disagree, and+ * rows created by older clients carry only the ref copy. The column outranks+ * the ref copy because it is the one current writes land in; the path is the+ * last resort so a row never renders nameless.*/export function localDirectoryLabel(resource: Pick<ProjectResource, "label"> & {diff --git a/packages/views/projects/components/project-resources-local-directory.test.tsx b/packages/views/projects/components/project-resources-local-directory.test.tsxnew file mode 100644index 0000000000..ccb19dab6c--- /dev/null+++ b/packages/views/projects/components/project-resources-local-directory.test.tsx@@ -0,0 +1,91 @@+// @vitest-environment jsdom++import { describe, it, expect, vi } from "vitest";+import { screen } from "@testing-library/react";+import { renderWithI18n } from "../../test/i18n";+import en from "../../locales/en/projects.json";++const RESOURCE = {+ id: "res-1",+ project_id: "p1",+ workspace_id: "workspace-1",+ resource_type: "local_directory",+ resource_ref: {+ local_path: "/Users/dev/work/game-client",+ daemon_id: "daemon-1",+ label: "game-client",+ execution_mode: "worktree",+ },+ // Written by a label update (`multica project resource update --label`):+ // the column the row must read before the copy left inside the ref.+ label: "Game Client",+ position: 0,+ created_at: "2026-08-18T00:00:00Z",+ created_by: "u1",+};++vi.mock("@tanstack/react-query", () => ({+ useQuery: (options: { queryKey?: unknown[] }) => {+ const key = options?.queryKey?.[0];+ if (key === "project-resources") return { data: [RESOURCE] };+ return { data: [] };+ },+ queryOptions: (options: unknown) => options,+}));++vi.mock("@multica/core/projects", () => ({+ projectResourcesOptions: () => ({ queryKey: ["project-resources"], queryFn: vi.fn() }),+ useCreateProjectResource: () => ({ mutateAsync: vi.fn() }),+ useUpdateProjectResource: () => ({ mutateAsync: vi.fn() }),+ useDeleteProjectResource: () => ({ mutateAsync: vi.fn() }),+}));++vi.mock("@multica/core/config", () => ({+ useConfigStore: (selector: (state: { localWorktreeSupported: boolean }) => unknown) =>+ selector({ localWorktreeSupported: true }),+}));++vi.mock("@multica/core/runtimes", () => ({+ runtimeListOptions: () => ({ queryKey: ["runtimes"], queryFn: vi.fn() }),+ runtimeAdvertisesLocalWorktree: () => true,+}));+vi.mock("@multica/core/hooks", () => ({ useWorkspaceId: () => "workspace-1" }));+vi.mock("@multica/core/paths", () => ({+ useCurrentWorkspace: () => ({ id: "workspace-1", slug: "ws", repos: [] }),+}));+vi.mock("../../platform/local-directory", () => ({+ isDesktopShell: () => true,+ pickDirectory: vi.fn(),+ validateLocalDirectory: vi.fn(),+}));+vi.mock("../../platform/use-local-daemon-status", () => ({+ useLocalDaemonStatus: () => ({ daemonId: "daemon-1", deviceName: "MacBook", running: true }),+}));+vi.mock("sonner", () => ({ toast: { success: vi.fn(), error: vi.fn() } }));++import { ProjectResourcesSection } from "./project-resources-section";++const strings = en.resources;++describe("ProjectResourcesSection — local directory row", () => {+ // The read-order matrix lives in local-directory-label.test.ts; this pins+ // the row to that helper so a label set through the API is what people see.+ it("names the row from the top-level label, not the copy inside the ref", () => {+ renderWithI18n(<ProjectResourcesSection projectId="p1" />);+ expect(screen.getByText("Game Client")).toBeInTheDocument();+ expect(screen.queryByText("game-client")).not.toBeInTheDocument();+ });++ // The row used to carry a pencil that turned the name into a text box. A+ // folder is identified by its path, so the only thing that "edit" changed+ // was the row's title, and beside the branch and remove controls it read as+ // a broken edit action (MUL-7525). What remains are the two settings that+ // change how tasks run on the folder.+ it("offers the execution mode and remove actions, and no rename", () => {+ renderWithI18n(<ProjectResourcesSection projectId="p1" />);+ expect(screen.getByTitle(strings.mode_edit_tooltip)).toBeInTheDocument();+ expect(screen.getByTitle(strings.remove_tooltip)).toBeInTheDocument();+ expect(screen.queryByTitle(/rename/i)).not.toBeInTheDocument();+ expect(screen.queryByRole("textbox")).not.toBeInTheDocument();+ });+});diff --git a/packages/views/projects/components/project-resources-rename.test.tsx b/packages/views/projects/components/project-resources-rename.test.tsxdeleted file mode 100644index 9286d1afa3..0000000000--- a/packages/views/projects/components/project-resources-rename.test.tsx+++ /dev/null@@ -1,119 +0,0 @@-// @vitest-environment jsdom--import { describe, it, expect, vi, beforeEach } from "vitest";-import { screen, fireEvent, waitFor } from "@testing-library/react";-import { renderWithI18n } from "../../test/i18n";--const updateMock = vi.fn().mockResolvedValue({});--const RESOURCE = {- id: "res-1",- project_id: "p1",- workspace_id: "workspace-1",- resource_type: "local_directory",- resource_ref: {- local_path: "/Users/dev/work/game-client",- daemon_id: "daemon-1",- label: "Game Client",- // The setting this test exists to protect.- execution_mode: "worktree",- },- // A row renamed since: the top-level column holds the current name while the- // ref still carries the one it was created with.- label: "Renamed Client",- position: 0,- created_at: "2026-08-18T00:00:00Z",- created_by: "u1",-};--vi.mock("@tanstack/react-query", () => ({- useQuery: (options: { queryKey?: unknown[] }) => {- const key = options?.queryKey?.[0];- if (key === "project-resources") return { data: [RESOURCE] };- return { data: [] };- },- queryOptions: (options: unknown) => options,-}));--vi.mock("@multica/core/projects", () => ({- projectResourcesOptions: () => ({ queryKey: ["project-resources"], queryFn: vi.fn() }),- useCreateProjectResource: () => ({ mutateAsync: vi.fn() }),- useUpdateProjectResource: () => ({ mutateAsync: updateMock }),- useDeleteProjectResource: () => ({ mutateAsync: vi.fn() }),-}));--// A backend that predates the capability signal: the client must assume it-// would silently drop execution_mode.-vi.mock("@multica/core/config", () => ({- useConfigStore: (selector: (state: { localWorktreeSupported: boolean }) => unknown) =>- selector({ localWorktreeSupported: false }),-}));--vi.mock("@multica/core/runtimes", () => ({- runtimeListOptions: () => ({ queryKey: ["runtimes"], queryFn: vi.fn() }),- runtimeAdvertisesLocalWorktree: () => true,-}));-vi.mock("@multica/core/hooks", () => ({ useWorkspaceId: () => "workspace-1" }));-vi.mock("@multica/core/paths", () => ({- useCurrentWorkspace: () => ({ id: "workspace-1", slug: "ws", repos: [] }),-}));-vi.mock("../../platform/local-directory", () => ({- isDesktopShell: () => true,- pickDirectory: vi.fn(),- validateLocalDirectory: vi.fn(),-}));-vi.mock("../../platform/use-local-daemon-status", () => ({- useLocalDaemonStatus: () => ({ daemonId: "daemon-1", deviceName: "MacBook", running: true }),-}));-vi.mock("sonner", () => ({ toast: { success: vi.fn(), error: vi.fn() } }));--import { ProjectResourcesSection } from "./project-resources-section";--describe("ProjectResourcesSection — renaming a worktree local directory", () => {- beforeEach(() => updateMock.mockClear());-- // The reported skew, one step further on: backend rolled back below v0.4.25- // while the runtimes stay current — a combination the docs call supported.- // Such a server replaces the ref with whatever it can parse, so resending it- // during an unrelated edit drops execution_mode, answers 200, and the next- // task edits the working copy the resource asked to isolate (#7113).- it("sends only the label, never a ref the server could strip", async () => {- renderWithI18n(<ProjectResourcesSection projectId="p1" />);-- fireEvent.click(screen.getByTitle(/rename/i));- const input = screen.getByRole("textbox");- fireEvent.change(input, { target: { value: "Client Worktree" } });- fireEvent.keyDown(input, { key: "Enter" });-- await waitFor(() => expect(updateMock).toHaveBeenCalledTimes(1));- const payload = updateMock.mock.calls[0]?.[0] as { data: unknown };- expect(payload.data).toEqual({ label: "Client Worktree" });- expect(payload.data).not.toHaveProperty("resource_ref");- });-- // The new name has to be what the user sees afterwards, which only holds if- // the top-level label outranks the stale one still sitting inside the ref.- // Full read-order matrix: local-directory-label.test.ts.- it("shows the top-level label over the one left behind in the ref", () => {- renderWithI18n(<ProjectResourcesSection projectId="p1" />);- expect(screen.getByText("Renamed Client")).toBeInTheDocument();- expect(screen.queryByText("Game Client")).not.toBeInTheDocument();- });-- // Clearing goes through the same label-only path as renaming: an emptied- // input must not fall back to resending the ref either, and the server is- // the one that drops BOTH label copies so the old name cannot resurrect.- it("sends a label-only clear when the input is emptied", async () => {- renderWithI18n(<ProjectResourcesSection projectId="p1" />);-- fireEvent.click(screen.getByTitle(/rename/i));- const input = screen.getByRole("textbox");- fireEvent.change(input, { target: { value: " " } });- fireEvent.keyDown(input, { key: "Enter" });-- await waitFor(() => expect(updateMock).toHaveBeenCalledTimes(1));- const payload = updateMock.mock.calls[0]?.[0] as { data: unknown };- expect(payload.data).toEqual({ label: "" });- expect(payload.data).not.toHaveProperty("resource_ref");- });-});diff --git a/packages/views/projects/components/project-resources-section.tsx b/packages/views/projects/components/project-resources-section.tsxindex e1804af070..4c46d33211 100644--- a/packages/views/projects/components/project-resources-section.tsx+++ b/packages/views/projects/components/project-resources-section.tsx@@ -7,7 +7,6 @@ import {FolderGit,FolderOpen,GitBranch,- Pencil,Plus,Search,Trash2,@@ -375,37 +374,6 @@ export function ProjectResourcesSection({ projectId }: { projectId: string }) {}};- const handleRenameLocalDirectory = async (- resource: ProjectResource & { resource_ref: LocalDirectoryResourceRef },- nextLabel: string,- ) => {- const trimmed = nextLabel.trim();- if (trimmed === localDirectoryLabel(resource)) return;- try {- // Top-level label ONLY — renaming must not resend resource_ref.- //- // The server replaces the ref wholesale with whatever it can parse, so a- // server that predates a ref field drops it and answers 200. On a backend- // rolled back below v0.4.25 (documented as supported while the runtimes- // stay current) that turned "rename this folder" into "silently forget- // this folder was isolated", and the next task edited the working copy- // (#7113). Omitting the ref keeps the stored one untouched on every- // server version — the same reason it must not be resent for any other- // unrelated edit either.- await updateResource.mutateAsync({- resourceId: resource.id,- data: { label: trimmed },- });- toast.success(t(($) => $.resources.toast_local_renamed));- } catch (err) {- const msg =- err instanceof Error- ? err.message- : t(($) => $.resources.toast_local_rename_failed);- toast.error(msg);- }- };-return (<div><button@@ -432,13 +400,11 @@ export function ProjectResourcesSection({ projectId }: { projectId: string }) {key={resource.id}resource={resource}localDaemonId={localDaemonId}- canEdit={desktopMode}onRemove={() => handleRemove(resource)}onEditGithubRef={(target) => {setRefError(null);setRefDialog({ resource: target });}}- onRenameLocalDirectory={handleRenameLocalDirectory}onEditLocalDirectoryMode={(target) => {setModeError(null);setModeDialog({@@ -649,15 +615,10 @@ function worktreeUnavailableReason(interface ResourceRowProps {resource: ProjectResource;localDaemonId: string | null;- canEdit: boolean;onRemove: () => void;onEditGithubRef: (resource: ProjectResource & { resource_ref: GithubRepoResourceRef },) => void;- onRenameLocalDirectory: (- resource: ProjectResource & { resource_ref: LocalDirectoryResourceRef },- nextLabel: string,- ) => Promise<void>;onEditLocalDirectoryMode: (resource: ProjectResource & { resource_ref: LocalDirectoryResourceRef },) => void;@@ -666,10 +627,8 @@ interface ResourceRowProps {function ResourceRow({resource,localDaemonId,- canEdit,onRemove,onEditGithubRef,- onRenameLocalDirectory,onEditLocalDirectoryMode,}: ResourceRowProps) {const { t } = useT("projects");@@ -749,9 +708,7 @@ function ResourceRow({<LocalDirectoryRowresource={resource}localDaemonId={localDaemonId}- canEdit={canEdit}onRemove={onRemove}- onRename={onRenameLocalDirectory}onEditMode={onEditLocalDirectoryMode}/>);@@ -777,12 +734,7 @@ function ResourceRow({interface LocalDirectoryRowProps {resource: ProjectResource & { resource_ref: LocalDirectoryResourceRef };localDaemonId: string | null;- canEdit: boolean;onRemove: () => void;- onRename: (- resource: ProjectResource & { resource_ref: LocalDirectoryResourceRef },- nextLabel: string,- ) => Promise<void>;onEditMode: (resource: ProjectResource & { resource_ref: LocalDirectoryResourceRef },) => void;@@ -791,9 +743,7 @@ interface LocalDirectoryRowProps {function LocalDirectoryRow({resource,localDaemonId,- canEdit,onRemove,- onRename,onEditMode,}: LocalDirectoryRowProps) {const { t } = useT("projects");@@ -803,28 +753,11 @@ function LocalDirectoryRow({const isForeignDaemon =localDaemonId !== null && ref.daemon_id !== localDaemonId;const isLocalUnknown = localDaemonId === null;- // "disabled" in the spec sense — visual de-emphasis + no chat hint, and- // rename is hidden on foreign / unknown-daemon rows because the label- // belongs to the owning device. Delete stays available so the user can- // drop a stale registration from any device.+ // "disabled" in the spec sense — visual de-emphasis + no chat hint. Both+ // actions stay available so the user can drop or reconfigure a stale+ // registration from any device.const mismatch = isForeignDaemon || isLocalUnknown;- const [editing, setEditing] = useState(false);- const [draft, setDraft] = useState(display);-- const startEdit = () => {- setDraft(display);- setEditing(true);- };- const commit = async () => {- setEditing(false);- await onRename(resource, draft);- };- const cancel = () => {- setEditing(false);- setDraft(display);- };-return (<divclassName={`flex items-center gap-2 text-caption group ${@@ -832,50 +765,32 @@ function LocalDirectoryRow({}`}><FolderOpen className="size-3.5 text-muted-foreground shrink-0" />- {editing ? (- <input- autoFocus- value={draft}- onChange={(e) => setDraft(e.target.value)}- onBlur={() => void commit()}- onKeyDown={(e) => {- if (e.key === "Enter") {- e.preventDefault();- void commit();- } else if (e.key === "Escape") {- e.preventDefault();- cancel();- }- }}- className="flex-1 min-w-0 rounded-sm border bg-transparent px-1 py-0.5 text-caption outline-none focus-visible:ring-1 focus-visible:ring-ring"- aria-label={t(($) => $.resources.local_rename_label)}+ {/* The name is the folder's own (or whatever a label update stored);+ there is deliberately no rename here. A folder is identified by its+ path, and a pencil that only retitled the row read as a broken edit+ action beside the branch and remove controls (MUL-7525). */}+ <Tooltip>+ <TooltipTrigger+ render={<span className="truncate flex-1">{display}</span>}/>- ) : (- <Tooltip>- <TooltipTrigger- render={- <span className="truncate flex-1">{display}</span>- }- />- <TooltipContent side="top">- <div className="space-y-0.5 text-micro">- <div className="font-mono">{ref.local_path}</div>- {mismatch && (- <div className="text-muted-foreground">- {isLocalUnknown- ? t(($) => $.resources.local_no_daemon_tooltip)- : t(($) => $.resources.local_other_machine_tooltip)}- </div>- )}- </div>- </TooltipContent>- </Tooltip>- )}+ <TooltipContent side="top">+ <div className="space-y-0.5 text-micro">+ <div className="font-mono">{ref.local_path}</div>+ {mismatch && (+ <div className="text-muted-foreground">+ {isLocalUnknown+ ? t(($) => $.resources.local_no_daemon_tooltip)+ : t(($) => $.resources.local_other_machine_tooltip)}+ </div>+ )}+ </div>+ </TooltipContent>+ </Tooltip>{/* Always visible, unlike the hover-only actions: without it there is noway to tell whether tasks on this folder edit it directly or hand backa branch, which is the first thing someone asks when a task queues (ordoes not). */}- {mode === "worktree" && !editing && (+ {mode === "worktree" && (<Tooltip><TooltipTriggerrender={@@ -891,28 +806,16 @@ function LocalDirectoryRow({</Tooltip>)}{/* Not gated on `mismatch`: switching the mode only rewrites a field, so- it works from the web app or another device, unlike rename (whose- label belongs to the owning machine) or the folder picker. */}- {!editing && (- <button- type="button"- onClick={() => onEditMode(resource)}- className="opacity-0 group-hover:opacity-100 transition-opacity rounded-sm p-0.5 hover:bg-accent"- title={t(($) => $.resources.mode_edit_tooltip)}- >- <GitBranch className="size-3 text-muted-foreground" />- </button>- )}- {canEdit && !mismatch && !editing && (- <button- type="button"- onClick={startEdit}- className="opacity-0 group-hover:opacity-100 transition-opacity rounded-sm p-0.5 hover:bg-accent"- title={t(($) => $.resources.local_rename_tooltip)}- >- <Pencil className="size-3 text-muted-foreground" />- </button>- )}+ it works from the web app or another device, unlike the folder+ picker. */}+ <button+ type="button"+ onClick={() => onEditMode(resource)}+ className="opacity-0 group-hover:opacity-100 transition-opacity rounded-sm p-0.5 hover:bg-accent"+ title={t(($) => $.resources.mode_edit_tooltip)}+ >+ <GitBranch className="size-3 text-muted-foreground" />+ </button><buttontype="button"onClick={onRemove}