Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go

refactor(views): split project resources into repositories and per-computer folders (MUL-9011) (#10366)

Jiayuan Zhanga305602ea3d0
diff --git a/e2e/project-resource-ref.spec.ts b/e2e/project-resource-ref.spec.ts
index da903e2fe6..3da01ee7bd 100644
--- a/e2e/project-resource-ref.spec.ts
+++ b/e2e/project-resource-ref.spec.ts
@@ -30,8 +30,8 @@ test("pins, edits and clears a repository's checkout ref", async ({ page }) => {
await expect(page.getByText("release/2026-09")).toBeVisible({ timeout: 15000 });
// Editing an attached resource — the affordance the UI never had.
- await page.getByTitle(/change the branch tasks work on/i).first().click();
- await expect(page.getByText(/which branch should tasks work on/i)).toBeVisible();
+ await page.getByRole("button", { name: "release/2026-09" }).click();
+ await expect(page.getByLabel(/starting branch/i)).toBeVisible();
// A ref git could not resolve is refused before it is stored, rather than
// failing minutes later inside a task with a repo-cache error.
@@ -50,7 +50,7 @@ test("pins, edits and clears a repository's checkout ref", async ({ page }) => {
await expect(page.getByText("multica-ai/multica")).toBeVisible();
// Clearing goes back to the repository's default branch.
- await page.getByTitle(/change the branch tasks work on/i).first().click();
+ await page.getByRole("button", { name: "v1.4.0" }).click();
await page.getByLabel(/starting branch/i).fill("");
await page.getByRole("button", { name: /^save$/i }).click();
await expect(page.getByText("v1.4.0")).toHaveCount(0, { timeout: 10000 });
diff --git a/packages/views/locales/en/modals.json b/packages/views/locales/en/modals.json
index 6cb173fc71..75889a2eec 100644
--- a/packages/views/locales/en/modals.json
+++ b/packages/views/locales/en/modals.json
@@ -144,27 +144,27 @@
"repos_pill": "Repos",
"repos_pill_count_one": "{{count}} repo",
"repos_pill_count_other": "{{count}} repos",
- "repos_heading": "Attach GitHub repos to this project",
- "repos_empty": "No workspace-level repos yet. Paste a URL below to attach one ad-hoc.",
+ "repos_heading": "Add GitHub repos to this project",
+ "repos_empty": "No workspace repositories yet. Paste a URL below to add one.",
"repos_search_placeholder": "Search repositories...",
"repos_search_empty": "No repositories match your search.",
"repos_url_placeholder": "https://github.com/owner/repo or [email protected]:owner/repo.git",
"repos_add": "Add",
"repos_selected": "Selected",
- "source_pill_local": "Local directory",
+ "source_pill_local": "Local folder",
"source_tab_repos": "GitHub repos",
- "source_tab_local": "Local directory",
- "local_heading": "Use a local working directory on this machine",
+ "source_tab_local": "Local folder",
+ "local_heading": "Use a folder on this computer",
"local_on_device": "Bound to {{device}}",
"local_this_machine": "this machine",
- "local_daemon_offline": "Daemon offline — start it to bind a local directory.",
- "local_pick": "Choose directory…",
- "local_picking": "Opening picker…",
- "local_change": "Change directory…",
+ "local_daemon_offline": "Daemon offline. Start it to choose a folder.",
+ "local_pick": "Choose folder...",
+ "local_picking": "Opening picker...",
+ "local_change": "Change folder...",
"local_clear": "Clear",
- "local_pick_failed": "Could not open the directory picker.",
- "local_invalid_dir": "This directory can't be used. Pick another.",
- "local_hint": "Agents on other machines won't see this path — they'll fail to start. Use repos for shared work.",
+ "local_pick_failed": "Couldn't open the folder picker.",
+ "local_invalid_dir": "This folder can't be used. Choose another.",
+ "local_hint": "Agents on other computers can't reach this folder and won't start. Use repos for shared work.",
"repos_ref_default": "Default branch",
"repos_remove_aria": "Remove {{repo}}"
},
diff --git a/packages/views/locales/en/projects.json b/packages/views/locales/en/projects.json
index eaf9cdb51a..3da4a97a03 100644
--- a/packages/views/locales/en/projects.json
+++ b/packages/views/locales/en/projects.json
@@ -86,73 +86,65 @@
},
"resources": {
"section_header": "Resources",
- "empty": "No resources attached.",
- "add_button": "Add resource",
- "popover_title": "Attach a GitHub repo",
- "repos_search_placeholder": "Search repositories...",
- "repos_search_empty": "No repositories match your search.",
- "attached_badge": "attached",
+ "repos_group": "Repositories",
+ "repos_add": "Add repository",
+ "repos_empty": "No repositories yet.",
+ "repos_input_placeholder": "Search or paste a GitHub URL...",
+ "repos_add_url": "Add {{repo}}",
+ "repos_search_empty": "No matching repositories.",
+ "attached_badge": "Added",
"remove_tooltip": "Remove",
- "url_placeholder": "https://github.com/owner/repo or [email protected]:owner/repo.git",
- "url_submit": "Add",
- "toast_attached": "Repository attached",
- "toast_attach_failed": "Failed to attach",
- "toast_removed": "Resource removed",
- "toast_remove_failed": "Failed to remove resource",
- "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_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.",
+ "toast_attached": "Repository added",
+ "toast_attach_failed": "Couldn't add",
+ "toast_removed": "Removed",
+ "toast_remove_failed": "Couldn't remove",
+ "local_group": "Local folders",
+ "local_group_hint": "One per computer, used only on that computer.",
+ "local_this_computer": "This computer",
+ "local_unknown_computer": "Another computer",
+ "local_offline": "Offline",
+ "local_slot_description": "Runs on this computer use your folder instead of a fresh checkout.",
+ "local_pick": "Choose folder...",
+ "local_daemon_offline_hint": "Start the local daemon to choose a folder.",
"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_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.",
- "toast_local_daemon_not_running": "Local daemon isn't running.",
- "local_validate_not_absolute": "Pick an absolute path.",
- "local_validate_not_found": "Path doesn't exist.",
- "local_validate_not_a_directory": "Path is not a directory.",
- "local_validate_not_readable": "Directory is not readable.",
- "local_validate_not_writable": "Directory is not writable.",
- "local_validate_unsupported": "Local directories can only be picked on the desktop app.",
- "mode_dialog_title": "How should runs use this folder?",
- "mode_dialog_description": "This decides how you get an agent's work back, and whether runs on this folder can execute at the same time.",
- "mode_in_place_title": "Edit this folder directly",
- "mode_in_place_description": "One run at a time. Changes appear in your working copy as the agent makes them, ready for you to keep working on.",
- "mode_worktree_title": "Run in parallel, isolated",
- "mode_worktree_description": "Runs execute at the same time without touching your working copy. Each one hands back an agent/… branch in this repo for you to review and merge.",
- "mode_worktree_needs_git": "This folder is not a git repository, so there is nowhere to put the branch. Pick a repository, or keep editing the folder directly.",
- "mode_worktree_needs_server_upgrade": "Your Multica server is too old to execute runs in parallel — it would quietly execute them in this folder instead. Update the server, then switch this on.",
+ "toast_local_attached": "Folder added",
+ "toast_local_pick_failed": "Couldn't choose the folder",
+ "local_validate_not_absolute": "Choose an absolute path.",
+ "local_validate_not_found": "Folder doesn't exist.",
+ "local_validate_not_a_directory": "That path isn't a folder.",
+ "local_validate_not_readable": "Folder isn't readable.",
+ "local_validate_not_writable": "Folder isn't writable.",
+ "local_validate_unsupported": "Folders can only be chosen in the desktop app.",
+ "mode_in_place_title": "Edit directly",
+ "mode_in_place_description": "One run at a time. Changes land straight in this folder.",
+ "mode_worktree_title": "Run in parallel",
+ "mode_worktree_description": "Runs happen side by side without touching your working copy. Each hands back an agent/… branch to review and merge.",
+ "mode_worktree_needs_git": "This folder is not a git repository, so runs can't be parallel.",
+ "mode_worktree_needs_server_upgrade": "Your Multica server is too old for parallel runs and would run them in this folder instead. Update the server first.",
"mode_cancel": "Cancel",
- "mode_save": "Save",
"mode_add": "Add folder",
- "mode_edit_tooltip": "Change how runs use this folder",
+ "mode_edit_tooltip": "Change run mode",
"mode_badge_worktree": "Parallel",
- "mode_badge_worktree_tooltip": "Runs execute at the same time in their own git worktree and hand back a branch. Your working copy is untouched.",
- "toast_local_mode_updated": "Execution mode updated",
- "toast_local_mode_update_failed": "Could not update the execution mode",
+ "toast_local_mode_updated": "Run mode updated",
+ "toast_local_mode_update_failed": "Couldn't update the run mode",
"mode_badge_in_place": "Direct",
"ref_label": "Starting branch",
"ref_placeholder": "main",
- "ref_hint": "Tasks start from this branch and open their pull requests against it. Leave empty to use the repository's default branch.",
+ "ref_hint": "Tasks start here and open pull requests against it. Leave empty for the default branch.",
"ref_error_too_long": "Use at most 255 characters.",
- "ref_error_characters": "A git ref can't contain spaces or any of ~ ^ : ? * [ \\",
- "ref_error_format": "Not a valid branch, tag, or commit.",
- "ref_dialog_title": "Which branch should tasks work on?",
- "ref_dialog_description": "New tasks in this project check out this branch and open their pull requests against it. Work already underway keeps the branch it started on.",
+ "ref_error_characters": "Branch names can't contain spaces or ~ ^ : ? * [ \\",
+ "ref_error_format": "Not a valid branch name.",
"ref_cancel": "Cancel",
"ref_save": "Save",
- "ref_edit_tooltip": "Change the branch tasks work on",
- "ref_badge_tooltip": "Tasks start from {{ref}} and deliver back to it.",
+ "ref_edit_tooltip": "Change starting branch",
"toast_ref_updated": "Branch updated",
"toast_ref_cleared": "Back to the default branch",
- "toast_ref_update_failed": "Could not update the branch",
- "ref_error_commit": "That's a commit, not a branch. Tasks deliver back to the branch they start from — for a one-off revision, pass --ref to multica repo checkout.",
+ "toast_ref_update_failed": "Couldn't update the branch",
+ "ref_error_commit": "That's a commit, not a branch. For a specific revision, use --ref with multica repo checkout.",
"ref_default_label": "Default branch",
- "ref_default_tooltip": "No branch set — tasks use whatever the repository's default branch is at the time."
+ "ref_running_note": "Tasks already running aren't affected."
},
"delete_dialog": {
"offline_error": "You're offline. Reconnect and try deleting again.",
diff --git a/packages/views/locales/es/modals.json b/packages/views/locales/es/modals.json
index 017dfb2790..73f6961254 100644
--- a/packages/views/locales/es/modals.json
+++ b/packages/views/locales/es/modals.json
@@ -119,27 +119,27 @@
"repos_pill": "Repos",
"repos_pill_count_one": "{{count}} repo",
"repos_pill_count_other": "{{count}} repos",
- "repos_heading": "Adjunta repos de GitHub a este proyecto",
- "repos_empty": "Aún no hay repos a nivel de espacio de trabajo. Pega una URL abajo para adjuntar uno ad hoc.",
+ "repos_heading": "Añade repositorios de GitHub a este proyecto",
+ "repos_empty": "Aún no hay repositorios en el espacio de trabajo. Pega una URL abajo para añadir uno.",
"repos_search_placeholder": "Buscar repositorios...",
"repos_search_empty": "Ningún repositorio coincide con tu búsqueda.",
"repos_url_placeholder": "https://github.com/owner/repo o [email protected]:owner/repo.git",
"repos_add": "Añadir",
"repos_selected": "Seleccionados",
- "source_pill_local": "Directorio local",
+ "source_pill_local": "Carpeta local",
"source_tab_repos": "Repos de GitHub",
- "source_tab_local": "Directorio local",
- "local_heading": "Usa un directorio de trabajo local en esta máquina",
+ "source_tab_local": "Carpeta local",
+ "local_heading": "Usar una carpeta de este ordenador",
"local_on_device": "Vinculado a {{device}}",
"local_this_machine": "esta máquina",
- "local_daemon_offline": "Daemon sin conexión: arráncalo para vincular un directorio local.",
- "local_pick": "Elegir directorio…",
- "local_picking": "Abriendo el selector…",
- "local_change": "Cambiar directorio…",
+ "local_daemon_offline": "El daemon está detenido. Inícialo para elegir una carpeta.",
+ "local_pick": "Elegir carpeta...",
+ "local_picking": "Abriendo selector...",
+ "local_change": "Cambiar carpeta...",
"local_clear": "Limpiar",
- "local_pick_failed": "No se ha podido abrir el selector de directorios.",
- "local_invalid_dir": "Este directorio no se puede usar. Elige otro.",
- "local_hint": "Los agentes en otras máquinas no verán esta ruta: fallarán al arrancar. Usa repos para trabajo compartido.",
+ "local_pick_failed": "No se ha podido abrir el selector de carpetas.",
+ "local_invalid_dir": "Esta carpeta no se puede usar. Elige otra.",
+ "local_hint": "Los agentes de otros ordenadores no pueden acceder a esta carpeta y no arrancarán. Usa repositorios para el trabajo compartido.",
"repos_ref_default": "Rama por defecto",
"repos_remove_aria": "Quitar {{repo}}"
},
diff --git a/packages/views/locales/es/projects.json b/packages/views/locales/es/projects.json
index 57bc00a5a7..bc8443e58c 100644
--- a/packages/views/locales/es/projects.json
+++ b/packages/views/locales/es/projects.json
@@ -86,73 +86,65 @@
},
"resources": {
"section_header": "Recursos",
- "empty": "Sin recursos adjuntos.",
- "add_button": "Añadir recurso",
- "popover_title": "Adjuntar un repositorio de GitHub",
- "repos_search_placeholder": "Buscar repositorios...",
- "repos_search_empty": "Ningún repositorio coincide con tu búsqueda.",
- "attached_badge": "adjunto",
+ "repos_group": "Repositorios",
+ "repos_add": "Añadir repositorio",
+ "repos_empty": "Aún no hay repositorios.",
+ "repos_input_placeholder": "Busca o pega una URL de GitHub...",
+ "repos_add_url": "Añadir {{repo}}",
+ "repos_search_empty": "Ningún repositorio coincide.",
+ "attached_badge": "Añadido",
"remove_tooltip": "Quitar",
- "url_placeholder": "https://github.com/owner/repo o [email protected]:owner/repo.git",
- "url_submit": "Añadir",
- "toast_attached": "Repositorio adjuntado",
- "toast_attach_failed": "No se ha podido adjuntar",
- "toast_removed": "Recurso eliminado",
- "toast_remove_failed": "No se ha podido eliminar el recurso",
- "add_local_directory_button": "Añadir directorio local",
- "local_daemon_offline_hint": "Inicia el daemon local para adjuntar un directorio de esta máquina.",
- "local_daemon_already_attached_hint": "Esta máquina ya tiene un directorio local adjunto. Quítalo antes de añadir otro.",
- "local_no_daemon_tooltip": "El daemon local aún no reporta un ID; el agente no puede abrir este directorio.",
- "local_other_machine_tooltip": "Solo disponible en la máquina que registró este directorio.",
+ "toast_attached": "Repositorio añadido",
+ "toast_attach_failed": "No se ha podido añadir",
+ "toast_removed": "Eliminado",
+ "toast_remove_failed": "No se ha podido eliminar",
+ "local_group": "Carpetas locales",
+ "local_group_hint": "Una por ordenador; solo se usa en ese ordenador.",
+ "local_this_computer": "Este ordenador",
+ "local_unknown_computer": "Otro ordenador",
+ "local_offline": "Sin conexión",
+ "local_slot_description": "Las ejecuciones en este ordenador usan tu carpeta en lugar de una copia nueva.",
+ "local_pick": "Elegir carpeta...",
+ "local_daemon_offline_hint": "Inicia el daemon local para elegir una carpeta.",
"chat_hint_prefix": "El agente trabajará directamente en",
"chat_hint_worktree_prefix": "El agente trabajará en un worktree aislado de",
"chat_hint_worktree_note": "Tu copia de trabajo queda intacta; cada ejecución devuelve su trabajo en una rama agent/… .",
- "toast_local_attached": "Directorio local adjuntado",
- "toast_local_pick_failed": "No se ha podido elegir el directorio",
- "toast_local_already_attached": "Este directorio ya está adjunto al proyecto en esta máquina.",
- "toast_local_daemon_already_attached": "Esta máquina ya tiene un directorio local adjunto a este proyecto. Quítalo antes de añadir otro.",
- "toast_local_daemon_not_running": "El daemon local no está en ejecución.",
+ "toast_local_attached": "Carpeta añadida",
+ "toast_local_pick_failed": "No se ha podido elegir la carpeta",
"local_validate_not_absolute": "Elige una ruta absoluta.",
- "local_validate_not_found": "La ruta no existe.",
- "local_validate_not_a_directory": "La ruta no es un directorio.",
- "local_validate_not_readable": "El directorio no tiene permiso de lectura.",
- "local_validate_not_writable": "El directorio no tiene permiso de escritura.",
- "local_validate_unsupported": "Los directorios locales solo se pueden elegir en la app de escritorio.",
- "mode_dialog_title": "¿Cómo deben usar las ejecuciones esta carpeta?",
- "mode_dialog_description": "Esto decide cómo recuperas el trabajo de un agente y si las ejecuciones sobre esta carpeta pueden ejecutarse a la vez.",
- "mode_in_place_title": "Editar esta carpeta directamente",
- "mode_in_place_description": "Una ejecución cada vez. Los cambios aparecen en tu copia de trabajo según los hace el agente, listos para que sigas trabajando.",
- "mode_worktree_title": "Ejecutar en paralelo, aislado",
- "mode_worktree_description": "Las ejecuciones se ejecutan a la vez sin tocar tu copia de trabajo. Cada una devuelve una rama agent/… en este repositorio para que la revises y la fusiones.",
- "mode_worktree_needs_git": "Esta carpeta no es un repositorio git, así que no hay dónde crear la rama. Elige un repositorio o sigue editando la carpeta directamente.",
- "mode_worktree_needs_server_upgrade": "Tu servidor de Multica es demasiado antiguo para ejecutar ejecuciones en paralelo; las ejecutaría en silencio en esta carpeta. Actualiza el servidor y activa esta opción.",
+ "local_validate_not_found": "La carpeta no existe.",
+ "local_validate_not_a_directory": "La ruta no es una carpeta.",
+ "local_validate_not_readable": "La carpeta no tiene permiso de lectura.",
+ "local_validate_not_writable": "La carpeta no tiene permiso de escritura.",
+ "local_validate_unsupported": "Las carpetas solo se pueden elegir en la app de escritorio.",
+ "mode_in_place_title": "Editar directamente",
+ "mode_in_place_description": "Una ejecución cada vez. Los cambios se escriben directamente en esta carpeta.",
+ "mode_worktree_title": "Ejecutar en paralelo",
+ "mode_worktree_description": "Las ejecuciones van a la vez sin tocar tu copia de trabajo. Cada una devuelve una rama agent/… para revisar y fusionar.",
+ "mode_worktree_needs_git": "Esta carpeta no es un repositorio git, así que no puede ejecutarse en paralelo.",
+ "mode_worktree_needs_server_upgrade": "Tu servidor de Multica es demasiado antiguo para ejecuciones en paralelo y las haría en esta carpeta. Actualiza primero el servidor.",
"mode_cancel": "Cancelar",
- "mode_save": "Guardar",
"mode_add": "Añadir carpeta",
- "mode_edit_tooltip": "Cambiar cómo usan las ejecuciones esta carpeta",
+ "mode_edit_tooltip": "Cambiar modo de ejecución",
"mode_badge_worktree": "Paralelo",
- "mode_badge_worktree_tooltip": "Las ejecuciones se ejecutan a la vez en su propio worktree git y devuelven una rama. Tu copia de trabajo queda intacta.",
"toast_local_mode_updated": "Modo de ejecución actualizado",
"toast_local_mode_update_failed": "No se ha podido actualizar el modo de ejecución",
"mode_badge_in_place": "Directo",
"ref_label": "Rama inicial",
"ref_placeholder": "main",
- "ref_hint": "Las ejecuciones parten de esta rama y abren sus pull requests contra ella. Déjala vacía para usar la rama por defecto del repositorio.",
+ "ref_hint": "Las tareas parten de esta rama y abren sus pull requests contra ella. Déjala vacía para usar la rama por defecto.",
"ref_error_too_long": "Usa como máximo 255 caracteres.",
- "ref_error_characters": "Una referencia git no puede contener espacios ni ninguno de estos caracteres: ~ ^ : ? * [ \\",
- "ref_error_format": "No es una rama, etiqueta o commit válido.",
- "ref_dialog_title": "¿En qué rama deben trabajar las ejecuciones?",
- "ref_dialog_description": "Las nuevas ejecuciones de este proyecto parten de esta rama y abren sus pull requests contra ella. El trabajo ya en curso sigue en la rama en la que empezó.",
+ "ref_error_characters": "El nombre de la rama no puede contener espacios ni ~ ^ : ? * [ \\",
+ "ref_error_format": "No es un nombre de rama válido.",
"ref_cancel": "Cancelar",
"ref_save": "Guardar",
- "ref_edit_tooltip": "Cambiar la rama en la que trabajan las ejecuciones",
- "ref_badge_tooltip": "Las ejecuciones parten de {{ref}} y fusionan sus cambios en ella.",
+ "ref_edit_tooltip": "Cambiar la rama inicial",
"toast_ref_updated": "Rama actualizada",
"toast_ref_cleared": "De vuelta a la rama por defecto",
"toast_ref_update_failed": "No se ha podido actualizar la rama",
- "ref_error_commit": "Eso es un commit, no una rama. Las ejecuciones fusionan sus cambios en la rama de la que parten; para una revisión puntual, pasa --ref a multica repo checkout.",
+ "ref_error_commit": "Eso es un commit, no una rama. Para una revisión concreta, usa --ref con multica repo checkout.",
"ref_default_label": "Rama por defecto",
- "ref_default_tooltip": "Sin rama definida: las ejecuciones usan la rama por defecto que tenga el repositorio en ese momento."
+ "ref_running_note": "Las tareas en curso no se ven afectadas."
},
"delete_dialog": {
"offline_error": "Estás sin conexión. Vuelve a conectarte e intenta eliminar de nuevo.",
diff --git a/packages/views/locales/fr/modals.json b/packages/views/locales/fr/modals.json
index b04bb4bb90..212d7eeac0 100644
--- a/packages/views/locales/fr/modals.json
+++ b/packages/views/locales/fr/modals.json
@@ -144,27 +144,27 @@
"repos_pill": "Dépôts",
"repos_pill_count_one": "{{count}} dépôt",
"repos_pill_count_other": "{{count}} dépôts",
- "repos_heading": "Rattacher des dépôts GitHub à ce projet",
- "repos_empty": "Aucun dépôt au niveau de l'espace de travail. Collez une URL ci-dessous pour en rattacher un ponctuellement.",
+ "repos_heading": "Ajouter des dépôts GitHub à ce projet",
+ "repos_empty": "Aucun dépôt dans l'espace de travail. Collez une URL ci-dessous pour en ajouter un.",
"repos_search_placeholder": "Rechercher des dépôts...",
"repos_search_empty": "Aucun dépôt ne correspond à votre recherche.",
"repos_url_placeholder": "https://github.com/owner/repo ou [email protected]:owner/repo.git",
"repos_add": "Ajouter",
"repos_selected": "Sélectionnés",
- "source_pill_local": "Répertoire local",
+ "source_pill_local": "Dossier local",
"source_tab_repos": "Dépôts GitHub",
- "source_tab_local": "Répertoire local",
- "local_heading": "Utiliser un répertoire de travail local sur cette machine",
+ "source_tab_local": "Dossier local",
+ "local_heading": "Utiliser un dossier de cet ordinateur",
"local_on_device": "Rattaché à {{device}}",
"local_this_machine": "cette machine",
- "local_daemon_offline": "Daemon hors ligne — démarrez-le pour rattacher un répertoire local.",
- "local_pick": "Choisir un répertoire…",
- "local_picking": "Ouverture du sélecteur…",
- "local_change": "Changer de répertoire…",
+ "local_daemon_offline": "Daemon arrêté. Démarrez-le pour choisir un dossier.",
+ "local_pick": "Choisir un dossier...",
+ "local_picking": "Ouverture du sélecteur...",
+ "local_change": "Changer de dossier...",
"local_clear": "Effacer",
- "local_pick_failed": "Impossible d'ouvrir le sélecteur de répertoire.",
- "local_invalid_dir": "Ce répertoire ne peut pas être utilisé. Choisissez-en un autre.",
- "local_hint": "Les agents des autres machines ne verront pas ce chemin — ils ne pourront pas démarrer. Utilisez des dépôts pour le travail partagé.",
+ "local_pick_failed": "Impossible d'ouvrir le sélecteur de dossier.",
+ "local_invalid_dir": "Ce dossier ne peut pas être utilisé. Choisissez-en un autre.",
+ "local_hint": "Les agents d'autres ordinateurs n'ont pas accès à ce dossier et ne démarreront pas. Utilisez des dépôts pour le travail partagé.",
"repos_ref_default": "Branche par défaut",
"repos_remove_aria": "Retirer {{repo}}"
},
diff --git a/packages/views/locales/fr/projects.json b/packages/views/locales/fr/projects.json
index 21ef6ad950..f2ae319366 100644
--- a/packages/views/locales/fr/projects.json
+++ b/packages/views/locales/fr/projects.json
@@ -86,73 +86,65 @@
},
"resources": {
"section_header": "Ressources",
- "empty": "Aucune ressource rattachée.",
- "add_button": "Ajouter une ressource",
- "popover_title": "Rattacher un dépôt GitHub",
- "repos_search_placeholder": "Rechercher des dépôts...",
- "repos_search_empty": "Aucun dépôt ne correspond à votre recherche.",
- "attached_badge": "rattaché",
+ "repos_group": "Dépôts",
+ "repos_add": "Ajouter un dépôt",
+ "repos_empty": "Aucun dépôt pour l'instant.",
+ "repos_input_placeholder": "Rechercher ou coller une URL GitHub...",
+ "repos_add_url": "Ajouter {{repo}}",
+ "repos_search_empty": "Aucun dépôt correspondant.",
+ "attached_badge": "Ajouté",
"remove_tooltip": "Retirer",
- "url_placeholder": "https://github.com/owner/repo ou [email protected]:owner/repo.git",
- "url_submit": "Ajouter",
- "toast_attached": "Dépôt rattaché",
- "toast_attach_failed": "Échec du rattachement",
- "toast_removed": "Ressource retirée",
- "toast_remove_failed": "Échec du retrait de la ressource",
- "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_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.",
+ "toast_attached": "Dépôt ajouté",
+ "toast_attach_failed": "Échec de l'ajout",
+ "toast_removed": "Retiré",
+ "toast_remove_failed": "Échec du retrait",
+ "local_group": "Dossiers locaux",
+ "local_group_hint": "Un par ordinateur, utilisé uniquement sur cet ordinateur.",
+ "local_this_computer": "Cet ordinateur",
+ "local_unknown_computer": "Un autre ordinateur",
+ "local_offline": "Hors ligne",
+ "local_slot_description": "Les exécutions sur cet ordinateur utilisent votre dossier au lieu d'une nouvelle copie.",
+ "local_pick": "Choisir un dossier...",
+ "local_daemon_offline_hint": "Démarrez le daemon local pour choisir un dossier.",
"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_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.",
- "toast_local_daemon_not_running": "Le daemon local n'est pas démarré.",
+ "toast_local_attached": "Dossier ajouté",
+ "toast_local_pick_failed": "Échec de la sélection du dossier",
"local_validate_not_absolute": "Choisissez un chemin absolu.",
- "local_validate_not_found": "Ce chemin n'existe pas.",
- "local_validate_not_a_directory": "Ce chemin n'est pas un répertoire.",
- "local_validate_not_readable": "Le répertoire n'est pas lisible.",
- "local_validate_not_writable": "Le répertoire n'est pas inscriptible.",
- "local_validate_unsupported": "Les répertoires locaux ne peuvent être sélectionnés que dans l'application de bureau.",
- "mode_dialog_title": "Comment les exécutions doivent-elles utiliser ce dossier ?",
- "mode_dialog_description": "Ce choix détermine comment récupérer le travail d'un agent et si plusieurs exécutions peuvent utiliser ce dossier simultanément.",
- "mode_in_place_title": "Modifier ce dossier directement",
- "mode_in_place_description": "Une exécution à la fois. Les modifications apparaissent dans votre copie de travail au fur et à mesure, prêtes à être reprises.",
- "mode_worktree_title": "Exécuter en parallèle, en isolation",
- "mode_worktree_description": "Les exécutions ont lieu simultanément sans toucher à votre copie de travail. Chacune restitue une branche agent/… dans ce dépôt pour relecture et fusion.",
- "mode_worktree_needs_git": "Ce dossier n'est pas un dépôt git : il n'y a donc nulle part où placer la branche. Choisissez un dépôt, ou continuez à modifier le dossier directement.",
- "mode_worktree_needs_server_upgrade": "Votre serveur Multica est trop ancien pour lancer des exécutions en parallèle : il les lancerait silencieusement dans ce dossier. Mettez le serveur à jour avant d'activer cette option.",
+ "local_validate_not_found": "Ce dossier n'existe pas.",
+ "local_validate_not_a_directory": "Ce chemin n'est pas un dossier.",
+ "local_validate_not_readable": "Le dossier n'est pas lisible.",
+ "local_validate_not_writable": "Le dossier n'est pas inscriptible.",
+ "local_validate_unsupported": "Les dossiers ne peuvent être choisis que dans l'application de bureau.",
+ "mode_in_place_title": "Modifier directement",
+ "mode_in_place_description": "Une exécution à la fois. Les modifications arrivent directement dans ce dossier.",
+ "mode_worktree_title": "Exécuter en parallèle",
+ "mode_worktree_description": "Les exécutions ont lieu en même temps sans toucher à votre copie de travail. Chacune restitue une branche agent/… à relire et fusionner.",
+ "mode_worktree_needs_git": "Ce dossier n'est pas un dépôt git, il ne peut donc pas être exécuté en parallèle.",
+ "mode_worktree_needs_server_upgrade": "Votre serveur Multica est trop ancien pour les exécutions en parallèle et les lancerait dans ce dossier. Mettez d'abord le serveur à jour.",
"mode_cancel": "Annuler",
- "mode_save": "Enregistrer",
"mode_add": "Ajouter le dossier",
- "mode_edit_tooltip": "Modifier l'utilisation de ce dossier par les exécutions",
+ "mode_edit_tooltip": "Changer le mode d'exécution",
"mode_badge_worktree": "Parallèle",
- "mode_badge_worktree_tooltip": "Les exécutions ont lieu simultanément dans leur propre worktree git et restituent une branche. Votre copie de travail reste intacte.",
"toast_local_mode_updated": "Mode d'exécution mis à jour",
"toast_local_mode_update_failed": "Impossible de mettre à jour le mode d'exécution",
"mode_badge_in_place": "Direct",
"ref_label": "Branche de départ",
"ref_placeholder": "main",
- "ref_hint": "Les tâches démarrent depuis cette branche et y ouvrent leurs pull requests. Laissez vide pour utiliser la branche par défaut du dépôt.",
+ "ref_hint": "Les tâches démarrent depuis cette branche et y ouvrent leurs pull requests. Laissez vide pour la branche par défaut.",
"ref_error_too_long": "255 caractères maximum.",
- "ref_error_characters": "Une réf git ne peut pas contenir d'espace ni les caractères ~ ^ : ? * [ \\",
- "ref_error_format": "Branche, tag ou commit invalide.",
- "ref_dialog_title": "Sur quelle branche les tâches doivent-elles travailler ?",
- "ref_dialog_description": "Les nouvelles tâches de ce projet récupèrent cette branche et y ouvrent leurs pull requests. Le travail déjà engagé conserve la branche sur laquelle il a démarré.",
+ "ref_error_characters": "Un nom de branche ne peut pas contenir d'espace ni ~ ^ : ? * [ \\",
+ "ref_error_format": "Nom de branche invalide.",
"ref_cancel": "Annuler",
"ref_save": "Enregistrer",
- "ref_edit_tooltip": "Changer la branche de travail des tâches",
- "ref_badge_tooltip": "Les tâches démarrent depuis {{ref}} et y livrent leur travail.",
+ "ref_edit_tooltip": "Changer la branche de départ",
"toast_ref_updated": "Branche mise à jour",
"toast_ref_cleared": "Retour à la branche par défaut",
"toast_ref_update_failed": "Impossible de mettre à jour la branche",
- "ref_error_commit": "Ceci est un commit, pas une branche. Les tâches livrent sur la branche depuis laquelle elles démarrent — pour une révision ponctuelle, utilisez multica repo checkout --ref.",
+ "ref_error_commit": "Ceci est un commit, pas une branche. Pour une révision précise, utilisez multica repo checkout --ref.",
"ref_default_label": "Branche par défaut",
- "ref_default_tooltip": "Aucune branche définie — les tâches utilisent la branche par défaut du dépôt au moment voulu."
+ "ref_running_note": "Les tâches en cours ne sont pas affectées."
},
"delete_dialog": {
"offline_error": "Vous êtes hors ligne. Reconnectez-vous, puis réessayez la suppression.",
diff --git a/packages/views/locales/ja/modals.json b/packages/views/locales/ja/modals.json
index 8a1bb96630..2c8933fb41 100644
--- a/packages/views/locales/ja/modals.json
+++ b/packages/views/locales/ja/modals.json
@@ -142,27 +142,27 @@
"toast_failed": "プロジェクトを作成できませんでした",
"repos_pill": "リポジトリ",
"repos_pill_count_other": "{{count}} 個のリポジトリ",
- "repos_heading": "このプロジェクトに GitHub リポジトリを接続",
- "repos_empty": "まだワークスペースレベルのリポジトリがありません。下に URL を貼り付けてアドホックに接続してください。",
+ "repos_heading": "このプロジェクトに GitHub リポジトリを追加",
+ "repos_empty": "ワークスペースにリポジトリはまだありません。下に URL を貼り付けて追加できます。",
"repos_search_placeholder": "リポジトリを検索...",
"repos_search_empty": "検索に一致するリポジトリがありません。",
"repos_url_placeholder": "https://github.com/owner/repo または [email protected]:owner/repo.git",
"repos_add": "追加",
"repos_selected": "選択済み",
- "source_pill_local": "ローカルディレクトリ",
+ "source_pill_local": "ローカルフォルダ",
"source_tab_repos": "GitHub リポジトリ",
- "source_tab_local": "ローカルディレクトリ",
- "local_heading": "このマシンのローカル作業ディレクトリを使用",
+ "source_tab_local": "ローカルフォルダ",
+ "local_heading": "このコンピュータのフォルダを使う",
"local_on_device": "{{device}} にバインド済み",
"local_this_machine": "このマシン",
- "local_daemon_offline": "デーモンがオフラインです。ローカルディレクトリをバインドするには起動してください。",
- "local_pick": "ディレクトリを選択…",
- "local_picking": "選択画面を開いています…",
- "local_change": "ディレクトリを変更…",
+ "local_daemon_offline": "デーモンが停止しています。起動するとフォルダを選べます。",
+ "local_pick": "フォルダを選択...",
+ "local_picking": "選択画面を開いています...",
+ "local_change": "フォルダを変更...",
"local_clear": "クリア",
- "local_pick_failed": "ディレクトリ選択画面を開けませんでした。",
- "local_invalid_dir": "このディレクトリは使用できません。別のものを選択してください。",
- "local_hint": "他のマシンのエージェントはこのパスを参照できず、起動に失敗します。共有作業にはリポジトリを使用してください。",
+ "local_pick_failed": "フォルダの選択画面を開けませんでした。",
+ "local_invalid_dir": "このフォルダは使えません。別のフォルダを選んでください。",
+ "local_hint": "他のコンピュータのエージェントはこのフォルダにアクセスできず、起動に失敗します。共同作業にはリポジトリを使ってください。",
"repos_ref_default": "デフォルトブランチ",
"repos_remove_aria": "{{repo}} を削除"
},
diff --git a/packages/views/locales/ja/projects.json b/packages/views/locales/ja/projects.json
index 5db2739f8b..a12168d910 100644
--- a/packages/views/locales/ja/projects.json
+++ b/packages/views/locales/ja/projects.json
@@ -86,73 +86,65 @@
},
"resources": {
"section_header": "リソース",
- "empty": "添付されたリソースはありません。",
- "add_button": "リソースを追加",
- "popover_title": "GitHub リポジトリを添付",
- "repos_search_placeholder": "リポジトリを検索...",
- "repos_search_empty": "検索条件に一致するリポジトリはありません。",
- "attached_badge": "添付済み",
+ "repos_group": "リポジトリ",
+ "repos_add": "リポジトリを追加",
+ "repos_empty": "まだリポジトリがありません。",
+ "repos_input_placeholder": "検索、または GitHub の URL を貼り付け...",
+ "repos_add_url": "{{repo}} を追加",
+ "repos_search_empty": "一致するリポジトリはありません。",
+ "attached_badge": "追加済み",
"remove_tooltip": "削除",
- "url_placeholder": "https://github.com/owner/repo or [email protected]:owner/repo.git",
- "url_submit": "追加",
- "toast_attached": "リポジトリを添付しました",
- "toast_attach_failed": "添付できませんでした",
- "toast_removed": "リソースを削除しました",
- "toast_remove_failed": "リソースを削除できませんでした",
- "add_local_directory_button": "ローカルディレクトリを追加",
- "local_daemon_offline_hint": "このマシンのディレクトリを添付するには、ローカルデーモンを起動してください。",
- "local_daemon_already_attached_hint": "このマシンにはすでにローカルディレクトリが添付されています。新しく追加するには、先に既存のものを削除してください。",
- "local_no_daemon_tooltip": "ローカルデーモンがまだ ID を報告していないため、エージェントはこのディレクトリを開けません。",
- "local_other_machine_tooltip": "このディレクトリを登録したマシンでのみ利用できます。",
+ "toast_attached": "リポジトリを追加しました",
+ "toast_attach_failed": "追加できませんでした",
+ "toast_removed": "削除しました",
+ "toast_remove_failed": "削除できませんでした",
+ "local_group": "ローカルフォルダ",
+ "local_group_hint": "コンピュータごとに 1 つ。そのコンピュータでのみ使われます。",
+ "local_this_computer": "このコンピュータ",
+ "local_unknown_computer": "別のコンピュータ",
+ "local_offline": "オフライン",
+ "local_slot_description": "このコンピュータでの実行は、チェックアウトせずにあなたのフォルダを使います。",
+ "local_pick": "フォルダを選択...",
+ "local_daemon_offline_hint": "フォルダを選ぶには、ローカルデーモンを起動してください。",
"chat_hint_prefix": "エージェントは次の場所で直接作業します:",
"chat_hint_worktree_prefix": "エージェントは次のリポジトリの独立した worktree で作業します:",
"chat_hint_worktree_note": "作業コピーは変更されません。各実行の成果は agent/… ブランチとして返されます。",
- "toast_local_attached": "ローカルディレクトリを添付しました",
- "toast_local_pick_failed": "ディレクトリを選択できませんでした",
- "toast_local_already_attached": "このディレクトリはすでにこのマシンのプロジェクトに添付されています。",
- "toast_local_daemon_already_attached": "このマシンにはすでにこのプロジェクトのローカルディレクトリが添付されています。新しく追加するには、先に既存のものを削除してください。",
- "toast_local_daemon_not_running": "ローカルデーモンが実行されていません。",
+ "toast_local_attached": "フォルダを追加しました",
+ "toast_local_pick_failed": "フォルダを選択できませんでした",
"local_validate_not_absolute": "絶対パスを選択してください。",
- "local_validate_not_found": "パスが存在しません。",
- "local_validate_not_a_directory": "パスはディレクトリではありません。",
- "local_validate_not_readable": "ディレクトリを読み取れません。",
- "local_validate_not_writable": "ディレクトリに書き込めません。",
- "local_validate_unsupported": "ローカルディレクトリはデスクトップアプリでのみ選択できます。",
- "mode_dialog_title": "実行はこのフォルダをどう使いますか?",
- "mode_dialog_description": "エージェントの成果物を受け取る方法と、このフォルダの実行を同時に進められるかが決まります。",
- "mode_in_place_title": "このフォルダを直接編集する",
- "mode_in_place_description": "実行は一度に1つずつ。エージェントの変更はそのまま作業コピーに現れ、続けて作業できます。",
- "mode_worktree_title": "隔離して並行実行する",
- "mode_worktree_description": "実行は、作業コピーに触れずに並行して進みます。それぞれがこのリポジトリの agent/… ブランチを返すので、レビューしてマージします。",
- "mode_worktree_needs_git": "このフォルダは git リポジトリではないため、ブランチを作成できません。リポジトリを選ぶか、フォルダを直接編集してください。",
- "mode_worktree_needs_server_upgrade": "接続中の Multica サーバーが古いため並行実行に対応できません。このままでは、このフォルダ内で直接実行されます。サーバーを更新してから有効にしてください。",
+ "local_validate_not_found": "フォルダが存在しません。",
+ "local_validate_not_a_directory": "このパスはフォルダではありません。",
+ "local_validate_not_readable": "フォルダを読み取れません。",
+ "local_validate_not_writable": "フォルダに書き込めません。",
+ "local_validate_unsupported": "フォルダはデスクトップアプリでのみ選択できます。",
+ "mode_in_place_title": "直接編集",
+ "mode_in_place_description": "実行は一度に 1 つ。変更はこのフォルダに直接反映されます。",
+ "mode_worktree_title": "並行実行",
+ "mode_worktree_description": "作業コピーに触れずに並行して実行します。それぞれが agent/… ブランチを返すので、レビューしてマージします。",
+ "mode_worktree_needs_git": "このフォルダは git リポジトリではないため、並行実行できません。",
+ "mode_worktree_needs_server_upgrade": "Multica サーバーが古いため、並行実行はこのフォルダでの直接実行になってしまいます。先にサーバーを更新してください。",
"mode_cancel": "キャンセル",
- "mode_save": "保存",
"mode_add": "フォルダを追加",
- "mode_edit_tooltip": "実行がこのフォルダを使う方法を変更",
+ "mode_edit_tooltip": "実行モードを変更",
"mode_badge_worktree": "並行",
- "mode_badge_worktree_tooltip": "実行はそれぞれの git ワークツリーで並行して進み、ブランチとして成果を返します。作業コピーは変更されません。",
"toast_local_mode_updated": "実行モードを更新しました",
"toast_local_mode_update_failed": "実行モードを更新できませんでした",
"mode_badge_in_place": "直接",
"ref_label": "起点ブランチ",
"ref_placeholder": "main",
- "ref_hint": "タスクはこのブランチから開始し、プルリクエストもここへ作成します。空欄の場合はリポジトリのデフォルトブランチを使用します。",
+ "ref_hint": "タスクはこのブランチから開始し、プルリクエストもここへ作成します。空欄ならデフォルトブランチを使います。",
"ref_error_too_long": "255 文字以内で入力してください。",
- "ref_error_characters": "git ref にスペースや ~ ^ : ? * [ \\ は使用できません",
- "ref_error_format": "有効なブランチ、タグ、コミットではありません。",
- "ref_dialog_title": "タスクはどのブランチで作業しますか?",
- "ref_dialog_description": "このプロジェクトで新しく開始するタスクはこのブランチをチェックアウトし、プルリクエストもここへ作成します。進行中の作業は開始時のブランチのままです。",
+ "ref_error_characters": "ブランチ名にスペースや ~ ^ : ? * [ \\ は使えません",
+ "ref_error_format": "有効なブランチ名ではありません。",
"ref_cancel": "キャンセル",
"ref_save": "保存",
- "ref_edit_tooltip": "タスクが作業するブランチを変更",
- "ref_badge_tooltip": "タスクは {{ref}} から開始し、このブランチへ成果を返します。",
+ "ref_edit_tooltip": "起点ブランチを変更",
"toast_ref_updated": "ブランチを更新しました",
"toast_ref_cleared": "デフォルトブランチに戻しました",
"toast_ref_update_failed": "ブランチを更新できませんでした",
- "ref_error_commit": "これはコミットであり、ブランチではありません。タスクは開始したブランチへ成果を返します。特定のリビジョンだけが必要な場合は multica repo checkout --ref を使ってください。",
+ "ref_error_commit": "これはコミットで、ブランチではありません。特定のリビジョンが必要なら multica repo checkout --ref を使ってください。",
"ref_default_label": "デフォルトブランチ",
- "ref_default_tooltip": "ブランチ未設定 — タスクはその時点のリポジトリのデフォルトブランチを使用します。"
+ "ref_running_note": "進行中のタスクには影響しません。"
},
"delete_dialog": {
"offline_error": "オフラインです。接続を回復してから、もう一度削除してください。",
diff --git a/packages/views/locales/ko/modals.json b/packages/views/locales/ko/modals.json
index 3892128467..4d2dc728bc 100644
--- a/packages/views/locales/ko/modals.json
+++ b/packages/views/locales/ko/modals.json
@@ -142,27 +142,27 @@
"toast_failed": "프로젝트를 만들지 못했습니다",
"repos_pill": "저장소",
"repos_pill_count_other": "저장소 {{count}}개",
- "repos_heading": "이 프로젝트에 GitHub 저장소 연결",
- "repos_empty": "아직 워크스페이스 수준 저장소가 없습니다. 아래에 URL을 붙여 넣어 임시로 연결하세요.",
+ "repos_heading": "이 프로젝트에 GitHub 저장소 추가",
+ "repos_empty": "워크스페이스에 저장소가 아직 없습니다. 아래에 URL을 붙여넣어 추가하세요.",
"repos_search_placeholder": "저장소 검색...",
"repos_search_empty": "검색 결과와 일치하는 저장소가 없습니다.",
"repos_url_placeholder": "https://github.com/owner/repo 또는 [email protected]:owner/repo.git",
"repos_add": "추가",
"repos_selected": "선택됨",
- "source_pill_local": "로컬 디렉터리",
+ "source_pill_local": "로컬 폴더",
"source_tab_repos": "GitHub 저장소",
- "source_tab_local": "로컬 디렉터리",
- "local_heading": "이 기기의 로컬 작업 디렉터리 사용",
+ "source_tab_local": "로컬 폴더",
+ "local_heading": "이 컴퓨터의 폴더 사용",
"local_on_device": "{{device}}에 연결됨",
"local_this_machine": "이 기기",
- "local_daemon_offline": "데몬이 오프라인입니다. 로컬 디렉터리를 연결하려면 데몬을 시작하세요.",
- "local_pick": "디렉터리 선택...",
- "local_picking": "선택 창 여는 중...",
- "local_change": "디렉터리 변경...",
+ "local_daemon_offline": "데몬이 꺼져 있습니다. 시작하면 폴더를 선택할 수 있습니다.",
+ "local_pick": "폴더 선택...",
+ "local_picking": "선택 창을 여는 중...",
+ "local_change": "폴더 변경...",
"local_clear": "지우기",
- "local_pick_failed": "디렉터리 선택 창을 열 수 없습니다.",
- "local_invalid_dir": "이 디렉터리는 사용할 수 없습니다. 다른 디렉터리를 선택하세요.",
- "local_hint": "다른 기기의 에이전트는 이 경로를 볼 수 없어 시작에 실패합니다. 공유 작업에는 저장소를 사용하세요.",
+ "local_pick_failed": "폴더 선택 창을 열지 못했습니다.",
+ "local_invalid_dir": "이 폴더는 사용할 수 없습니다. 다른 폴더를 선택하세요.",
+ "local_hint": "다른 컴퓨터의 에이전트는 이 폴더에 접근할 수 없어 시작에 실패합니다. 공동 작업에는 저장소를 사용하세요.",
"repos_ref_default": "기본 브랜치",
"repos_remove_aria": "{{repo}} 제거"
},
diff --git a/packages/views/locales/ko/projects.json b/packages/views/locales/ko/projects.json
index db68285c6f..37dbcd265b 100644
--- a/packages/views/locales/ko/projects.json
+++ b/packages/views/locales/ko/projects.json
@@ -86,73 +86,65 @@
},
"resources": {
"section_header": "리소스",
- "empty": "첨부된 리소스가 없습니다.",
- "add_button": "리소스 추가",
- "popover_title": "GitHub 저장소 연결",
- "repos_search_placeholder": "저장소 검색...",
- "repos_search_empty": "검색 결과와 일치하는 저장소가 없습니다.",
- "attached_badge": "연결됨",
+ "repos_group": "저장소",
+ "repos_add": "저장소 추가",
+ "repos_empty": "아직 저장소가 없습니다.",
+ "repos_input_placeholder": "검색하거나 GitHub URL 붙여넣기...",
+ "repos_add_url": "{{repo}} 추가",
+ "repos_search_empty": "일치하는 저장소가 없습니다.",
+ "attached_badge": "추가됨",
"remove_tooltip": "제거",
- "url_placeholder": "https://github.com/owner/repo or [email protected]:owner/repo.git",
- "url_submit": "추가",
- "toast_attached": "저장소를 연결했습니다",
- "toast_attach_failed": "연결하지 못했습니다",
- "toast_removed": "리소스를 제거했습니다",
- "toast_remove_failed": "리소스를 제거하지 못했습니다",
- "add_local_directory_button": "로컬 디렉터리 추가",
- "local_daemon_offline_hint": "이 기기의 디렉터리를 연결하려면 로컬 데몬을 시작하세요.",
- "local_daemon_already_attached_hint": "이 기기에는 이미 로컬 디렉터리가 연결되어 있습니다. 새로 추가하려면 먼저 기존 항목을 제거하세요.",
- "local_no_daemon_tooltip": "로컬 데몬이 아직 ID를 보고하지 않아 에이전트가 이 디렉터리를 열 수 없습니다.",
- "local_other_machine_tooltip": "이 디렉터리를 등록한 기기에서만 사용할 수 있습니다.",
+ "toast_attached": "저장소를 추가했습니다",
+ "toast_attach_failed": "추가하지 못했습니다",
+ "toast_removed": "제거했습니다",
+ "toast_remove_failed": "제거하지 못했습니다",
+ "local_group": "로컬 폴더",
+ "local_group_hint": "컴퓨터당 하나이며, 그 컴퓨터에서만 사용됩니다.",
+ "local_this_computer": "이 컴퓨터",
+ "local_unknown_computer": "다른 컴퓨터",
+ "local_offline": "오프라인",
+ "local_slot_description": "이 컴퓨터에서 실행하면 새로 체크아웃하지 않고 내 폴더를 사용합니다.",
+ "local_pick": "폴더 선택...",
+ "local_daemon_offline_hint": "폴더를 선택하려면 로컬 데몬을 시작하세요.",
"chat_hint_prefix": "에이전트가 다음 위치에서 직접 작업합니다:",
"chat_hint_worktree_prefix": "에이전트가 다음 저장소의 격리된 worktree에서 작업합니다:",
"chat_hint_worktree_note": "작업 중인 파일은 그대로 유지되며, 각 실행 결과는 agent/… 브랜치로 전달됩니다.",
- "toast_local_attached": "로컬 디렉터리를 연결했습니다",
- "toast_local_pick_failed": "디렉터리를 선택하지 못했습니다",
- "toast_local_already_attached": "이 디렉터리는 이미 이 기기의 프로젝트에 연결되어 있습니다.",
- "toast_local_daemon_already_attached": "이 기기에는 이미 이 프로젝트의 로컬 디렉터리가 연결되어 있습니다. 새로 추가하려면 먼저 기존 항목을 제거하세요.",
- "toast_local_daemon_not_running": "로컬 데몬이 실행 중이 아닙니다.",
+ "toast_local_attached": "폴더를 추가했습니다",
+ "toast_local_pick_failed": "폴더를 선택하지 못했습니다",
"local_validate_not_absolute": "절대 경로를 선택하세요.",
- "local_validate_not_found": "경로가 존재하지 않습니다.",
- "local_validate_not_a_directory": "디렉터리가 아닙니다.",
- "local_validate_not_readable": "디렉터리를 읽을 수 없습니다.",
- "local_validate_not_writable": "디렉터리에 쓸 수 없습니다.",
- "local_validate_unsupported": "로컬 디렉터리는 데스크톱 앱에서만 선택할 수 있습니다.",
- "mode_dialog_title": "실행이 이 폴더를 어떻게 사용할까요?",
- "mode_dialog_description": "에이전트의 결과물을 받는 방식과, 이 폴더의 실행을 동시에 진행할 수 있는지가 정해집니다.",
- "mode_in_place_title": "이 폴더를 직접 수정",
- "mode_in_place_description": "한 번에 하나의 실행만 진행됩니다. 에이전트의 변경 사항이 작업 사본에 바로 나타나므로 이어서 작업할 수 있습니다.",
- "mode_worktree_title": "격리해서 병렬 실행",
- "mode_worktree_description": "실행이 작업 사본을 건드리지 않고 동시에 진행됩니다. 각 실행은 이 저장소의 agent/… 브랜치를 돌려주며, 검토 후 병합하면 됩니다.",
- "mode_worktree_needs_git": "이 폴더는 git 저장소가 아니어서 브랜치를 만들 수 없습니다. 저장소를 선택하거나 폴더를 직접 수정하세요.",
- "mode_worktree_needs_server_upgrade": "연결된 Multica 서버가 오래되어 병렬 실행을 지원하지 않습니다. 이대로면 실행이 이 폴더에서 그대로 진행됩니다. 서버를 업데이트한 뒤 켜세요.",
+ "local_validate_not_found": "폴더가 존재하지 않습니다.",
+ "local_validate_not_a_directory": "이 경로는 폴더가 아닙니다.",
+ "local_validate_not_readable": "폴더를 읽을 수 없습니다.",
+ "local_validate_not_writable": "폴더에 쓸 수 없습니다.",
+ "local_validate_unsupported": "폴더는 데스크톱 앱에서만 선택할 수 있습니다.",
+ "mode_in_place_title": "직접 수정",
+ "mode_in_place_description": "한 번에 하나씩 실행합니다. 변경 사항이 이 폴더에 바로 반영됩니다.",
+ "mode_worktree_title": "병렬 실행",
+ "mode_worktree_description": "작업 사본을 건드리지 않고 동시에 실행합니다. 각 실행은 agent/… 브랜치를 돌려주며, 검토 후 병합하면 됩니다.",
+ "mode_worktree_needs_git": "이 폴더는 git 저장소가 아니어서 병렬로 실행할 수 없습니다.",
+ "mode_worktree_needs_server_upgrade": "Multica 서버가 오래되어 병렬 실행이 이 폴더에서 직접 실행됩니다. 먼저 서버를 업데이트하세요.",
"mode_cancel": "취소",
- "mode_save": "저장",
"mode_add": "폴더 추가",
- "mode_edit_tooltip": "실행이 이 폴더를 사용하는 방식 변경",
+ "mode_edit_tooltip": "실행 모드 변경",
"mode_badge_worktree": "병렬",
- "mode_badge_worktree_tooltip": "실행이 각자의 git 워크트리에서 동시에 진행되고 브랜치로 결과를 돌려줍니다. 작업 사본은 변경되지 않습니다.",
"toast_local_mode_updated": "실행 모드를 업데이트했습니다",
"toast_local_mode_update_failed": "실행 모드를 업데이트하지 못했습니다",
"mode_badge_in_place": "직접",
"ref_label": "시작 브랜치",
"ref_placeholder": "main",
- "ref_hint": "작업은 이 브랜치에서 시작하고 풀 리퀘스트도 이 브랜치로 엽니다. 비워 두면 저장소의 기본 브랜치를 사용합니다.",
+ "ref_hint": "작업은 이 브랜치에서 시작하고 풀 리퀘스트도 이 브랜치로 엽니다. 비워 두면 기본 브랜치를 사용합니다.",
"ref_error_too_long": "255자 이내로 입력하세요.",
- "ref_error_characters": "git ref에는 공백이나 ~ ^ : ? * [ \\ 문자를 사용할 수 없습니다",
- "ref_error_format": "유효한 브랜치, 태그 또는 커밋이 아닙니다.",
- "ref_dialog_title": "작업은 어느 브랜치에서 진행하나요?",
- "ref_dialog_description": "이 프로젝트에서 새로 시작하는 작업은 이 브랜치를 체크아웃하고 풀 리퀘스트도 여기로 엽니다. 이미 진행 중인 작업은 시작한 브랜치를 유지합니다.",
+ "ref_error_characters": "브랜치 이름에는 공백이나 ~ ^ : ? * [ \\ 를 사용할 수 없습니다",
+ "ref_error_format": "유효한 브랜치 이름이 아닙니다.",
"ref_cancel": "취소",
"ref_save": "저장",
- "ref_edit_tooltip": "작업이 진행되는 브랜치 변경",
- "ref_badge_tooltip": "작업이 {{ref}}에서 시작하고 이 브랜치로 결과를 전달합니다.",
+ "ref_edit_tooltip": "시작 브랜치 변경",
"toast_ref_updated": "브랜치를 업데이트했습니다",
"toast_ref_cleared": "기본 브랜치로 되돌렸습니다",
"toast_ref_update_failed": "브랜치를 업데이트하지 못했습니다",
- "ref_error_commit": "이것은 브랜치가 아니라 커밋입니다. 작업은 시작한 브랜치로 결과를 전달합니다. 일회성 리비전이 필요하면 multica repo checkout --ref를 사용하세요.",
+ "ref_error_commit": "이것은 브랜치가 아니라 커밋입니다. 특정 리비전이 필요하면 multica repo checkout --ref를 사용하세요.",
"ref_default_label": "기본 브랜치",
- "ref_default_tooltip": "브랜치가 설정되지 않음 — 작업은 그 시점의 저장소 기본 브랜치를 사용합니다."
+ "ref_running_note": "이미 진행 중인 작업에는 영향이 없습니다."
},
"delete_dialog": {
"offline_error": "오프라인 상태입니다. 다시 연결한 후 삭제를 재시도하세요.",
diff --git a/packages/views/locales/ru/modals.json b/packages/views/locales/ru/modals.json
index 721942cb44..024c2357f6 100644
--- a/packages/views/locales/ru/modals.json
+++ b/packages/views/locales/ru/modals.json
@@ -140,27 +140,27 @@
"repos_pill": "Репозитории",
"repos_pill_count_one": "{{count}} репозиторий",
"repos_pill_count_other": "{{count}} репозитория",
- "repos_heading": "Подключить репозитории GitHub к этому проекту",
- "repos_empty": "Пока нет репозиториев на уровне рабочего пространства. Вставьте URL ниже, чтобы подключить один отдельно.",
+ "repos_heading": "Добавьте репозитории GitHub в проект",
+ "repos_empty": "В рабочем пространстве пока нет репозиториев. Вставьте ссылку ниже, чтобы добавить.",
"repos_search_placeholder": "Поиск репозиториев...",
"repos_search_empty": "Репозитории по вашему запросу не найдены.",
"repos_url_placeholder": "https://github.com/owner/repo или [email protected]:owner/repo.git",
"repos_add": "Добавить",
"repos_selected": "Выбрано",
- "source_pill_local": "Локальная директория",
+ "source_pill_local": "Локальная папка",
"source_tab_repos": "Репозитории GitHub",
- "source_tab_local": "Локальная директория",
- "local_heading": "Использовать локальную рабочую директорию на этом устройстве",
+ "source_tab_local": "Локальная папка",
+ "local_heading": "Использовать папку на этом компьютере",
"local_on_device": "Привязано к {{device}}",
"local_this_machine": "этому устройству",
- "local_daemon_offline": "Демон не запущен — запустите его, чтобы привязать локальную директорию.",
- "local_pick": "Выбрать директорию…",
- "local_picking": "Открывается диалог выбора…",
- "local_change": "Изменить директорию…",
+ "local_daemon_offline": "Демон не запущен. Запустите его, чтобы выбрать папку.",
+ "local_pick": "Выбрать папку...",
+ "local_picking": "Открываем выбор...",
+ "local_change": "Сменить папку...",
"local_clear": "Очистить",
- "local_pick_failed": "Не удалось открыть диалог выбора директории.",
- "local_invalid_dir": "Эта директория не может быть использована. Выберите другую.",
- "local_hint": "Агенты на других устройствах не увидят этот путь — они не смогут запуститься. Используйте репозитории для совместной работы.",
+ "local_pick_failed": "Не удалось открыть выбор папки.",
+ "local_invalid_dir": "Эту папку нельзя использовать. Выберите другую.",
+ "local_hint": "Агенты на других компьютерах не видят эту папку и не запустятся. Для общей работы используйте репозитории.",
"repos_ref_default": "Ветка по умолчанию",
"repos_remove_aria": "Удалить {{repo}}",
"repos_pill_count_few": "{{count}} репозитория",
diff --git a/packages/views/locales/ru/projects.json b/packages/views/locales/ru/projects.json
index 69cad0da86..5a6576bad2 100644
--- a/packages/views/locales/ru/projects.json
+++ b/packages/views/locales/ru/projects.json
@@ -86,73 +86,65 @@
},
"resources": {
"section_header": "Ресурсы",
- "empty": "Нет прикреплённых ресурсов.",
- "add_button": "Добавить ресурс",
- "popover_title": "Прикрепить репозиторий GitHub",
- "repos_search_placeholder": "Поиск репозиториев...",
- "repos_search_empty": "По вашему запросу репозитории не найдены.",
- "attached_badge": "прикреплён",
+ "repos_group": "Репозитории",
+ "repos_add": "Добавить репозиторий",
+ "repos_empty": "Репозиториев пока нет.",
+ "repos_input_placeholder": "Поиск или ссылка на GitHub...",
+ "repos_add_url": "Добавить {{repo}}",
+ "repos_search_empty": "Подходящих репозиториев нет.",
+ "attached_badge": "Добавлен",
"remove_tooltip": "Удалить",
- "url_placeholder": "https://github.com/owner/repo или [email protected]:owner/repo.git",
- "url_submit": "Добавить",
- "toast_attached": "Репозиторий прикреплён",
- "toast_attach_failed": "Не удалось прикрепить",
- "toast_removed": "Ресурс удалён",
- "toast_remove_failed": "Не удалось удалить ресурс",
- "add_local_directory_button": "Добавить локальную папку",
- "local_daemon_offline_hint": "Запустите локальный демон, чтобы прикрепить папку на этом компьютере.",
- "local_daemon_already_attached_hint": "К этому компьютеру уже прикреплена локальная папка. Удалите её, прежде чем добавлять другую.",
- "local_no_daemon_tooltip": "Локальный демон пока не сообщает свой ID — агент не может открыть эту папку.",
- "local_other_machine_tooltip": "Доступно только на компьютере, где зарегистрирована эта папка.",
+ "toast_attached": "Репозиторий добавлен",
+ "toast_attach_failed": "Не удалось добавить",
+ "toast_removed": "Удалено",
+ "toast_remove_failed": "Не удалось удалить",
+ "local_group": "Локальные папки",
+ "local_group_hint": "По одной на компьютер; используется только на нём.",
+ "local_this_computer": "Этот компьютер",
+ "local_unknown_computer": "Другой компьютер",
+ "local_offline": "Не в сети",
+ "local_slot_description": "Запуски на этом компьютере используют вашу папку вместо новой копии репозитория.",
+ "local_pick": "Выбрать папку...",
+ "local_daemon_offline_hint": "Запустите локальный демон, чтобы выбрать папку.",
"chat_hint_prefix": "Агент будет работать на месте в",
"chat_hint_worktree_prefix": "Агент будет работать в изолированной рабочей копии",
"chat_hint_worktree_note": "Ваша рабочая копия остаётся нетронутой — результат каждого запуска возвращается отдельной веткой agent/….",
- "toast_local_attached": "Локальная папка прикреплена",
+ "toast_local_attached": "Папка добавлена",
"toast_local_pick_failed": "Не удалось выбрать папку",
- "toast_local_already_attached": "Эта папка уже прикреплена к проекту на этом компьютере.",
- "toast_local_daemon_already_attached": "К этому компьютеру уже прикреплена локальная папка для этого проекта. Удалите её, прежде чем добавлять другую.",
- "toast_local_daemon_not_running": "Локальный демон не запущен.",
"local_validate_not_absolute": "Выберите абсолютный путь.",
- "local_validate_not_found": "Путь не существует.",
+ "local_validate_not_found": "Папка не существует.",
"local_validate_not_a_directory": "Путь не является папкой.",
"local_validate_not_readable": "Папка недоступна для чтения.",
"local_validate_not_writable": "Папка недоступна для записи.",
- "local_validate_unsupported": "Локальные папки можно выбирать только в приложении для рабочего стола.",
- "mode_dialog_title": "Как запуски должны использовать эту папку?",
- "mode_dialog_description": "Это определяет, как вы получаете результаты работы агента, и могут ли запуски в этой папке выполняться одновременно.",
- "mode_in_place_title": "Редактировать эту папку напрямую",
- "mode_in_place_description": "По одному запуску за раз. Изменения появляются в вашей рабочей копии по мере того, как их вносит агент, и сразу готовы к продолжению работы.",
- "mode_worktree_title": "Выполнять параллельно, изолированно",
- "mode_worktree_description": "Запуски выполняются одновременно, не затрагивая вашу рабочую копию. Каждый возвращает в этом репозитории ветку agent/… для проверки и слияния.",
- "mode_worktree_needs_git": "Эта папка не является git-репозиторием, поэтому ветку некуда поместить. Выберите репозиторий или продолжайте редактировать папку напрямую.",
- "mode_worktree_needs_server_upgrade": "Ваш сервер Multica слишком старый для параллельного выполнения запусков — он будет незаметно выполнять их в этой же папке. Обновите сервер, а затем включите эту функцию.",
+ "local_validate_unsupported": "Папки можно выбирать только в приложении для рабочего стола.",
+ "mode_in_place_title": "Редактировать напрямую",
+ "mode_in_place_description": "По одному запуску за раз. Изменения сразу попадают в эту папку.",
+ "mode_worktree_title": "Выполнять параллельно",
+ "mode_worktree_description": "Запуски идут одновременно, не затрагивая рабочую копию. Каждый возвращает ветку agent/… для проверки и слияния.",
+ "mode_worktree_needs_git": "Эта папка не является git-репозиторием, поэтому параллельный запуск невозможен.",
+ "mode_worktree_needs_server_upgrade": "Ваш сервер Multica слишком старый для параллельных запусков и выполнит их в этой папке. Сначала обновите сервер.",
"mode_cancel": "Отмена",
- "mode_save": "Сохранить",
"mode_add": "Добавить папку",
- "mode_edit_tooltip": "Изменить способ использования этой папки запусками",
+ "mode_edit_tooltip": "Изменить режим запуска",
"mode_badge_worktree": "Параллельно",
- "mode_badge_worktree_tooltip": "Запуски выполняются одновременно в собственных git worktree и возвращают ветки. Ваша рабочая копия не затрагивается.",
"toast_local_mode_updated": "Режим выполнения обновлён",
"toast_local_mode_update_failed": "Не удалось обновить режим выполнения",
"mode_badge_in_place": "Напрямую",
"ref_label": "Начальная ветка",
"ref_placeholder": "main",
- "ref_hint": "Задачи начинаются с этой ветки и открывают pull request в неё. Оставьте пустым, чтобы использовать ветку репозитория по умолчанию.",
+ "ref_hint": "Задачи начинаются с этой ветки и открывают pull request в неё. Оставьте пустым для ветки по умолчанию.",
"ref_error_too_long": "Используйте не более 255 символов.",
- "ref_error_characters": "Ссылка git не может содержать пробелы или символы ~ ^ : ? * [ \\",
- "ref_error_format": "Это не действительная ветка, тег или коммит.",
- "ref_dialog_title": "С какой веткой должны работать задачи?",
- "ref_dialog_description": "Новые задачи в этом проекте переключаются на эту ветку и открывают pull request в неё. Уже начатая работа сохраняет ветку, с которой началась.",
+ "ref_error_characters": "Имя ветки не может содержать пробелы или ~ ^ : ? * [ \\",
+ "ref_error_format": "Недопустимое имя ветки.",
"ref_cancel": "Отмена",
"ref_save": "Сохранить",
- "ref_edit_tooltip": "Изменить ветку, с которой работают задачи",
- "ref_badge_tooltip": "Задачи начинаются с {{ref}} и доставляют изменения обратно в неё.",
+ "ref_edit_tooltip": "Изменить начальную ветку",
"toast_ref_updated": "Ветка обновлена",
"toast_ref_cleared": "Возврат к ветке по умолчанию",
"toast_ref_update_failed": "Не удалось обновить ветку",
- "ref_error_commit": "Это коммит, а не ветка. Задачи доставляют изменения обратно в ветку, с которой начались — для разовой ревизии используйте --ref в multica repo checkout.",
+ "ref_error_commit": "Это коммит, а не ветка. Для конкретной ревизии используйте --ref в multica repo checkout.",
"ref_default_label": "Ветка по умолчанию",
- "ref_default_tooltip": "Ветка не задана — задачи используют ту ветку по умолчанию, которая установлена в репозитории на момент запуска."
+ "ref_running_note": "Уже идущие задачи это не затронет."
},
"delete_dialog": {
"title": "Удалить проект",
diff --git a/packages/views/locales/zh-Hans/modals.json b/packages/views/locales/zh-Hans/modals.json
index ea0979edc0..f641660b9b 100644
--- a/packages/views/locales/zh-Hans/modals.json
+++ b/packages/views/locales/zh-Hans/modals.json
@@ -142,27 +142,27 @@
"toast_failed": "创建项目失败",
"repos_pill": "代码仓库",
"repos_pill_count_other": "{{count}} 个仓库",
- "repos_heading": "为此项目关联 GitHub 仓库",
- "repos_empty": "还没有工作区级别的仓库。可以在下方粘贴 URL 临时关联一个。",
+ "repos_heading": "为此项目添加 GitHub 仓库",
+ "repos_empty": "工作区还没有仓库,可以在下方粘贴链接添加。",
"repos_search_placeholder": "搜索仓库...",
"repos_search_empty": "没有匹配的仓库。",
"repos_url_placeholder": "https://github.com/owner/repo 或 [email protected]:owner/repo.git",
"repos_add": "添加",
"repos_selected": "已选",
- "source_pill_local": "本地目录",
+ "source_pill_local": "本地文件夹",
"source_tab_repos": "GitHub 仓库",
- "source_tab_local": "本地目录",
- "local_heading": "使用本机的本地工作目录",
+ "source_tab_local": "本地文件夹",
+ "local_heading": "使用本机的文件夹",
"local_on_device": "绑定到 {{device}}",
"local_this_machine": "本机",
- "local_daemon_offline": "守护进程未运行——启动后才能绑定本地目录。",
- "local_pick": "选择目录…",
- "local_picking": "正在打开选择器…",
- "local_change": "更换目录…",
+ "local_daemon_offline": "守护进程未运行,启动后才能选择文件夹。",
+ "local_pick": "选择文件夹...",
+ "local_picking": "正在打开选择器...",
+ "local_change": "更换文件夹...",
"local_clear": "清除",
- "local_pick_failed": "无法打开目录选择器。",
- "local_invalid_dir": "该目录不可用,请重新选择。",
- "local_hint": "其他机器上的智能体看不到这个路径,会启动失败。需要协作请用仓库模式。",
+ "local_pick_failed": "无法打开文件夹选择器。",
+ "local_invalid_dir": "这个文件夹不可用,请重新选择。",
+ "local_hint": "其他电脑上的智能体访问不到这个文件夹,会启动失败。需要协作请用仓库。",
"repos_ref_default": "默认分支",
"repos_remove_aria": "移除 {{repo}}"
},
diff --git a/packages/views/locales/zh-Hans/projects.json b/packages/views/locales/zh-Hans/projects.json
index 622a50176a..ad32329def 100644
--- a/packages/views/locales/zh-Hans/projects.json
+++ b/packages/views/locales/zh-Hans/projects.json
@@ -86,73 +86,65 @@
},
"resources": {
"section_header": "资源",
- "empty": "还没有关联资源。",
- "add_button": "添加资源",
- "popover_title": "关联 GitHub 仓库",
- "repos_search_placeholder": "搜索仓库...",
+ "repos_group": "仓库",
+ "repos_add": "添加仓库",
+ "repos_empty": "还没有仓库。",
+ "repos_input_placeholder": "搜索或粘贴 GitHub 链接...",
+ "repos_add_url": "添加 {{repo}}",
"repos_search_empty": "没有匹配的仓库。",
- "attached_badge": "已关联",
+ "attached_badge": "已添加",
"remove_tooltip": "移除",
- "url_placeholder": "https://github.com/owner/repo 或 [email protected]:owner/repo.git",
- "url_submit": "添加",
- "toast_attached": "已关联仓库",
- "toast_attach_failed": "关联失败",
- "toast_removed": "已移除资源",
- "toast_remove_failed": "移除资源失败",
- "add_local_directory_button": "添加本地目录",
- "local_daemon_offline_hint": "启动本地守护进程后才能添加本机目录。",
- "local_daemon_already_attached_hint": "本机已经关联了一个本地目录到该项目,先移除现有目录再添加新目录。",
- "local_no_daemon_tooltip": "尚未识别到本机守护进程,智能体暂时无法打开此目录。",
- "local_other_machine_tooltip": "此目录仅在最初注册它的电脑上可用。",
+ "toast_attached": "已添加仓库",
+ "toast_attach_failed": "添加失败",
+ "toast_removed": "已移除",
+ "toast_remove_failed": "移除失败",
+ "local_group": "本地文件夹",
+ "local_group_hint": "每台电脑一个,只在那台电脑上生效。",
+ "local_this_computer": "本机",
+ "local_unknown_computer": "另一台电脑",
+ "local_offline": "离线",
+ "local_slot_description": "在本机运行时直接使用你的文件夹,不再检出仓库。",
+ "local_pick": "选择文件夹...",
+ "local_daemon_offline_hint": "启动本地守护进程后才能选择文件夹。",
"chat_hint_prefix": "智能体将直接在以下目录中工作:",
"chat_hint_worktree_prefix": "智能体将在以下仓库的独立 worktree 中工作:",
"chat_hint_worktree_note": "不会改动你的工作副本,每次运行的结果以 agent/… 分支交回。",
- "toast_local_attached": "已添加本地目录",
- "toast_local_pick_failed": "选择目录失败",
- "toast_local_already_attached": "该目录已经在本机关联到此项目。",
- "toast_local_daemon_already_attached": "本机已经关联了一个本地目录到该项目,先移除现有目录再添加新目录。",
- "toast_local_daemon_not_running": "本地守护进程未运行。",
+ "toast_local_attached": "已添加文件夹",
+ "toast_local_pick_failed": "选择文件夹失败",
"local_validate_not_absolute": "请选择绝对路径。",
- "local_validate_not_found": "目录不存在。",
- "local_validate_not_a_directory": "该路径不是目录。",
- "local_validate_not_readable": "目录不可读。",
- "local_validate_not_writable": "目录不可写。",
- "local_validate_unsupported": "本地目录仅能在桌面端选择。",
- "mode_dialog_title": "每次运行如何使用这个文件夹?",
- "mode_dialog_description": "这决定了你如何拿到智能体的工作成果,以及这个文件夹上的运行能否并行。",
- "mode_in_place_title": "直接修改这个文件夹",
- "mode_in_place_description": "同一时间只处理一次运行。智能体的改动会直接出现在你的工作区里,你可以接着改。",
- "mode_worktree_title": "并行隔离运行",
- "mode_worktree_description": "运行可以并行,互不干扰,也不会改动你的工作区。每次运行的结果都是这个仓库里的一个 agent/… 分支,由你 review 后合并。",
- "mode_worktree_needs_git": "这个文件夹不是 git 仓库,分支无处可放。请选择一个仓库,或者继续直接修改这个文件夹。",
- "mode_worktree_needs_server_upgrade": "当前 Multica 服务端版本过旧,无法支持并行运行——它会直接在这个文件夹里运行。升级服务端后即可开启。",
+ "local_validate_not_found": "文件夹不存在。",
+ "local_validate_not_a_directory": "这个路径不是文件夹。",
+ "local_validate_not_readable": "文件夹不可读。",
+ "local_validate_not_writable": "文件夹不可写。",
+ "local_validate_unsupported": "只能在桌面端选择文件夹。",
+ "mode_in_place_title": "直接修改",
+ "mode_in_place_description": "一次一个运行,改动直接写进这个文件夹。",
+ "mode_worktree_title": "并行运行",
+ "mode_worktree_description": "多个运行同时进行,不改动你的工作区。每次运行交回一个 agent/… 分支,由你审查后合并。",
+ "mode_worktree_needs_git": "这个文件夹不是 git 仓库,无法并行运行。",
+ "mode_worktree_needs_server_upgrade": "Multica 服务端版本过旧,并行运行会退回到直接修改这个文件夹。请先升级服务端。",
"mode_cancel": "取消",
- "mode_save": "保存",
"mode_add": "添加文件夹",
- "mode_edit_tooltip": "修改运行使用这个文件夹的方式",
- "mode_badge_worktree": "并行",
- "mode_badge_worktree_tooltip": "运行在各自的 git worktree 中并行执行,并以分支形式交付结果。你的工作区不会被改动。",
- "toast_local_mode_updated": "已更新执行方式",
- "toast_local_mode_update_failed": "无法更新执行方式",
- "mode_badge_in_place": "原地",
+ "mode_edit_tooltip": "修改运行方式",
+ "mode_badge_worktree": "并行运行",
+ "toast_local_mode_updated": "已更新运行方式",
+ "toast_local_mode_update_failed": "运行方式更新失败",
+ "mode_badge_in_place": "直接修改",
"ref_label": "起始分支",
"ref_placeholder": "main",
- "ref_hint": "任务从这条分支开始,PR 也默认提到这里。留空则使用仓库默认分支。",
+ "ref_hint": "任务从这条分支开始,PR 也提到这里。留空则使用默认分支。",
"ref_error_too_long": "最多 255 个字符。",
- "ref_error_characters": "git ref 不能包含空格或 ~ ^ : ? * [ \\ 这些字符",
- "ref_error_format": "不是有效的分支、Tag 或 Commit。",
- "ref_dialog_title": "任务在哪条分支上工作?",
- "ref_dialog_description": "本项目新开始的任务会检出这条分支,PR 也提到这里。已经在进行的任务仍留在它当初的分支上。",
+ "ref_error_characters": "分支名不能包含空格或 ~ ^ : ? * [ \\",
+ "ref_error_format": "不是有效的分支名。",
"ref_cancel": "取消",
"ref_save": "保存",
- "ref_edit_tooltip": "修改任务工作的分支",
- "ref_badge_tooltip": "任务从 {{ref}} 开始,并交付回这条分支。",
+ "ref_edit_tooltip": "修改起始分支",
"toast_ref_updated": "分支已更新",
"toast_ref_cleared": "已恢复为默认分支",
- "toast_ref_update_failed": "无法更新分支",
- "ref_error_commit": "这是一个 commit,不是分支。任务会交付回它起始的分支 —— 只需要某次修订,请用 multica repo checkout --ref。",
+ "toast_ref_update_failed": "分支更新失败",
+ "ref_error_commit": "这是 commit,不是分支。需要指定某个版本时,请用 multica repo checkout --ref。",
"ref_default_label": "默认分支",
- "ref_default_tooltip": "未设置分支 —— 任务使用仓库当时的默认分支。"
+ "ref_running_note": "进行中的任务不受影响。"
},
"delete_dialog": {
"offline_error": "当前处于离线状态,请联网后重试删除。",
diff --git a/packages/views/locales/zh-Hant/modals.json b/packages/views/locales/zh-Hant/modals.json
index 01d9efef9d..5cdd0e63a5 100644
--- a/packages/views/locales/zh-Hant/modals.json
+++ b/packages/views/locales/zh-Hant/modals.json
@@ -142,27 +142,27 @@
"toast_failed": "建立專案失敗",
"repos_pill": "程式碼倉庫",
"repos_pill_count_other": "{{count}} 個倉庫",
- "repos_heading": "為此專案關聯 GitHub 倉庫",
- "repos_empty": "還沒有工作區級別的倉庫。可以在下方貼上 URL 臨時關聯一個。",
+ "repos_heading": "為此專案新增 GitHub 倉庫",
+ "repos_empty": "工作區還沒有倉庫,可以在下方貼上連結新增。",
"repos_search_placeholder": "搜尋倉庫...",
"repos_search_empty": "沒有匹配的倉庫。",
"repos_url_placeholder": "https://github.com/owner/repo 或 [email protected]:owner/repo.git",
"repos_add": "新增",
"repos_selected": "已選",
- "source_pill_local": "本地目錄",
+ "source_pill_local": "本地資料夾",
"source_tab_repos": "GitHub 倉庫",
- "source_tab_local": "本地目錄",
- "local_heading": "使用本機的本地工作目錄",
+ "source_tab_local": "本地資料夾",
+ "local_heading": "使用本機的資料夾",
"local_on_device": "繫結到 {{device}}",
"local_this_machine": "本機",
- "local_daemon_offline": "守護程序未執行——啟動後才能繫結本地目錄。",
- "local_pick": "選擇目錄…",
- "local_picking": "正在開啟選擇器…",
- "local_change": "更換目錄…",
+ "local_daemon_offline": "守護程序未執行,啟動後才能選擇資料夾。",
+ "local_pick": "選擇資料夾...",
+ "local_picking": "正在開啟選擇器...",
+ "local_change": "更換資料夾...",
"local_clear": "清除",
- "local_pick_failed": "無法開啟目錄選擇器。",
- "local_invalid_dir": "該目錄不可用,請重新選擇。",
- "local_hint": "其他機器上的 AI 代理看不到這個路徑,會啟動失敗。需要協作請用倉庫模式。",
+ "local_pick_failed": "無法開啟資料夾選擇器。",
+ "local_invalid_dir": "這個資料夾無法使用,請重新選擇。",
+ "local_hint": "其他電腦上的 AI 代理存取不到這個資料夾,會啟動失敗。需要協作請用倉庫。",
"repos_ref_default": "預設分支",
"repos_remove_aria": "移除 {{repo}}"
},
diff --git a/packages/views/locales/zh-Hant/projects.json b/packages/views/locales/zh-Hant/projects.json
index 97e6667c03..3c8ef387dc 100644
--- a/packages/views/locales/zh-Hant/projects.json
+++ b/packages/views/locales/zh-Hant/projects.json
@@ -86,73 +86,65 @@
},
"resources": {
"section_header": "資源",
- "empty": "還沒有關聯資源。",
- "add_button": "新增資源",
- "popover_title": "關聯 GitHub 倉庫",
- "repos_search_placeholder": "搜尋倉庫...",
+ "repos_group": "倉庫",
+ "repos_add": "新增倉庫",
+ "repos_empty": "還沒有倉庫。",
+ "repos_input_placeholder": "搜尋或貼上 GitHub 連結...",
+ "repos_add_url": "新增 {{repo}}",
"repos_search_empty": "沒有匹配的倉庫。",
- "attached_badge": "已關聯",
+ "attached_badge": "已新增",
"remove_tooltip": "移除",
- "url_placeholder": "https://github.com/owner/repo 或 [email protected]:owner/repo.git",
- "url_submit": "新增",
- "toast_attached": "已關聯倉庫",
- "toast_attach_failed": "關聯失敗",
- "toast_removed": "已移除資源",
- "toast_remove_failed": "移除資源失敗",
- "add_local_directory_button": "新增本地目錄",
- "local_daemon_offline_hint": "啟動本地守護程序後才能新增本機目錄。",
- "local_daemon_already_attached_hint": "本機已經關聯了一個本地目錄到該專案,先移除現有目錄再新增新目錄。",
- "local_no_daemon_tooltip": "尚未識別到本機守護程序,AI 代理暫時無法開啟此目錄。",
- "local_other_machine_tooltip": "此目錄僅在最初註冊它的電腦上可用。",
+ "toast_attached": "已新增倉庫",
+ "toast_attach_failed": "新增失敗",
+ "toast_removed": "已移除",
+ "toast_remove_failed": "移除失敗",
+ "local_group": "本地資料夾",
+ "local_group_hint": "每台電腦一個,只在那台電腦上生效。",
+ "local_this_computer": "本機",
+ "local_unknown_computer": "另一台電腦",
+ "local_offline": "離線",
+ "local_slot_description": "在本機執行時直接使用你的資料夾,不再檢出倉庫。",
+ "local_pick": "選擇資料夾...",
+ "local_daemon_offline_hint": "啟動本地守護程序後才能選擇資料夾。",
"chat_hint_prefix": "AI 代理將直接在以下目錄中工作:",
"chat_hint_worktree_prefix": "AI 代理將在以下倉庫的獨立 worktree 中工作:",
"chat_hint_worktree_note": "不會改動你的工作副本,每次執行的結果以 agent/… 分支交回。",
- "toast_local_attached": "已新增本地目錄",
- "toast_local_pick_failed": "選擇目錄失敗",
- "toast_local_already_attached": "該目錄已經在本機關聯到此專案。",
- "toast_local_daemon_already_attached": "本機已經關聯了一個本地目錄到該專案,先移除現有目錄再新增新目錄。",
- "toast_local_daemon_not_running": "本地守護程序未執行。",
+ "toast_local_attached": "已新增資料夾",
+ "toast_local_pick_failed": "選擇資料夾失敗",
"local_validate_not_absolute": "請選擇絕對路徑。",
- "local_validate_not_found": "目錄不存在。",
- "local_validate_not_a_directory": "該路徑不是目錄。",
- "local_validate_not_readable": "目錄不可讀。",
- "local_validate_not_writable": "目錄不可寫。",
- "local_validate_unsupported": "本地目錄僅能在桌面端選擇。",
- "mode_dialog_title": "每次執行如何使用這個資料夾?",
- "mode_dialog_description": "這決定了你如何拿到 AI 代理的工作成果,以及這個資料夾上的執行能否並行。",
- "mode_in_place_title": "直接修改這個資料夾",
- "mode_in_place_description": "同一時間只處理一次執行。AI 代理的改動會直接出現在你的工作區裡,你可以接著改。",
- "mode_worktree_title": "並行隔離執行",
- "mode_worktree_description": "執行可以並行,互不干擾,也不會改動你的工作區。每次執行的結果都是這個倉庫裡的一個 agent/… 分支,由你 review 後合併。",
- "mode_worktree_needs_git": "這個資料夾不是 git 倉庫,分支無處可放。請選擇一個倉庫,或者繼續直接修改這個資料夾。",
- "mode_worktree_needs_server_upgrade": "當前 Multica 服務端版本過舊,無法支援並行執行——它會直接在這個資料夾裡執行。升級服務端後即可開啟。",
+ "local_validate_not_found": "資料夾不存在。",
+ "local_validate_not_a_directory": "這個路徑不是資料夾。",
+ "local_validate_not_readable": "資料夾不可讀。",
+ "local_validate_not_writable": "資料夾不可寫。",
+ "local_validate_unsupported": "只能在桌面端選擇資料夾。",
+ "mode_in_place_title": "直接修改",
+ "mode_in_place_description": "一次一個執行,改動直接寫進這個資料夾。",
+ "mode_worktree_title": "並行執行",
+ "mode_worktree_description": "多個執行同時進行,不改動你的工作區。每次執行交回一個 agent/… 分支,由你審查後合併。",
+ "mode_worktree_needs_git": "這個資料夾不是 git 倉庫,無法並行執行。",
+ "mode_worktree_needs_server_upgrade": "Multica 服務端版本過舊,並行執行會退回到直接修改這個資料夾。請先升級服務端。",
"mode_cancel": "取消",
- "mode_save": "儲存",
"mode_add": "新增資料夾",
- "mode_edit_tooltip": "修改執行使用這個資料夾的方式",
- "mode_badge_worktree": "並行",
- "mode_badge_worktree_tooltip": "執行在各自的 git worktree 中並行執行,並以分支形式交付結果。你的工作區不會被改動。",
+ "mode_edit_tooltip": "修改執行方式",
+ "mode_badge_worktree": "並行執行",
"toast_local_mode_updated": "已更新執行方式",
- "toast_local_mode_update_failed": "無法更新執行方式",
- "mode_badge_in_place": "原地",
+ "toast_local_mode_update_failed": "執行方式更新失敗",
+ "mode_badge_in_place": "直接修改",
"ref_label": "起始分支",
"ref_placeholder": "main",
- "ref_hint": "任務從這條分支開始,PR 也預設提到這裡。留空則使用倉庫預設分支。",
+ "ref_hint": "任務從這條分支開始,PR 也提到這裡。留空則使用預設分支。",
"ref_error_too_long": "最多 255 個字元。",
- "ref_error_characters": "git ref 不能包含空格或 ~ ^ : ? * [ \\ 這些字元",
- "ref_error_format": "不是有效的分支、Tag 或 Commit。",
- "ref_dialog_title": "任務在哪條分支上工作?",
- "ref_dialog_description": "本專案新開始的任務會檢出這條分支,PR 也提到這裡。已經在進行的任務仍留在它當初的分支上。",
+ "ref_error_characters": "分支名稱不能包含空格或 ~ ^ : ? * [ \\",
+ "ref_error_format": "不是有效的分支名稱。",
"ref_cancel": "取消",
"ref_save": "儲存",
- "ref_edit_tooltip": "修改任務工作的分支",
- "ref_badge_tooltip": "任務從 {{ref}} 開始,並交付回這條分支。",
+ "ref_edit_tooltip": "修改起始分支",
"toast_ref_updated": "分支已更新",
"toast_ref_cleared": "已恢復為預設分支",
- "toast_ref_update_failed": "無法更新分支",
- "ref_error_commit": "這是一個 commit,不是分支。任務會交付回它起始的分支 —— 只需要某次修訂,請用 multica repo checkout --ref。",
+ "toast_ref_update_failed": "分支更新失敗",
+ "ref_error_commit": "這是 commit,不是分支。需要指定某個版本時,請用 multica repo checkout --ref。",
"ref_default_label": "預設分支",
- "ref_default_tooltip": "未設定分支 —— 任務使用倉庫當時的預設分支。"
+ "ref_running_note": "進行中的任務不受影響。"
},
"delete_dialog": {
"offline_error": "目前處於離線狀態,請連線後重試刪除。",
diff --git a/packages/views/modals/create-project-local-mode.test.tsx b/packages/views/modals/create-project-local-mode.test.tsx
index 57240f4b2b..d3f3a3d393 100644
--- a/packages/views/modals/create-project-local-mode.test.tsx
+++ b/packages/views/modals/create-project-local-mode.test.tsx
@@ -157,7 +157,7 @@ vi.mock("../projects/components/project-due-date-picker", () => ({
ProjectDueDatePicker: () => <button type="button">Due date</button>,
}));
-// Desktop-only surface: without these the Local directory tab never renders.
+// Desktop-only surface: without these the Local folder tab never renders.
vi.mock("../platform/local-directory", () => ({
isDesktopShell: () => true,
pickDirectory: () =>
@@ -194,8 +194,8 @@ vi.mock("sonner", () => ({ toast: { success: vi.fn(), error: vi.fn() } }));
import { CreateProjectModal, buildLocalDirectoryResourceRef } from "./create-project";
async function pickLocalDirectory(user: ReturnType<typeof userEvent.setup>) {
- await user.click(screen.getByRole("button", { name: /Local directory/i }));
- await user.click(screen.getByRole("button", { name: /Choose directory/i }));
+ await user.click(screen.getByRole("button", { name: /Local folder/i }));
+ await user.click(screen.getByRole("button", { name: /Choose folder/i }));
await waitFor(() => expect(screen.getByText("/Users/dev/work/game-client")).toBeInTheDocument());
}
@@ -219,7 +219,7 @@ describe("CreateProjectModal — local directory execution mode", () => {
await pickLocalDirectory(user);
expect(screen.getByRole("button", { name: /^Parallel$/i })).toBeInTheDocument();
- expect(screen.getByRole("radio", { name: /Run in parallel, isolated/i })).toHaveAttribute(
+ expect(screen.getByRole("radio", { name: /Run in parallel/i })).toHaveAttribute(
"aria-checked",
"true",
);
@@ -262,7 +262,7 @@ describe("CreateProjectModal — local directory execution mode", () => {
expect(screen.getByRole("button", { name: /^Direct$/i })).toBeInTheDocument();
// Still selectable — unknown is permissive about what the user MAY choose.
- expect(screen.getByRole("radio", { name: /Run in parallel, isolated/i })).not.toBeDisabled();
+ expect(screen.getByRole("radio", { name: /Run in parallel/i })).not.toBeDisabled();
});
// The preselection is a starting point, not a correction: once the user says
@@ -272,11 +272,11 @@ describe("CreateProjectModal — local directory execution mode", () => {
renderWithI18n(<CreateProjectModal onClose={vi.fn()} />);
await pickLocalDirectory(user);
- await user.click(screen.getByRole("radio", { name: /Edit this folder directly/i }));
+ await user.click(screen.getByRole("radio", { name: /Edit directly/i }));
expect(screen.getByRole("button", { name: /^Direct$/i })).toBeInTheDocument();
// Re-pick (the mocked picker returns the same git repo).
- await user.click(screen.getByRole("button", { name: /Change directory/i }));
+ await user.click(screen.getByRole("button", { name: /Change folder/i }));
await waitFor(() =>
expect(screen.getByRole("button", { name: /^Direct$/i })).toBeInTheDocument(),
);
@@ -293,7 +293,7 @@ describe("CreateProjectModal — local directory execution mode", () => {
// The compact button uses the short label; the picker carries the full
// title. A git repo preselects parallel, so that is the label here.
expect(screen.getByRole("button", { name: /^Parallel$/i })).toBeInTheDocument();
- expect(screen.getByRole("button", { name: /Change directory/i })).toBeInTheDocument();
+ expect(screen.getByRole("button", { name: /Change folder/i })).toBeInTheDocument();
});
it("still offers parallel mode when the machine has not advertised", async () => {
@@ -303,7 +303,7 @@ describe("CreateProjectModal — local directory execution mode", () => {
await pickLocalDirectory(user);
- expect(screen.getByRole("radio", { name: /Run in parallel, isolated/i })).not.toBeDisabled();
+ expect(screen.getByRole("radio", { name: /Run in parallel/i })).not.toBeDisabled();
});
// The version skew this whole issue is about: newest Desktop, newest daemon,
@@ -317,7 +317,7 @@ describe("CreateProjectModal — local directory execution mode", () => {
await pickLocalDirectory(user);
- expect(screen.getByRole("radio", { name: /Run in parallel, isolated/i })).toBeDisabled();
+ expect(screen.getByRole("radio", { name: /Run in parallel/i })).toBeDisabled();
expect(screen.getByText(/Multica server is too old/i)).toBeInTheDocument();
// And it must not have been preselected either — that would submit a mode
// the server would silently downgrade.
@@ -331,7 +331,7 @@ describe("CreateProjectModal — local directory execution mode", () => {
await pickLocalDirectory(user);
- expect(screen.getByRole("radio", { name: /Run in parallel, isolated/i })).toBeDisabled();
+ expect(screen.getByRole("radio", { name: /Run in parallel/i })).toBeDisabled();
expect(screen.getByText(/not a git repository/i)).toBeInTheDocument();
});
});
diff --git a/packages/views/modals/create-project.tsx b/packages/views/modals/create-project.tsx
index 960fa3d84d..1fbcd7b97b 100644
--- a/packages/views/modals/create-project.tsx
+++ b/packages/views/modals/create-project.tsx
@@ -81,7 +81,7 @@ import {
} from "@multica/core/runtimes";
import { useConfigStore } from "@multica/core/config";
import type { LocalDirectoryExecutionMode } from "@multica/core/types";
-import { LocalDirectoryModeOptions } from "../projects/components/local-directory-mode-dialog";
+import { LocalDirectoryModeOptions } from "../projects/components/local-directory-mode-options";
/**
* Builds the resource_ref for a local directory attached during project
@@ -1029,7 +1029,7 @@ export function CreateProjectModal({ onClose }: { onClose: () => void }) {
size="sm"
variant="ghost"
// Sized to its (short) label so the wider
- // "Change directory…" beside it fits whole.
+ // "Change folder..." beside it fits whole.
className="h-6 shrink-0 text-caption"
>
{effectiveLocalMode === "worktree" ? (
diff --git a/packages/views/projects/components/github-ref-dialog.tsx b/packages/views/projects/components/github-ref-dialog.tsx
deleted file mode 100644
index aecc8c6559..0000000000
--- a/packages/views/projects/components/github-ref-dialog.tsx
+++ /dev/null
@@ -1,105 +0,0 @@
-"use client";
-
-import { useEffect, useState } from "react";
-import { TriangleAlert } from "@multica/ui/icons";
-import { Button } from "@multica/ui/components/ui/button";
-import {
- Dialog,
- DialogContent,
- DialogDescription,
- DialogFooter,
- DialogHeader,
- DialogTitle,
-} from "@multica/ui/components/ui/dialog";
-import { GithubRefField, githubRefHasError } from "./github-ref-field";
-import { useT } from "../../i18n/use-t";
-import { githubShortLabel } from "../../common/github-url";
-
-interface GithubRefDialogProps {
- open: boolean;
- onOpenChange: (open: boolean) => void;
- /** Repository being configured, so the user knows which row this edits. */
- url: string;
- /** Current ref; empty means the repository's default branch. */
- value: string;
- /** Server-side rejection to show inline. */
- errorMessage?: string;
- saving?: boolean;
- onConfirm: (ref: string) => void;
-}
-
-/**
- * Sets the branch an already attached `github_repo` resource works on.
- *
- * A dialog rather than an inline field: unlike renaming a row, this changes
- * where every future task in the project starts AND where it delivers, and
- * that is worth a sentence the row has no space for. The same sentence has to
- * say what it does not do — the ref is read when a task is claimed, so work
- * already underway keeps the branch it started on.
- */
-export function GithubRefDialog({
- open,
- onOpenChange,
- url,
- value,
- errorMessage,
- saving = false,
- onConfirm,
-}: GithubRefDialogProps) {
- const { t } = useT("projects");
- const [draft, setDraft] = useState(value);
-
- // Re-sync on reopen, otherwise the previous row's ref is what shows.
- useEffect(() => {
- if (open) setDraft(value);
- }, [open, value]);
-
- const invalid = githubRefHasError(draft);
-
- return (
- <Dialog open={open} onOpenChange={onOpenChange}>
- <DialogContent className="sm:max-w-md">
- <DialogHeader>
- <DialogTitle>{t(($) => $.resources.ref_dialog_title)}</DialogTitle>
- <DialogDescription>
- {t(($) => $.resources.ref_dialog_description)}
- </DialogDescription>
- </DialogHeader>
-
- <div className="rounded-md bg-muted px-2.5 py-1.5 font-mono text-micro text-muted-foreground break-all">
- {githubShortLabel(url)}
- </div>
-
- <GithubRefField
- id="github-ref"
- value={draft}
- onChange={setDraft}
- onSubmit={() => {
- if (!invalid && !saving) onConfirm(draft.trim());
- }}
- autoFocus
- />
-
- {errorMessage && (
- <div className="flex items-start gap-2 rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-caption text-destructive">
- <TriangleAlert className="size-3.5 mt-0.5 shrink-0" />
- <span>{errorMessage}</span>
- </div>
- )}
-
- <DialogFooter>
- <Button
- variant="ghost"
- onClick={() => onOpenChange(false)}
- disabled={saving}
- >
- {t(($) => $.resources.ref_cancel)}
- </Button>
- <Button onClick={() => onConfirm(draft.trim())} disabled={saving || invalid}>
- {t(($) => $.resources.ref_save)}
- </Button>
- </DialogFooter>
- </DialogContent>
- </Dialog>
- );
-}
diff --git a/packages/views/projects/components/local-directory-mode-dialog.test.tsx b/packages/views/projects/components/local-directory-mode-dialog.test.tsx
deleted file mode 100644
index 39cb5c41da..0000000000
--- a/packages/views/projects/components/local-directory-mode-dialog.test.tsx
+++ /dev/null
@@ -1,121 +0,0 @@
-// @vitest-environment jsdom
-
-import { describe, it, expect, vi } from "vitest";
-import { fireEvent, render, screen } from "@testing-library/react";
-import { I18nProvider } from "@multica/core/i18n/react";
-import type { LocalDirectoryExecutionMode } from "@multica/core/types";
-import enProjects from "../../locales/en/projects.json";
-import enCommon from "../../locales/en/common.json";
-import { LocalDirectoryModeDialog } from "./local-directory-mode-dialog";
-import type { WorktreeUnavailableReason } from "./local-directory-mode-dialog";
-
-const TEST_RESOURCES = { en: { projects: enProjects, common: enCommon } };
-
-function renderDialog(
- overrides: {
- value?: LocalDirectoryExecutionMode;
- unavailableReason?: WorktreeUnavailableReason;
- errorMessage?: string;
- onConfirm?: (mode: LocalDirectoryExecutionMode) => void;
- } = {},
-) {
- const onConfirm = overrides.onConfirm ?? vi.fn();
- render(
- <I18nProvider locale="en" resources={TEST_RESOURCES}>
- <LocalDirectoryModeDialog
- open
- onOpenChange={() => {}}
- path="/Users/dev/work/game-client"
- value={overrides.value ?? "in_place"}
- unavailableReason={overrides.unavailableReason}
- errorMessage={overrides.errorMessage}
- confirmLabel="Save"
- onConfirm={onConfirm}
- />
- </I18nProvider>,
- );
- return { onConfirm };
-}
-
-function worktreeOption(): HTMLElement {
- return screen.getAllByRole("radio")[1] as HTMLElement;
-}
-
-describe("LocalDirectoryModeDialog", () => {
-
- it("marks the current mode as selected", () => {
- renderDialog({ value: "worktree" });
- expect(worktreeOption().getAttribute("aria-checked")).toBe("true");
- expect(screen.getAllByRole("radio")[0]?.getAttribute("aria-checked")).toBe(
- "false",
- );
- });
-
- it("confirms the newly picked mode, not the one it opened with", () => {
- const onConfirm = vi.fn();
- renderDialog({ value: "in_place", onConfirm });
-
- fireEvent.click(worktreeOption());
- fireEvent.click(screen.getByRole("button", { name: "Save" }));
-
- expect(onConfirm).toHaveBeenCalledWith("worktree");
- });
-
- // A non-git folder cannot produce a branch, so offering the option would
- // guarantee the user's first task fails. Disable it where they choose.
- it("disables parallel mode for a non-git folder and says why", () => {
- const onConfirm = vi.fn();
- renderDialog({ unavailableReason: "not_git", onConfirm });
-
- const option = worktreeOption();
- expect(option.hasAttribute("disabled")).toBe(true);
- expect(screen.getByText(/not a git repository/i)).toBeTruthy();
-
- fireEvent.click(option);
- fireEvent.click(screen.getByRole("button", { name: "Save" }));
- // Still the mode it opened with — the disabled option cannot be selected.
- expect(onConfirm).toHaveBeenCalledWith("in_place");
- });
-
- // A server older than the worktree save gate does not reject the mode — it
- // drops execution_mode, answers 201, and the task then runs in the folder the
- // user asked to isolate. Nothing downstream catches that, so the option has
- // to be closed here, and the copy has to say what is actually wrong (#7113).
- it("blocks parallel mode when the server cannot honour it", () => {
- const onConfirm = vi.fn();
- renderDialog({ unavailableReason: "server_outdated", onConfirm });
-
- const option = worktreeOption();
- expect(option.hasAttribute("disabled")).toBe(true);
- const notice = screen.getByText(/Multica server is too old/i);
- expect(notice.textContent).toMatch(/Update the server/i);
-
- fireEvent.click(option);
- fireEvent.click(screen.getByRole("button", { name: "Save" }));
- expect(onConfirm).toHaveBeenCalledWith("in_place");
- });
-
- // The client no longer predicts whether the machine can run the mode — the
- // server decides on save, and this is where its answer lands. Guessing it up
- // front is what disabled the option for a user whose machine was already on
- // the newest release, with an instruction that could not help (#7113).
- it("shows a server rejection inline so the dialog stays actionable", () => {
- renderDialog({
- errorMessage:
- "the Multica runtime on that machine does not support it. Update the Multica app on that machine",
- });
- expect(screen.getByText(/does not support it/i)).toBeTruthy();
- });
-
- it("leaves parallel mode selectable for a git folder, whatever the runtime says", () => {
- const onConfirm = vi.fn();
- renderDialog({ onConfirm });
-
- const option = worktreeOption();
- expect(option.hasAttribute("disabled")).toBe(false);
- fireEvent.click(option);
- fireEvent.click(screen.getByRole("button", { name: "Save" }));
-
- expect(onConfirm).toHaveBeenCalledWith("worktree");
- });
-});
diff --git a/packages/views/projects/components/local-directory-mode-options.test.tsx b/packages/views/projects/components/local-directory-mode-options.test.tsx
new file mode 100644
index 0000000000..0a56a91bc9
--- /dev/null
+++ b/packages/views/projects/components/local-directory-mode-options.test.tsx
@@ -0,0 +1,85 @@
+// @vitest-environment jsdom
+
+import { describe, it, expect, vi } from "vitest";
+import { fireEvent, render, screen } from "@testing-library/react";
+import { I18nProvider } from "@multica/core/i18n/react";
+import type { LocalDirectoryExecutionMode } from "@multica/core/types";
+import enProjects from "../../locales/en/projects.json";
+import enCommon from "../../locales/en/common.json";
+import {
+ LocalDirectoryModeOptions,
+ type WorktreeUnavailableReason,
+} from "./local-directory-mode-options";
+
+const TEST_RESOURCES = { en: { projects: enProjects, common: enCommon } };
+
+function renderOptions(
+ overrides: {
+ value?: LocalDirectoryExecutionMode;
+ unavailableReason?: WorktreeUnavailableReason;
+ } = {},
+) {
+ const onChange = vi.fn();
+ render(
+ <I18nProvider locale="en" resources={TEST_RESOURCES}>
+ <LocalDirectoryModeOptions
+ value={overrides.value ?? "in_place"}
+ onChange={onChange}
+ unavailableReason={overrides.unavailableReason}
+ />
+ </I18nProvider>,
+ );
+ return { onChange };
+}
+
+function worktreeOption(): HTMLElement {
+ return screen.getAllByRole("radio")[1] as HTMLElement;
+}
+
+describe("LocalDirectoryModeOptions", () => {
+ it("marks the current mode as selected", () => {
+ renderOptions({ value: "worktree" });
+ expect(worktreeOption().getAttribute("aria-checked")).toBe("true");
+ expect(screen.getAllByRole("radio")[0]?.getAttribute("aria-checked")).toBe("false");
+ });
+
+ // A non-git folder cannot produce a branch, so offering the option would
+ // guarantee the user's first task fails. Disable it where they choose.
+ it("disables parallel mode for a non-git folder and says why", () => {
+ const { onChange } = renderOptions({ unavailableReason: "not_git" });
+
+ const option = worktreeOption();
+ expect(option.hasAttribute("disabled")).toBe(true);
+ expect(screen.getByText(/not a git repository/i)).toBeTruthy();
+ fireEvent.click(option);
+ expect(onChange).not.toHaveBeenCalled();
+ });
+
+ // A server older than the worktree save gate does not reject the mode — it
+ // drops execution_mode, answers 201, and the task then runs in the folder the
+ // user asked to isolate. Nothing downstream catches that, so the option has
+ // to be closed here, and the copy has to say what is actually wrong (#7113).
+ it("blocks parallel mode when the server cannot honour it", () => {
+ const { onChange } = renderOptions({ unavailableReason: "server_outdated" });
+
+ const option = worktreeOption();
+ expect(option.hasAttribute("disabled")).toBe(true);
+ expect(screen.getByText(/Multica server is too old/i).textContent).toMatch(
+ /Update the server/i,
+ );
+ fireEvent.click(option);
+ expect(onChange).not.toHaveBeenCalled();
+ });
+
+ // The client no longer predicts whether the machine can run the mode — the
+ // server decides on save. Guessing it up front is what disabled the option
+ // for a user whose machine was already on the newest release (#7113).
+ it("leaves parallel mode selectable for a git folder, whatever the runtime says", () => {
+ const { onChange } = renderOptions();
+
+ const option = worktreeOption();
+ expect(option.hasAttribute("disabled")).toBe(false);
+ fireEvent.click(option);
+ expect(onChange).toHaveBeenCalledWith("worktree");
+ });
+});
diff --git a/packages/views/projects/components/local-directory-mode-dialog.tsx b/packages/views/projects/components/local-directory-mode-options.tsx
similarity index 57%
rename from packages/views/projects/components/local-directory-mode-dialog.tsx
rename to packages/views/projects/components/local-directory-mode-options.tsx
index a1e765131b..7599d6366b 100644
--- a/packages/views/projects/components/local-directory-mode-dialog.tsx
+++ b/packages/views/projects/components/local-directory-mode-options.tsx
@@ -1,17 +1,7 @@
"use client";
-import { useEffect, useState } from "react";
import { GitBranch, Pencil, TriangleAlert } from "@multica/ui/icons";
import type { LocalDirectoryExecutionMode } from "@multica/core/types";
-import { Button } from "@multica/ui/components/ui/button";
-import {
- Dialog,
- DialogContent,
- DialogDescription,
- DialogFooter,
- DialogHeader,
- DialogTitle,
-} from "@multica/ui/components/ui/dialog";
import { useT } from "../../i18n/use-t";
/**
@@ -23,8 +13,8 @@ import { useT } from "../../i18n/use-t";
* SERVER says about itself: whether it understands `execution_mode` at all.
*
* Whether the MACHINE can run the mode is deliberately absent. That is the
- * server's question, asked on every save, and a rejection comes back as
- * `errorMessage` rather than as a disabled option guessed at up front (#7113).
+ * server's question, asked on every save, and a rejection comes back as an
+ * inline error rather than as a disabled option guessed at up front (#7113).
* But deferring to the server is only safe once the server has said it will
* actually check: older ones drop the field and answer 201, and the task then
* edits the directory the user asked to isolate.
@@ -33,25 +23,18 @@ import { useT } from "../../i18n/use-t";
*/
export type WorktreeUnavailableReason = "not_git" | "server_outdated";
-interface LocalDirectoryModeDialogProps {
- open: boolean;
- onOpenChange: (open: boolean) => void;
- /** Absolute path being configured, shown so the user knows what they picked. */
- path: string;
- /** Mode to preselect — the current mode when editing, in_place when adding. */
+interface LocalDirectoryModeOptionsProps {
value: LocalDirectoryExecutionMode;
- /** Set when worktree cannot be chosen; the option renders disabled with a reason. */
+ onChange: (mode: LocalDirectoryExecutionMode) => void;
unavailableReason?: WorktreeUnavailableReason;
- /** Server-side rejection to show inline (e.g. a 422 that only the API can detect). */
- errorMessage?: string;
- saving?: boolean;
- /** Confirm label differs between adding a resource and editing one. */
- confirmLabel: string;
- onConfirm: (mode: LocalDirectoryExecutionMode) => void;
}
/**
- * Mode picker for a local_directory resource.
+ * The two-option choice for how runs use a local_directory resource.
+ *
+ * Shared by the create-project modal, the resources section's add flow and its
+ * mode chip, so the same decision offers literally the same options, copy and
+ * blocked states wherever it is made.
*
* Deliberately does NOT surface the raw `in_place` / `worktree` identifiers as
* the primary label. The choice a user is actually making is about how they get
@@ -59,83 +42,6 @@ interface LocalDirectoryModeDialogProps {
* they review — so the options lead with that, and the identifier is only a
* secondary hint for anyone matching this against the CLI or the docs.
*/
-export function LocalDirectoryModeDialog({
- open,
- onOpenChange,
- path,
- value,
- unavailableReason,
- errorMessage,
- saving = false,
- confirmLabel,
- onConfirm,
-}: LocalDirectoryModeDialogProps) {
- const { t } = useT("projects");
- const [selected, setSelected] = useState<LocalDirectoryExecutionMode>(value);
-
- // Re-sync when the dialog is reopened for a different resource, otherwise the
- // previous row's mode would be preselected for this one.
- useEffect(() => {
- if (open) setSelected(value);
- }, [open, value]);
-
- return (
- <Dialog open={open} onOpenChange={onOpenChange}>
- <DialogContent className="sm:max-w-lg">
- <DialogHeader>
- <DialogTitle>{t(($) => $.resources.mode_dialog_title)}</DialogTitle>
- <DialogDescription>
- {t(($) => $.resources.mode_dialog_description)}
- </DialogDescription>
- </DialogHeader>
-
- <div className="rounded-md bg-muted px-2.5 py-1.5 font-mono text-micro text-muted-foreground break-all">
- {path}
- </div>
-
- <LocalDirectoryModeOptions
- value={selected}
- onChange={setSelected}
- unavailableReason={unavailableReason}
- />
-
- {errorMessage && (
- <div className="flex items-start gap-2 rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-caption text-destructive">
- <TriangleAlert className="size-3.5 mt-0.5 shrink-0" />
- <span>{errorMessage}</span>
- </div>
- )}
-
- <DialogFooter>
- <Button
- variant="ghost"
- onClick={() => onOpenChange(false)}
- disabled={saving}
- >
- {t(($) => $.resources.mode_cancel)}
- </Button>
- <Button onClick={() => onConfirm(selected)} disabled={saving}>
- {confirmLabel}
- </Button>
- </DialogFooter>
- </DialogContent>
- </Dialog>
- );
-}
-
-interface LocalDirectoryModeOptionsProps {
- value: LocalDirectoryExecutionMode;
- onChange: (mode: LocalDirectoryExecutionMode) => void;
- unavailableReason?: WorktreeUnavailableReason;
-}
-
-/**
- * The two-option choice itself, without any surrounding chrome.
- *
- * Shared so the dialog (editing an existing resource) and the compact picker in
- * the create-project modal offer literally the same options, copy and blocked
- * states — the decision is identical, only the container differs.
- */
export function LocalDirectoryModeOptions({
value,
onChange,
@@ -218,7 +124,7 @@ function ModeOption({
{icon}
</span>
<span className="min-w-0 flex-1">
- <span className="flex items-center gap-2">
+ <span className="flex flex-wrap items-center gap-x-2">
<span className="text-body font-medium">{title}</span>
<span className="font-mono text-micro text-muted-foreground">
{identifier}
diff --git a/packages/views/projects/components/project-resources-github-ref.test.tsx b/packages/views/projects/components/project-resources-github-ref.test.tsx
index 8187a979b0..2196292ff3 100644
--- a/packages/views/projects/components/project-resources-github-ref.test.tsx
+++ b/packages/views/projects/components/project-resources-github-ref.test.tsx
@@ -167,7 +167,7 @@ describe("ProjectResourcesSection — github_repo checkout ref", () => {
expect(screen.getAllByText("multica-ai/api")).not.toHaveLength(0);
expect(screen.getByText(AVAILABLE_REPO.description)).toBeTruthy();
- fireEvent.click(screen.getByRole("button", { name: /add resource/i }));
+ fireEvent.click(screen.getByRole("button", { name: /add repository/i }));
expect(screen.getByText(ATTACHABLE_REPO.description)).toBeTruthy();
fireEvent.click(
screen.getByRole("button", { name: /multica-ai\/daemon/i }),
@@ -183,7 +183,7 @@ describe("ProjectResourcesSection — github_repo checkout ref", () => {
it("saves a new ref while preserving the rest of the stored ref", async () => {
renderWithI18n(<ProjectResourcesSection projectId="p1" />);
- fireEvent.click(screen.getAllByRole("button", { name: /change the branch tasks work on/i })[0]!);
+ fireEvent.click(screen.getByRole("button", { name: "release/2026-09" }));
const input = screen.getByLabelText(/starting branch/i);
fireEvent.change(input, { target: { value: "release/2026-10" } });
fireEvent.click(screen.getByRole("button", { name: /^save$/i }));
@@ -206,7 +206,7 @@ describe("ProjectResourcesSection — github_repo checkout ref", () => {
it("clearing the field drops the key so tasks fall back to the default branch", async () => {
renderWithI18n(<ProjectResourcesSection projectId="p1" />);
- fireEvent.click(screen.getAllByRole("button", { name: /change the branch tasks work on/i })[0]!);
+ fireEvent.click(screen.getByRole("button", { name: "release/2026-09" }));
fireEvent.change(screen.getByLabelText(/starting branch/i), {
target: { value: "" },
});
@@ -225,14 +225,14 @@ describe("ProjectResourcesSection — github_repo checkout ref", () => {
it("refuses to save a ref git could never resolve", async () => {
renderWithI18n(<ProjectResourcesSection projectId="p1" />);
- fireEvent.click(screen.getAllByRole("button", { name: /change the branch tasks work on/i })[0]!);
+ fireEvent.click(screen.getByRole("button", { name: "release/2026-09" }));
fireEvent.change(screen.getByLabelText(/starting branch/i), {
target: { value: "main..dev" },
});
const save = screen.getByRole("button", { name: /^save$/i }) as HTMLButtonElement;
expect(save.disabled).toBe(true);
- expect(screen.getByText(/not a valid branch, tag, or commit/i)).toBeTruthy();
+ expect(screen.getByText(/not a valid branch name/i)).toBeTruthy();
fireEvent.click(save);
expect(updateMock).not.toHaveBeenCalled();
});
@@ -240,15 +240,15 @@ describe("ProjectResourcesSection — github_repo checkout ref", () => {
it("attaches a repo with the ref typed alongside its URL", async () => {
renderWithI18n(<ProjectResourcesSection projectId="p1" />);
- fireEvent.click(screen.getByRole("button", { name: /add resource/i }));
- const urlInput = screen.getByLabelText(/attach a github repo/i);
+ fireEvent.click(screen.getByRole("button", { name: /add repository/i }));
+ const urlInput = screen.getByLabelText(/paste a github url/i);
fireEvent.change(urlInput, {
target: { value: "https://github.com/multica-ai/other" },
});
fireEvent.change(screen.getByLabelText(/starting branch/i), {
target: { value: "main" },
});
- fireEvent.click(screen.getByRole("button", { name: /^add$/i }));
+ fireEvent.click(screen.getByRole("button", { name: /^add multica-ai\//i }));
await waitFor(() => expect(createMock).toHaveBeenCalledTimes(1));
expect(createMock.mock.calls[0]?.[0]).toEqual({
@@ -257,22 +257,58 @@ describe("ProjectResourcesSection — github_repo checkout ref", () => {
});
});
+ // The server accepts scp-like `[user@]host:path`, and SSH host aliases for
+ // multiple git accounts are written exactly that way, so the field has to
+ // treat them as addresses rather than as search terms.
+ it.each([
+ ["an SSH host alias", "github-work:team/repo.git"],
+ ["a user@host address on another server", "[email protected]:team/repo.git"],
+ ])("offers to add %s that is not in the workspace list", async (_label, address) => {
+ renderWithI18n(<ProjectResourcesSection projectId="p1" />);
+
+ fireEvent.click(screen.getByRole("button", { name: /add repository/i }));
+ const input = screen.getByLabelText(/paste a github url/i);
+ fireEvent.change(input, { target: { value: address } });
+
+ expect(screen.getByRole("button", { name: `Add ${address}` })).toBeTruthy();
+ fireEvent.keyDown(input, { key: "Enter" });
+
+ await waitFor(() => expect(createMock).toHaveBeenCalledTimes(1));
+ expect(createMock.mock.calls[0]?.[0]).toEqual({
+ resource_type: "github_repo",
+ resource_ref: { url: address },
+ });
+ });
+
+ it.each(["multica", "agent sdk"])("keeps %j a search rather than an address", (term) => {
+ renderWithI18n(<ProjectResourcesSection projectId="p1" />);
+
+ fireEvent.click(screen.getByRole("button", { name: /add repository/i }));
+ const input = screen.getByLabelText(/paste a github url/i);
+ fireEvent.change(input, { target: { value: term } });
+
+ expect(screen.queryByRole("button", { name: `Add ${term}` })).toBeNull();
+ expect(screen.queryByLabelText(/starting branch/i)).toBeNull();
+ fireEvent.keyDown(input, { key: "Enter" });
+ expect(createMock).not.toHaveBeenCalled();
+ });
+
it("splits a pasted /tree/ URL into the repo and the branch it points at", async () => {
renderWithI18n(<ProjectResourcesSection projectId="p1" />);
- fireEvent.click(screen.getByRole("button", { name: /add resource/i }));
+ fireEvent.click(screen.getByRole("button", { name: /add repository/i }));
// What someone copies out of the address bar when they want a branch.
// Stored whole, this is a clone URL that does not exist.
- fireEvent.change(screen.getByLabelText(/attach a github repo/i), {
+ fireEvent.change(screen.getByLabelText(/paste a github url/i), {
target: { value: "https://github.com/multica-ai/other/tree/release/2026-09" },
});
- const urlInput = screen.getByLabelText(/attach a github repo/i) as HTMLInputElement;
+ const urlInput = screen.getByLabelText(/paste a github url/i) as HTMLInputElement;
const refInput = screen.getByLabelText(/starting branch/i) as HTMLInputElement;
expect(urlInput.value).toBe("https://github.com/multica-ai/other");
expect(refInput.value).toBe("release/2026-09");
- fireEvent.click(screen.getByRole("button", { name: /^add$/i }));
+ fireEvent.click(screen.getByRole("button", { name: /^add multica-ai\//i }));
await waitFor(() => expect(createMock).toHaveBeenCalledTimes(1));
expect(createMock.mock.calls[0]?.[0]).toEqual({
resource_type: "github_repo",
@@ -288,8 +324,8 @@ describe("ProjectResourcesSection — github_repo checkout ref", () => {
it("normalises a pasted browse URL even when a branch is already filled in", async () => {
renderWithI18n(<ProjectResourcesSection projectId="p1" />);
- fireEvent.click(screen.getByRole("button", { name: /add resource/i }));
- const urlInput = () => screen.getByLabelText(/attach a github repo/i) as HTMLInputElement;
+ fireEvent.click(screen.getByRole("button", { name: /add repository/i }));
+ const urlInput = () => screen.getByLabelText(/paste a github url/i) as HTMLInputElement;
const refInput = () => screen.getByLabelText(/starting branch/i) as HTMLInputElement;
fireEvent.change(urlInput(), {
@@ -304,7 +340,7 @@ describe("ProjectResourcesSection — github_repo checkout ref", () => {
expect(urlInput().value).toBe("https://github.com/multica-ai/two");
expect(refInput().value).toBe("main");
- fireEvent.click(screen.getByRole("button", { name: /^add$/i }));
+ fireEvent.click(screen.getByRole("button", { name: /^add multica-ai\//i }));
await waitFor(() => expect(createMock).toHaveBeenCalledTimes(1));
expect(createMock.mock.calls[0]?.[0]).toEqual({
resource_type: "github_repo",
@@ -315,11 +351,11 @@ describe("ProjectResourcesSection — github_repo checkout ref", () => {
it("omits the ref key entirely when the field is left empty", async () => {
renderWithI18n(<ProjectResourcesSection projectId="p1" />);
- fireEvent.click(screen.getByRole("button", { name: /add resource/i }));
- fireEvent.change(screen.getByLabelText(/attach a github repo/i), {
+ fireEvent.click(screen.getByRole("button", { name: /add repository/i }));
+ fireEvent.change(screen.getByLabelText(/paste a github url/i), {
target: { value: "https://github.com/multica-ai/other" },
});
- fireEvent.click(screen.getByRole("button", { name: /^add$/i }));
+ fireEvent.click(screen.getByRole("button", { name: /^add multica-ai\//i }));
await waitFor(() => expect(createMock).toHaveBeenCalledTimes(1));
expect(createMock.mock.calls[0]?.[0]).toEqual({
@@ -331,15 +367,15 @@ describe("ProjectResourcesSection — github_repo checkout ref", () => {
it("blocks attaching when the ref is invalid, without touching the URL field", () => {
renderWithI18n(<ProjectResourcesSection projectId="p1" />);
- fireEvent.click(screen.getByRole("button", { name: /add resource/i }));
- fireEvent.change(screen.getByLabelText(/attach a github repo/i), {
+ fireEvent.click(screen.getByRole("button", { name: /add repository/i }));
+ fireEvent.change(screen.getByLabelText(/paste a github url/i), {
target: { value: "https://github.com/multica-ai/other" },
});
fireEvent.change(screen.getByLabelText(/starting branch/i), {
target: { value: "bad ref" },
});
- const add = screen.getByRole("button", { name: /^add$/i }) as HTMLButtonElement;
+ const add = screen.getByRole("button", { name: /^add multica-ai\//i }) as HTMLButtonElement;
expect(add.disabled).toBe(true);
fireEvent.click(add);
expect(createMock).not.toHaveBeenCalled();
@@ -367,7 +403,7 @@ describe("ProjectResourcesSection — github_repo checkout ref", () => {
it("declines a pasted commit id and points at the per-task escape hatch", () => {
renderWithI18n(<ProjectResourcesSection projectId="p1" />);
- fireEvent.click(screen.getAllByRole("button", { name: /change the branch tasks work on/i })[0]!);
+ fireEvent.click(screen.getByRole("button", { name: "release/2026-09" }));
fireEvent.change(screen.getByLabelText(/starting branch/i), {
target: { value: "5e0b1cfa0a7d6a1a0f4b3f2e1d0c9b8a7f6e5d4c" },
});
@@ -382,7 +418,7 @@ describe("ProjectResourcesSection — github_repo checkout ref", () => {
it("still accepts a tag-shaped name — it could be a branch, and only the remote knows", async () => {
renderWithI18n(<ProjectResourcesSection projectId="p1" />);
- fireEvent.click(screen.getAllByRole("button", { name: /change the branch tasks work on/i })[0]!);
+ fireEvent.click(screen.getByRole("button", { name: "release/2026-09" }));
fireEvent.change(screen.getByLabelText(/starting branch/i), {
target: { value: "v1.4.0" },
});
@@ -390,4 +426,43 @@ describe("ProjectResourcesSection — github_repo checkout ref", () => {
await waitFor(() => expect(updateMock).toHaveBeenCalledTimes(1));
});
+
+ it("keeps the branch editor open with the server's reason when a save is rejected", async () => {
+ updateMock.mockRejectedValueOnce(new Error("ref is not reachable"));
+ renderWithI18n(<ProjectResourcesSection projectId="p1" />);
+
+ fireEvent.click(screen.getByRole("button", { name: "release/2026-09" }));
+ fireEvent.change(screen.getByLabelText(/starting branch/i), {
+ target: { value: "release/2026-10" },
+ });
+ fireEvent.click(screen.getByRole("button", { name: /^save$/i }));
+
+ expect(await screen.findByText("ref is not reachable")).toBeTruthy();
+ expect((screen.getByLabelText(/starting branch/i) as HTMLInputElement).value).toBe(
+ "release/2026-10",
+ );
+ });
+
+ // One field serves both search and paste; only a URL turns it into an
+ // attach form, so a search term never offers to attach itself.
+ it("filters workspace repositories for a search term without offering to attach it", () => {
+ renderWithI18n(<ProjectResourcesSection projectId="p1" />);
+
+ fireEvent.click(screen.getByRole("button", { name: /add repository/i }));
+ fireEvent.change(screen.getByLabelText(/paste a github url/i), {
+ target: { value: "daemon" },
+ });
+
+ expect(screen.getByRole("button", { name: /multica-ai\/daemon/i })).toBeTruthy();
+ expect(screen.queryByRole("button", { name: /multica-ai\/api/i })).toBeNull();
+ expect(screen.queryByLabelText(/starting branch/i)).toBeNull();
+ });
+
+ // Picking a folder needs this machine's daemon, so web has nothing to offer
+ // in the group until a folder exists somewhere.
+ it("leaves out the local folder group on web when the project has none", () => {
+ renderWithI18n(<ProjectResourcesSection projectId="p1" />);
+ expect(screen.getByText("Repositories")).toBeTruthy();
+ expect(screen.queryByText("Local folders")).toBeNull();
+ });
});
diff --git a/packages/views/projects/components/project-resources-local-directory.test.tsx b/packages/views/projects/components/project-resources-local-directory.test.tsx
index 34c04e2b8a..b4204dd19e 100644
--- a/packages/views/projects/components/project-resources-local-directory.test.tsx
+++ b/packages/views/projects/components/project-resources-local-directory.test.tsx
@@ -1,33 +1,68 @@
// @vitest-environment jsdom
-import { describe, it, expect, vi } from "vitest";
-import { screen } from "@testing-library/react";
+import { describe, it, expect, vi, beforeEach } from "vitest";
+import { fireEvent, screen, waitFor } 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",
-};
+const state = vi.hoisted(() => ({
+ resources: [] as unknown[],
+ runtimes: [] as unknown[],
+ desktop: true,
+ daemon: { daemonId: "daemon-1" as string | null, deviceName: "MacBook" as string | null, running: true },
+ createMock: vi.fn(),
+ updateMock: vi.fn(),
+ pickDirectory: vi.fn(),
+ validateLocalDirectory: vi.fn(),
+}));
+
+const NOW = Date.now();
+
+function folder(id: string, daemonId: string, overrides: Record<string, unknown> = {}) {
+ return {
+ id,
+ project_id: "p1",
+ workspace_id: "workspace-1",
+ resource_type: "local_directory",
+ resource_ref: {
+ local_path: `/Users/dev/work/${id}`,
+ daemon_id: daemonId,
+ label: id,
+ execution_mode: "worktree",
+ },
+ label: null,
+ position: 0,
+ created_at: "2026-08-18T00:00:00Z",
+ created_by: "u1",
+ ...overrides,
+ };
+}
+
+function runtime(daemonId: string, host: string, status: "online" | "offline") {
+ return {
+ id: `rt-${daemonId}`,
+ workspace_id: "workspace-1",
+ daemon_id: daemonId,
+ name: `Claude (${host})`,
+ runtime_mode: "local",
+ provider: "claude",
+ launch_header: "",
+ status,
+ device_info: `${host} · claude 1.0.0`,
+ metadata: {},
+ owner_id: "u1",
+ visibility: "private",
+ last_seen_at: new Date(NOW - (status === "online" ? 10_000 : 3_600_000)).toISOString(),
+ created_at: "2026-05-17T11:00:00Z",
+ updated_at: "2026-05-17T11:00:00Z",
+ };
+}
vi.mock("@tanstack/react-query", () => ({
useQuery: (options: { queryKey?: unknown[] }) => {
const key = options?.queryKey?.[0];
- if (key === "project-resources") return { data: [RESOURCE] };
+ if (key === "project-resources") return { data: state.resources };
+ if (key === "runtimes") return { data: state.runtimes };
return { data: [] };
},
queryOptions: (options: unknown) => options,
@@ -35,17 +70,18 @@ vi.mock("@tanstack/react-query", () => ({
vi.mock("@multica/core/projects", () => ({
projectResourcesOptions: () => ({ queryKey: ["project-resources"], queryFn: vi.fn() }),
- useCreateProjectResource: () => ({ mutateAsync: vi.fn() }),
- useUpdateProjectResource: () => ({ mutateAsync: vi.fn() }),
+ useCreateProjectResource: () => ({ mutateAsync: state.createMock, isPending: false }),
+ useUpdateProjectResource: () => ({ mutateAsync: state.updateMock }),
useDeleteProjectResource: () => ({ mutateAsync: vi.fn() }),
}));
vi.mock("@multica/core/config", () => ({
- useConfigStore: (selector: (state: { localWorktreeSupported: boolean }) => unknown) =>
+ useConfigStore: (selector: (s: { localWorktreeSupported: boolean }) => unknown) =>
selector({ localWorktreeSupported: true }),
}));
-vi.mock("@multica/core/runtimes", () => ({
+vi.mock("@multica/core/runtimes", async (importOriginal) => ({
+ ...(await importOriginal<typeof import("@multica/core/runtimes")>()),
runtimeListOptions: () => ({ queryKey: ["runtimes"], queryFn: vi.fn() }),
runtimeAdvertisesLocalWorktree: () => true,
}));
@@ -54,12 +90,12 @@ 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(),
+ isDesktopShell: () => state.desktop,
+ pickDirectory: state.pickDirectory,
+ validateLocalDirectory: state.validateLocalDirectory,
}));
vi.mock("../../platform/use-local-daemon-status", () => ({
- useLocalDaemonStatus: () => ({ daemonId: "daemon-1", deviceName: "MacBook", running: true }),
+ useLocalDaemonStatus: () => state.daemon,
}));
vi.mock("sonner", () => ({ toast: { success: vi.fn(), error: vi.fn() } }));
@@ -67,25 +103,199 @@ import { ProjectResourcesSection } from "./project-resources-section";
const strings = en.resources;
-describe("ProjectResourcesSection — local directory row", () => {
+function pickFolder(isGitRepo: boolean) {
+ state.pickDirectory.mockResolvedValueOnce({
+ ok: true,
+ path: "/Users/dev/work/game-client",
+ basename: "game-client",
+ });
+ state.validateLocalDirectory.mockResolvedValueOnce({ ok: true, is_git_repo: isGitRepo });
+ fireEvent.click(screen.getByRole("button", { name: strings.local_pick }));
+}
+
+beforeEach(() => {
+ state.resources = [];
+ state.runtimes = [];
+ state.desktop = true;
+ state.daemon = { daemonId: "daemon-1", deviceName: "MacBook", running: true };
+ state.createMock.mockReset().mockResolvedValue({});
+ state.updateMock.mockReset().mockResolvedValue({});
+ state.pickDirectory.mockReset();
+ state.validateLocalDirectory.mockReset();
+});
+
+describe("ProjectResourcesSection — local folders", () => {
// 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", () => {
+ state.resources = [folder("game-client", "daemon-1", { label: "Game Client" })];
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.
+ // A folder is identified by its path, so a rename only changed the title and
+ // read as a broken edit action beside the other controls (MUL-7525). What
+ // remains is the one setting that changes how tasks run on the folder.
it("offers the execution mode and remove actions, and no rename", () => {
+ state.resources = [folder("game-client", "daemon-1")];
renderWithI18n(<ProjectResourcesSection projectId="p1" />);
- expect(screen.getByRole("button", { name: strings.mode_edit_tooltip })).toBeInTheDocument();
+ expect(screen.getByRole("button", { name: strings.mode_badge_worktree })).toBeInTheDocument();
expect(screen.getByRole("button", { name: strings.remove_tooltip })).toBeInTheDocument();
expect(screen.queryByRole("button", { name: /rename/i })).not.toBeInTheDocument();
expect(screen.queryByRole("textbox")).not.toBeInTheDocument();
});
+
+ // The server allows one folder per computer, so a machine that already has
+ // one offers no way to add a second.
+ it("does not offer another folder on a computer that already has one", () => {
+ state.resources = [folder("game-client", "daemon-1")];
+ renderWithI18n(<ProjectResourcesSection projectId="p1" />);
+ expect(screen.queryByRole("button", { name: strings.local_pick })).not.toBeInTheDocument();
+ });
+
+ it("lists folders under the computer they belong to, with that computer's state", () => {
+ state.runtimes = [
+ runtime("daemon-1", "macbook.local", "online"),
+ runtime("daemon-2", "studio-pc.local", "offline"),
+ ];
+ state.resources = [folder("server-checkout", "daemon-2")];
+ renderWithI18n(<ProjectResourcesSection projectId="p1" />);
+
+ expect(screen.getByText("studio-pc.local")).toBeInTheDocument();
+ expect(screen.getByText(`· ${strings.local_offline}`)).toBeInTheDocument();
+ expect(screen.getByText("server-checkout")).toBeInTheDocument();
+ // This computer has no folder yet, so it shows the slot to choose one.
+ expect(screen.getByText(strings.local_this_computer)).toBeInTheDocument();
+ expect(screen.getByRole("button", { name: strings.local_pick })).toBeEnabled();
+ });
+
+ it("falls back to a generic name for a computer with no registered runtime", () => {
+ state.resources = [folder("old-checkout", "daemon-gone")];
+ renderWithI18n(<ProjectResourcesSection projectId="p1" />);
+ expect(screen.getByText(strings.local_unknown_computer)).toBeInTheDocument();
+ });
+
+ // Picking needs this machine's daemon, so web cannot add a folder; editing
+ // one only rewrites the resource, so that stays available.
+ it("lets web edit existing folders but not add one", () => {
+ state.desktop = false;
+ state.daemon = { daemonId: null, deviceName: null, running: false };
+ state.runtimes = [runtime("daemon-2", "studio-pc.local", "online")];
+ state.resources = [folder("server-checkout", "daemon-2")];
+ renderWithI18n(<ProjectResourcesSection projectId="p1" />);
+
+ expect(screen.getByText("studio-pc.local")).toBeInTheDocument();
+ expect(screen.queryByText(`· ${strings.local_offline}`)).not.toBeInTheDocument();
+ expect(screen.queryByRole("button", { name: strings.local_pick })).not.toBeInTheDocument();
+ expect(screen.getByRole("button", { name: strings.mode_badge_worktree })).toBeInTheDocument();
+ expect(screen.getByRole("button", { name: strings.remove_tooltip })).toBeInTheDocument();
+ });
+
+ it("asks to start the daemon before a folder can be chosen", () => {
+ state.daemon = { daemonId: null, deviceName: "MacBook", running: false };
+ renderWithI18n(<ProjectResourcesSection projectId="p1" />);
+ expect(screen.getByText(strings.local_daemon_offline_hint)).toBeInTheDocument();
+ expect(screen.getByRole("button", { name: strings.local_pick })).toBeDisabled();
+ });
+
+ // The mode is part of what the user is choosing — whether tasks edit this
+ // folder or hand back a branch — so it is asked before anything is created.
+ it("asks for the mode in place and creates the folder with it", async () => {
+ renderWithI18n(<ProjectResourcesSection projectId="p1" />);
+ pickFolder(true);
+
+ expect(await screen.findByText("/Users/dev/work/game-client")).toBeInTheDocument();
+ const [direct, parallel] = screen.getAllByRole("radio");
+ expect(parallel).toHaveAttribute("aria-checked", "true");
+ expect(state.createMock).not.toHaveBeenCalled();
+
+ fireEvent.click(direct!);
+ fireEvent.click(screen.getByRole("button", { name: strings.mode_add }));
+
+ await waitFor(() =>
+ expect(state.createMock).toHaveBeenCalledWith({
+ resource_type: "local_directory",
+ resource_ref: {
+ local_path: "/Users/dev/work/game-client",
+ daemon_id: "daemon-1",
+ label: "game-client",
+ execution_mode: "in_place",
+ },
+ }),
+ );
+ });
+
+ it("keeps the picked folder on screen with the server's reason when adding fails", async () => {
+ state.createMock.mockRejectedValueOnce(new Error("this computer already has a folder"));
+ renderWithI18n(<ProjectResourcesSection projectId="p1" />);
+ pickFolder(true);
+
+ fireEvent.click(await screen.findByRole("button", { name: strings.mode_add }));
+
+ expect(await screen.findByText("this computer already has a folder")).toBeInTheDocument();
+ expect(screen.getByText("/Users/dev/work/game-client")).toBeInTheDocument();
+ });
+
+ it("starts a non-git folder on direct editing, with parallel closed", async () => {
+ renderWithI18n(<ProjectResourcesSection projectId="p1" />);
+ pickFolder(false);
+
+ await screen.findByText("/Users/dev/work/game-client");
+ const [direct, parallel] = screen.getAllByRole("radio");
+ expect(direct).toHaveAttribute("aria-checked", "true");
+ expect(parallel).toBeDisabled();
+ });
+
+ it("returns to the slot when the picked folder is cancelled", async () => {
+ renderWithI18n(<ProjectResourcesSection projectId="p1" />);
+ pickFolder(true);
+
+ fireEvent.click(await screen.findByRole("button", { name: strings.mode_cancel }));
+
+ expect(screen.getByRole("button", { name: strings.local_pick })).toBeInTheDocument();
+ expect(state.createMock).not.toHaveBeenCalled();
+ });
+
+ it("saves a mode as soon as it is picked, keeping the rest of the ref", async () => {
+ state.resources = [folder("game-client", "daemon-1")];
+ renderWithI18n(<ProjectResourcesSection projectId="p1" />);
+
+ fireEvent.click(screen.getByRole("button", { name: strings.mode_badge_worktree }));
+ fireEvent.click(screen.getAllByRole("radio")[0]!);
+
+ await waitFor(() =>
+ expect(state.updateMock).toHaveBeenCalledWith({
+ resourceId: "game-client",
+ data: {
+ resource_ref: {
+ local_path: "/Users/dev/work/game-client",
+ daemon_id: "daemon-1",
+ label: "game-client",
+ execution_mode: "in_place",
+ },
+ },
+ }),
+ );
+ });
+
+ // The likely failure is the server's daemon-version gate; a toast alone
+ // would leave nothing to act on.
+ it("shows a rejected mode change inside the picker", async () => {
+ state.updateMock.mockRejectedValueOnce(new Error("daemon is too old for parallel runs"));
+ state.resources = [folder("game-client", "daemon-1", {
+ resource_ref: {
+ local_path: "/Users/dev/work/game-client",
+ daemon_id: "daemon-1",
+ label: "game-client",
+ execution_mode: "in_place",
+ },
+ })];
+ renderWithI18n(<ProjectResourcesSection projectId="p1" />);
+
+ fireEvent.click(screen.getByRole("button", { name: strings.mode_badge_in_place }));
+ fireEvent.click(screen.getAllByRole("radio")[1]!);
+
+ expect(await screen.findByText("daemon is too old for parallel runs")).toBeInTheDocument();
+ });
});
diff --git a/packages/views/projects/components/project-resources-section.tsx b/packages/views/projects/components/project-resources-section.tsx
index 35d5fad160..a1756279a6 100644
--- a/packages/views/projects/components/project-resources-section.tsx
+++ b/packages/views/projects/components/project-resources-section.tsx
@@ -1,15 +1,20 @@
"use client";
-import { useState } from "react";
+import { useMemo, useState } from "react";
import { useQuery } from "@tanstack/react-query";
import {
ChevronRight,
FolderGit,
FolderOpen,
GitBranch,
+ Laptop,
+ Link2,
+ Monitor,
+ Pencil,
Plus,
Search,
Trash2,
+ TriangleAlert,
} from "@multica/ui/icons";
import { toast } from "sonner";
import {
@@ -22,6 +27,7 @@ import { splitGithubUrlRef } from "@multica/core/github";
import { useWorkspaceId } from "@multica/core/hooks";
import { useCurrentWorkspace } from "@multica/core/paths";
import type {
+ AgentRuntime,
GithubRepoResourceRef,
LocalDirectoryExecutionMode,
LocalDirectoryResourceRef,
@@ -32,7 +38,6 @@ import {
runtimeListOptions,
} from "@multica/core/runtimes";
import { useConfigStore } from "@multica/core/config";
-import { Badge } from "@multica/ui/components/ui/badge";
import { Button } from "@multica/ui/components/ui/button";
import { Spinner } from "@multica/ui/components/ui/spinner";
import {
@@ -46,38 +51,44 @@ import {
TooltipContent,
} from "@multica/ui/components/ui/tooltip";
import { TooltipHint } from "@multica/ui/components/common/tooltip-hint";
+import { IconButton } from "@multica/ui/components/common/icon-button";
+import { cn } from "@multica/ui/lib/utils";
import {
isDesktopShell,
pickDirectory,
useLocalDaemonStatus,
validateLocalDirectory,
+ type LocalDaemonStatus,
type ValidateLocalDirectoryResult,
} from "../../platform";
import {
- LocalDirectoryModeDialog,
+ LocalDirectoryModeOptions,
type WorktreeUnavailableReason,
-} from "./local-directory-mode-dialog";
-import { GithubRefDialog } from "./github-ref-dialog";
+} from "./local-directory-mode-options";
import { GithubRefField, githubRefHasError } from "./github-ref-field";
import { localDirectoryLabel } from "./local-directory-label";
+import { buildRuntimeMachines } from "../../runtimes/components/runtime-machines";
import { useT } from "../../i18n";
import { githubShortLabel } from "../../common/github-url";
// Project Resources sidebar section.
//
-// Type-dispatched at the row + add-flow level. Add a new resource_type by:
+// Grouped by what a resource applies to: repositories apply to every run on
+// every machine, while a local folder only applies to runs on the one machine
+// it is pinned to (at most one per machine). Add a new resource_type by:
// (1) extending the server validator
// (2) extending ProjectResourceType in @multica/core/types
-// (3) adding a render case in ResourceRow and an add-control here
-function isGithubRef(r: ProjectResource): r is ProjectResource & {
- resource_ref: GithubRepoResourceRef;
-} {
+// (3) giving it a group here; unknown types fall through to a plain row
+type GithubResource = ProjectResource & { resource_ref: GithubRepoResourceRef };
+type LocalDirectoryResource = ProjectResource & {
+ resource_ref: LocalDirectoryResourceRef;
+};
+
+function isGithubRef(r: ProjectResource): r is GithubResource {
return r.resource_type === "github_repo";
}
-function isLocalDirectoryRef(r: ProjectResource): r is ProjectResource & {
- resource_ref: LocalDirectoryResourceRef;
-} {
+function isLocalDirectoryRef(r: ProjectResource): r is LocalDirectoryResource {
return r.resource_type === "local_directory";
}
@@ -93,95 +104,175 @@ function executionModeOf(
return ref.execution_mode === "worktree" ? "worktree" : "in_place";
}
-/** Pending mode edit — either for a directory being added, or an existing row. */
-type ModeDialogState = {
- path: string;
- daemonId: string | null;
- mode: LocalDirectoryExecutionMode;
- /** undefined = unknown (older desktop build); treated as "cannot verify". */
- isGitRepo: boolean | undefined;
- /** Set for an edit; absent when adding a new resource. */
- resource?: ProjectResource & { resource_ref: LocalDirectoryResourceRef };
- /** Only used when adding. */
- label?: string;
-};
+function errorMessage(err: unknown, fallback: string): string {
+ return err instanceof Error && err.message ? err.message : fallback;
+}
-type RefDialogState = {
- resource: ProjectResource & { resource_ref: GithubRepoResourceRef };
-};
+/**
+ * A user-typed clone URL, as opposed to a search for a workspace repository.
+ * Accepts the same shapes as the server's isValidGitRepoURL: a URL with a
+ * scheme, or the scp-like `[user@]host:path` shorthand — which is also how SSH
+ * host aliases (`github-work:team/repo.git`) for multiple accounts are written.
+ */
+function looksLikeRepoUrl(value: string): boolean {
+ const trimmed = value.trim();
+ if (trimmed.includes("://")) return true;
+ if (/\s/.test(trimmed)) return false;
+ const colon = trimmed.indexOf(":");
+ if (colon <= 0 || colon === trimmed.length - 1) return false;
+ // `@` only separates a user when it comes before the colon, and a host
+ // must remain between the two.
+ const at = trimmed.indexOf("@");
+ if (at >= colon) return false;
+ return at + 1 < colon;
+}
+
+const chipClassName =
+ "inline-flex h-5 max-w-full shrink-0 items-center gap-1 rounded-sm bg-muted px-1.5 text-micro text-muted-foreground transition-colors hover:bg-surface-selected hover:text-foreground data-[popup-open]:bg-surface-selected data-[popup-open]:text-foreground";
export function ProjectResourcesSection({ projectId }: { projectId: string }) {
const { t } = useT("projects");
const wsId = useWorkspaceId();
- const workspace = useCurrentWorkspace();
- const daemonStatus = useLocalDaemonStatus();
const [open, setOpen] = useState(true);
- const [addOpen, setAddOpen] = useState(false);
- const [repoSearch, setRepoSearch] = useState("");
- const [picking, setPicking] = useState(false);
- const [modeDialog, setModeDialog] = useState<ModeDialogState | null>(null);
- const [modeSaving, setModeSaving] = useState(false);
- const [modeError, setModeError] = useState<string | null>(null);
- const [refDialog, setRefDialog] = useState<RefDialogState | null>(null);
- const [refSaving, setRefSaving] = useState(false);
- const [refError, setRefError] = useState<string | null>(null);
-
const { data: resources = [] } = useQuery(
projectResourcesOptions(wsId, projectId),
);
- const createResource = useCreateProjectResource(wsId, projectId);
- const updateResource = useUpdateProjectResource(wsId, projectId);
- // Desktop-only entry points. We hide (not just disable) on web so users
- // there don't see an action they can never complete — the spec calls for
- // read-only on web because the daemon-id check can't be performed in the
- // browser.
+ const repos = resources.filter(isGithubRef);
+ const folders = resources.filter(isLocalDirectoryRef);
+ const others = resources.filter(
+ (r) => !isGithubRef(r) && !isLocalDirectoryRef(r),
+ );
+ // Picking a folder needs the desktop's daemon_id, so web cannot add one. It
+ // still lists existing folders, and changing their mode or removing them
+ // only rewrites the resource, which works from anywhere.
const desktopMode = isDesktopShell();
- const localDaemonId = daemonStatus.daemonId;
- // Only ever used to decide what to PRESELECT. Whether the machine can run
- // worktree mode is the server's call — it knows its own version, the client
- // would have to infer it from data the server wrote, and that inference is
- // what told a user on the newest release to upgrade it (#7113). The save is
- // gated server-side and surfaced here as an inline error instead.
- const { data: runtimes = [] } = useQuery(runtimeListOptions(wsId));
- // The one thing the client must still check up front: whether this server
- // performs that gate at all. One declared boolean, no inference — servers
- // that predate it drop execution_mode and answer 201.
- const serverValidatesWorktree = useConfigStore((state) => state.localWorktreeSupported);
- // Keyed on the resource's OWN daemon, not the machine the browser happens to
- // be on: a resource is pinned to one machine, and its mode can legitimately
- // be changed from the web app or from a different device. Using the local
- // daemon here would report "too old" for every resource whenever the viewer
- // is not on that machine.
- // Capability, not version, and judged by the daemon's newest runtime row —
- // see runtimeAdvertisesLocalWorktree for why an any-match would keep saying
- // yes after a downgrade.
- const advertisesWorktree = (daemonId: string | null) =>
- runtimeAdvertisesLocalWorktree(runtimes, daemonId);
-
- const attachedUrls = new Set(
- resources.filter(isGithubRef).map((r) => r.resource_ref.url),
+ return (
+ <div>
+ <button
+ type="button"
+ className={`flex w-full items-center gap-1 rounded-md px-2 py-1 text-caption font-medium transition-colors mb-2 hover:bg-accent/70 ${open ? "" : "text-muted-foreground hover:text-foreground"}`}
+ onClick={() => setOpen(!open)}
+ >
+ {t(($) => $.resources.section_header)}
+ <ChevronRight
+ className={`!size-3 shrink-0 stroke-[2.5] text-muted-foreground transition-transform ${open ? "rotate-90" : ""}`}
+ />
+ </button>
+ {open && (
+ <div className="space-y-4 pl-2">
+ <RepositoryGroup wsId={wsId} projectId={projectId} repos={repos} />
+ {(desktopMode || folders.length > 0) && (
+ <LocalFolderGroup
+ wsId={wsId}
+ projectId={projectId}
+ folders={folders}
+ desktopMode={desktopMode}
+ />
+ )}
+ {others.map((resource) => (
+ <UnknownResourceRow key={resource.id} resource={resource} />
+ ))}
+ </div>
+ )}
+ </div>
);
- const attachedLocalPaths = new Set(
- resources
- .filter(isLocalDirectoryRef)
- .filter((r) => r.resource_ref.daemon_id === localDaemonId)
- .map((r) => r.resource_ref.local_path),
+}
+
+function GroupHeader({
+ label,
+ action,
+}: {
+ label: string;
+ action?: React.ReactNode;
+}) {
+ return (
+ <div className="flex h-6 items-center gap-1 text-micro font-medium text-muted-foreground">
+ <span className="truncate">{label}</span>
+ {action && <span className="ml-auto">{action}</span>}
+ </div>
);
- // Per (project, daemon) we allow at most one local_directory — the
- // daemon-side resolver picks the first match by daemon_id, so two rows
- // on the same daemon would silently route the agent into one of them.
- // The server enforces this at the API boundary; the UI mirrors the
- // restriction by hiding the "Add" affordance once a row exists for the
- // current daemon, otherwise users would only discover the limit on a
- // 409 toast.
- const hasLocalDirectoryForCurrentDaemon =
- localDaemonId !== null && attachedLocalPaths.size > 0;
-
- const repoQuery = repoSearch.trim().toLowerCase();
- const filteredRepos =
- workspace?.repos?.filter((repo) => repo.url.toLowerCase().includes(repoQuery)) ?? [];
+}
+
+function InlineError({ message }: { message: string }) {
+ return (
+ <div className="flex items-start gap-2 rounded-md border border-destructive/30 bg-destructive/5 px-2.5 py-1.5 text-caption text-destructive">
+ <TriangleAlert className="size-3.5 mt-0.5 shrink-0" />
+ <span className="min-w-0 break-words">{message}</span>
+ </div>
+ );
+}
+
+function useRemoveResource(resource: ProjectResource) {
+ const { t } = useT("projects");
+ const deleteResource = useDeleteProjectResource(
+ resource.workspace_id,
+ resource.project_id,
+ );
+ const remove = async () => {
+ if (deleteResource.isPending) return;
+ try {
+ await deleteResource.mutateAsync(resource.id);
+ toast.success(t(($) => $.resources.toast_removed));
+ } catch (err) {
+ toast.error(errorMessage(err, t(($) => $.resources.toast_remove_failed)));
+ }
+ };
+ return { remove, removing: deleteResource.isPending };
+}
+
+function RemoveButton({
+ onRemove,
+ removing,
+ alwaysVisible = false,
+}: {
+ onRemove: () => void;
+ removing: boolean;
+ alwaysVisible?: boolean;
+}) {
+ const { t } = useT("projects");
+ return (
+ <TooltipHint label={t(($) => $.resources.remove_tooltip)}>
+ <button
+ type="button"
+ onClick={onRemove}
+ disabled={removing}
+ aria-busy={removing}
+ className={cn(
+ "shrink-0 rounded-sm p-0.5 transition-opacity hover:bg-accent",
+ !alwaysVisible &&
+ "opacity-0 group-hover:opacity-100 focus-visible:opacity-100 disabled:opacity-100",
+ )}
+ aria-label={t(($) => $.resources.remove_tooltip)}
+ >
+ {removing ? (
+ <Spinner className="size-3" aria-hidden="true" />
+ ) : (
+ <Trash2 className="size-3 text-muted-foreground" />
+ )}
+ </button>
+ </TooltipHint>
+ );
+}
+
+// ---------------------------------------------------------------------------
+// Repositories
+
+function RepositoryGroup({
+ wsId,
+ projectId,
+ repos,
+}: {
+ wsId: string;
+ projectId: string;
+ repos: GithubResource[];
+}) {
+ const { t } = useT("projects");
+ const workspace = useCurrentWorkspace();
+ const createResource = useCreateProjectResource(wsId, projectId);
+ const [addOpen, setAddOpen] = useState(false);
+ const attachedUrls = new Set(repos.map((r) => r.resource_ref.url));
const handleAttach = async (url: string, ref?: string) => {
try {
@@ -191,43 +282,699 @@ export function ProjectResourcesSection({ projectId }: { projectId: string }) {
// ref is what "use the default branch" looks like on the wire.
resource_ref: ref ? { url, ref } : { url },
});
- toast.success(t(($) => $.resources.toast_attached));
+ toast.success(t(($) => $.resources.toast_attached));
+ setAddOpen(false);
+ } catch (err) {
+ toast.error(errorMessage(err, t(($) => $.resources.toast_attach_failed)));
+ }
+ };
+
+ return (
+ <div className="space-y-1.5">
+ <GroupHeader
+ label={t(($) => $.resources.repos_group)}
+ action={
+ <Popover open={addOpen} onOpenChange={setAddOpen}>
+ <PopoverTrigger
+ render={
+ <IconButton
+ size="icon-xs"
+ label={t(($) => $.resources.repos_add)}
+ >
+ <Plus />
+ </IconButton>
+ }
+ />
+ <PopoverContent align="end" className="w-72 p-2">
+ <AddRepositoryPanel
+ workspaceRepos={workspace?.repos ?? []}
+ attachedUrls={attachedUrls}
+ busy={createResource.isPending}
+ onAttach={handleAttach}
+ />
+ </PopoverContent>
+ </Popover>
+ }
+ />
+ {repos.length === 0 ? (
+ <p className="text-caption text-muted-foreground">
+ {t(($) => $.resources.repos_empty)}
+ </p>
+ ) : (
+ repos.map((resource) => (
+ <GithubRepoRow
+ key={resource.id}
+ resource={resource}
+ description={
+ workspace?.repos?.find((repo) => repo.url === resource.resource_ref.url)
+ ?.description
+ }
+ />
+ ))
+ )}
+ </div>
+ );
+}
+
+/**
+ * One field for both ways of adding a repository: typing filters the
+ * workspace's repositories, and a pasted clone URL turns the panel into an
+ * attach form for that URL.
+ */
+function AddRepositoryPanel({
+ workspaceRepos,
+ attachedUrls,
+ busy,
+ onAttach,
+}: {
+ workspaceRepos: { url: string; description?: string | null }[];
+ attachedUrls: Set<string>;
+ busy: boolean;
+ onAttach: (url: string, ref?: string) => Promise<void>;
+}) {
+ const { t } = useT("projects");
+ const [query, setQuery] = useState("");
+ const [ref, setRef] = useState("");
+ const [submitting, setSubmitting] = useState(false);
+ const isUrl = looksLikeRepoUrl(query);
+ const refInvalid = isUrl && githubRefHasError(ref);
+
+ // Someone who wants a branch copies it out of the address bar, so a pasted
+ // .../tree/<branch> URL is split into its two halves rather than stored
+ // whole as a clone URL that does not exist. A pasted pair always wins the
+ // branch field: it only shows while a URL is present, so a value already in
+ // it came from the previous URL rather than from something typed ahead.
+ const handleQueryChange = (next: string) => {
+ if (!looksLikeRepoUrl(next)) {
+ setQuery(next);
+ setRef("");
+ return;
+ }
+ const split = splitGithubUrlRef(next);
+ setQuery(split.url);
+ if (split.ref) setRef(split.ref);
+ };
+
+ const submitUrl = async () => {
+ const url = query.trim();
+ if (!url || refInvalid || submitting) return;
+ setSubmitting(true);
+ try {
+ await onAttach(url, ref.trim() || undefined);
+ } finally {
+ setSubmitting(false);
+ }
+ };
+
+ const search = query.trim().toLowerCase();
+ const filtered = workspaceRepos.filter((repo) =>
+ repo.url.toLowerCase().includes(search),
+ );
+ const InputIcon = isUrl ? Link2 : Search;
+
+ return (
+ <div className="space-y-2">
+ <div className="relative">
+ <InputIcon className="pointer-events-none absolute left-2 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground" />
+ <input
+ type="text"
+ value={query}
+ autoFocus
+ onChange={(e) => handleQueryChange(e.target.value)}
+ onKeyDown={(e) => {
+ if (e.key === "Enter" && isUrl) {
+ e.preventDefault();
+ void submitUrl();
+ }
+ }}
+ spellCheck={false}
+ aria-label={t(($) => $.resources.repos_input_placeholder)}
+ placeholder={t(($) => $.resources.repos_input_placeholder)}
+ className="h-8 w-full rounded-md border bg-transparent pl-7 pr-2 text-caption outline-none placeholder:text-muted-foreground focus-visible:ring-1 focus-visible:ring-ring"
+ />
+ </div>
+ {isUrl ? (
+ <div className="space-y-2">
+ {/* The default branch is the right answer often enough that this
+ must not read as a second required step — it is prefilled from
+ a /tree/ URL and otherwise left empty. */}
+ <GithubRefField
+ id="attach-repo-ref"
+ value={ref}
+ onChange={setRef}
+ onSubmit={() => void submitUrl()}
+ />
+ <Button
+ size="sm"
+ className="w-full"
+ disabled={refInvalid || submitting || busy}
+ onClick={() => void submitUrl()}
+ >
+ <Plus />
+ <span className="truncate">
+ {t(($) => $.resources.repos_add_url, {
+ repo: githubShortLabel(query.trim()),
+ })}
+ </span>
+ </Button>
+ </div>
+ ) : (
+ workspaceRepos.length > 0 && (
+ <div className="max-h-56 space-y-1 overflow-y-auto">
+ {filtered.length === 0 && search && (
+ <p className="py-2 text-center text-caption text-muted-foreground">
+ {t(($) => $.resources.repos_search_empty)}
+ </p>
+ )}
+ {filtered.map((repo) => {
+ const isAttached = attachedUrls.has(repo.url);
+ const isDisabled = isAttached || busy;
+ return (
+ // aria-disabled instead of `disabled` so hover still reaches
+ // the tooltip trigger on attached rows (browsers suppress
+ // pointer events on disabled form controls).
+ <button
+ key={repo.url}
+ type="button"
+ aria-disabled={isDisabled}
+ onClick={() => {
+ if (isDisabled) return;
+ void onAttach(repo.url);
+ }}
+ className="flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-caption text-left hover:bg-accent transition-colors aria-disabled:opacity-50 aria-disabled:cursor-not-allowed aria-disabled:hover:bg-transparent"
+ >
+ <FolderGit className="size-3.5 shrink-0" />
+ <span className="min-w-0 flex-1">
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <span className="block truncate">
+ {githubShortLabel(repo.url)}
+ </span>
+ }
+ />
+ <TooltipContent side="top">{repo.url}</TooltipContent>
+ </Tooltip>
+ {repo.description?.trim() && (
+ <span className="block truncate text-micro text-muted-foreground">
+ {repo.description.trim()}
+ </span>
+ )}
+ </span>
+ {isAttached && (
+ <span className="text-micro text-muted-foreground">
+ {t(($) => $.resources.attached_badge)}
+ </span>
+ )}
+ </button>
+ );
+ })}
+ </div>
+ )
+ )}
+ </div>
+ );
+}
+
+function GithubRepoRow({
+ resource,
+ description,
+}: {
+ resource: GithubResource;
+ description?: string | null;
+}) {
+ const { remove, removing } = useRemoveResource(resource);
+ const ref = resource.resource_ref;
+ const display = resource.label || githubShortLabel(ref.url);
+ // Workspace repository descriptions are source-of-truth metadata. They stay
+ // live here rather than being copied into the resource label, while an
+ // explicit resource label remains the user's preferred primary text.
+ const liveDescription = resource.label ? undefined : description?.trim();
+
+ return (
+ <div className="group text-caption">
+ <div className="flex items-center gap-2">
+ <FolderGit className="size-3.5 shrink-0 text-muted-foreground" />
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <a
+ href={ref.url}
+ target="_blank"
+ rel="noopener noreferrer"
+ className="min-w-0 flex-1 truncate hover:underline"
+ >
+ {display}
+ </a>
+ }
+ />
+ <TooltipContent side="top">{ref.url}</TooltipContent>
+ </Tooltip>
+ <RemoveButton onRemove={remove} removing={removing} />
+ </div>
+ {/* The branch gets its own line rather than a badge beside the name: a
+ custom label takes the name slot, and this panel is narrow enough
+ that an inline badge truncates the repository away. */}
+ <div className="flex min-w-0 items-center gap-1.5 pl-[1.375rem] pt-0.5">
+ <GithubRefChip resource={resource} />
+ {liveDescription && (
+ <span className="min-w-0 truncate text-micro text-muted-foreground">
+ {liveDescription}
+ </span>
+ )}
+ </div>
+ </div>
+ );
+}
+
+/**
+ * The branch a repository's tasks start from, editable in place.
+ *
+ * Always rendered, showing "Default branch" when nothing is pinned: without
+ * it, clearing a branch makes the line vanish, which reads the same as the
+ * setting never having existed.
+ */
+function GithubRefChip({ resource }: { resource: GithubResource }) {
+ const { t } = useT("projects");
+ const updateResource = useUpdateProjectResource(
+ resource.workspace_id,
+ resource.project_id,
+ );
+ const ref = resource.resource_ref;
+ const current = ref.ref ?? "";
+ const [open, setOpen] = useState(false);
+ const [draft, setDraft] = useState(current);
+ const [saving, setSaving] = useState(false);
+ const [error, setError] = useState<string | null>(null);
+ const invalid = githubRefHasError(draft);
+
+ const handleOpenChange = (next: boolean) => {
+ if (saving) return;
+ setOpen(next);
+ if (next) {
+ setDraft(current);
+ setError(null);
+ }
+ };
+
+ const save = async () => {
+ if (saving || invalid) return;
+ const next = draft.trim();
+ if (next === current) {
+ setOpen(false);
+ return;
+ }
+ setSaving(true);
+ setError(null);
+ try {
+ await updateResource.mutateAsync({
+ resourceId: resource.id,
+ data: {
+ // Spread first so the url and any other ref field survive the edit —
+ // the server replaces the whole ref, it does not deep-merge. Clearing
+ // drops the key, which is how the default branch is restored.
+ resource_ref: next ? { ...ref, ref: next } : { ...ref, ref: undefined },
+ },
+ });
+ toast.success(
+ next
+ ? t(($) => $.resources.toast_ref_updated)
+ : t(($) => $.resources.toast_ref_cleared),
+ );
+ setOpen(false);
+ } catch (err) {
+ // Stay open so the rejected value is still there to fix.
+ setError(errorMessage(err, t(($) => $.resources.toast_ref_update_failed)));
+ } finally {
+ setSaving(false);
+ }
+ };
+
+ return (
+ <Popover open={open} onOpenChange={handleOpenChange}>
+ <TooltipHint label={t(($) => $.resources.ref_edit_tooltip)}>
+ <PopoverTrigger
+ render={
+ <button
+ type="button"
+ className={cn(chipClassName, current && "text-foreground")}
+ >
+ <GitBranch className="size-3 shrink-0" />
+ <span className={cn("max-w-32 truncate", current && "font-mono")}>
+ {current || t(($) => $.resources.ref_default_label)}
+ </span>
+ </button>
+ }
+ />
+ </TooltipHint>
+ <PopoverContent align="start" className="w-72 gap-3 p-3">
+ <GithubRefField
+ value={draft}
+ onChange={setDraft}
+ onSubmit={() => void save()}
+ autoFocus
+ />
+ {/* The ref is read when a task is claimed, so this is the one thing
+ the change does NOT do — and the first thing people worry about. */}
+ <p className="text-micro text-muted-foreground">
+ {t(($) => $.resources.ref_running_note)}
+ </p>
+ {error && <InlineError message={error} />}
+ <div className="flex justify-end gap-1.5">
+ <Button
+ variant="ghost"
+ size="sm"
+ onClick={() => setOpen(false)}
+ disabled={saving}
+ >
+ {t(($) => $.resources.ref_cancel)}
+ </Button>
+ <Button size="sm" onClick={() => void save()} disabled={saving || invalid}>
+ {t(($) => $.resources.ref_save)}
+ </Button>
+ </div>
+ </PopoverContent>
+ </Popover>
+ );
+}
+
+// ---------------------------------------------------------------------------
+// Local folders
+
+function LocalFolderGroup({
+ wsId,
+ projectId,
+ folders,
+ desktopMode,
+}: {
+ wsId: string;
+ projectId: string;
+ folders: LocalDirectoryResource[];
+ desktopMode: boolean;
+}) {
+ const { t } = useT("projects");
+ const daemonStatus = useLocalDaemonStatus();
+ const localDaemonId = daemonStatus.daemonId;
+ const { data: runtimes = [] } = useQuery(runtimeListOptions(wsId));
+ // Whether this server checks execution_mode on save at all. One declared
+ // boolean, no inference — servers that predate it drop execution_mode and
+ // answer 201.
+ const serverValidatesWorktree = useConfigStore(
+ (state) => state.localWorktreeSupported,
+ );
+
+ // Machine names and liveness come from the runtimes each daemon registers,
+ // titled the same way as the runtimes page.
+ const machines = useMemo(
+ () =>
+ buildRuntimeMachines(runtimes, {
+ now: Date.now(),
+ localDaemonId,
+ localMachineName: daemonStatus.deviceName,
+ }),
+ [runtimes, localDaemonId, daemonStatus.deviceName],
+ );
+
+ const foldersByDaemon = new Map<string, LocalDirectoryResource[]>();
+ for (const folder of folders) {
+ const id = folder.resource_ref.daemon_id;
+ foldersByDaemon.set(id, [...(foldersByDaemon.get(id) ?? []), folder]);
+ }
+ const currentFolders = localDaemonId
+ ? (foldersByDaemon.get(localDaemonId) ?? [])
+ : [];
+ const otherDaemonIds = [...foldersByDaemon.keys()].filter(
+ (id) => id !== localDaemonId,
+ );
+ const currentMachine = localDaemonId
+ ? machines.find((m) => m.daemonId === localDaemonId)
+ : undefined;
+ const currentTitle = currentMachine?.title ?? daemonStatus.deviceName;
+
+ return (
+ <div className="space-y-1.5">
+ <GroupHeader label={t(($) => $.resources.local_group)} />
+ <p className="-mt-1 text-micro text-muted-foreground">
+ {t(($) => $.resources.local_group_hint)}
+ </p>
+ {desktopMode && (
+ <MachineBlock
+ current
+ title={currentTitle ?? t(($) => $.resources.local_this_computer)}
+ showCurrentTag={!!currentTitle}
+ >
+ {currentFolders.length > 0 ? (
+ currentFolders.map((folder) => (
+ <LocalFolderRow
+ key={folder.id}
+ resource={folder}
+ current
+ serverValidatesWorktree={serverValidatesWorktree}
+ />
+ ))
+ ) : (
+ <LocalFolderSlot
+ wsId={wsId}
+ projectId={projectId}
+ daemonStatus={daemonStatus}
+ runtimes={runtimes}
+ serverValidatesWorktree={serverValidatesWorktree}
+ />
+ )}
+ </MachineBlock>
+ )}
+ {otherDaemonIds.map((daemonId) => {
+ const machine = machines.find((m) => m.daemonId === daemonId);
+ return (
+ <MachineBlock
+ key={daemonId}
+ title={machine?.title ?? t(($) => $.resources.local_unknown_computer)}
+ offline={machine !== undefined && machine.health !== "online"}
+ >
+ {(foldersByDaemon.get(daemonId) ?? []).map((folder) => (
+ <LocalFolderRow
+ key={folder.id}
+ resource={folder}
+ current={false}
+ serverValidatesWorktree={serverValidatesWorktree}
+ />
+ ))}
+ </MachineBlock>
+ );
+ })}
+ </div>
+ );
+}
+
+function MachineBlock({
+ title,
+ current = false,
+ showCurrentTag = false,
+ offline = false,
+ children,
+}: {
+ title: string;
+ current?: boolean;
+ showCurrentTag?: boolean;
+ offline?: boolean;
+ children: React.ReactNode;
+}) {
+ const { t } = useT("projects");
+ const Icon = current ? Laptop : Monitor;
+ return (
+ <div className="space-y-1">
+ <div className="flex min-w-0 items-center gap-1.5 text-micro text-muted-foreground">
+ <Icon className="size-3 shrink-0" />
+ <span className={cn("truncate", current && "text-foreground")}>{title}</span>
+ {showCurrentTag && (
+ <span className="shrink-0">{t(($) => $.resources.local_this_computer)}</span>
+ )}
+ {offline && (
+ <span className="shrink-0">· {t(($) => $.resources.local_offline)}</span>
+ )}
+ </div>
+ <div className="space-y-1.5 pl-[1.125rem]">{children}</div>
+ </div>
+ );
+}
+
+function LocalFolderRow({
+ resource,
+ current,
+ serverValidatesWorktree,
+}: {
+ resource: LocalDirectoryResource;
+ current: boolean;
+ serverValidatesWorktree: boolean;
+}) {
+ const { remove, removing } = useRemoveResource(resource);
+ // The name is the folder's own (or whatever a label update stored); there is
+ // deliberately no rename. A folder is identified by its path (MUL-7525).
+ const display = localDirectoryLabel(resource);
+
+ return (
+ // Folders on other machines are de-emphasised but stay editable: dropping
+ // or reconfiguring a stale registration only rewrites the resource, which
+ // works from any device.
+ <div className={cn("group text-caption", !current && "opacity-60")}>
+ <div className="flex items-center gap-2">
+ <FolderOpen className="size-3.5 shrink-0 text-muted-foreground" />
+ <Tooltip>
+ <TooltipTrigger
+ render={<span className="min-w-0 flex-1 truncate">{display}</span>}
+ />
+ <TooltipContent side="top">
+ <span className="font-mono text-micro">{resource.resource_ref.local_path}</span>
+ </TooltipContent>
+ </Tooltip>
+ <RemoveButton onRemove={remove} removing={removing} />
+ </div>
+ <div className="pl-[1.375rem] pt-0.5">
+ <ExecutionModeChip
+ resource={resource}
+ serverValidatesWorktree={serverValidatesWorktree}
+ />
+ </div>
+ </div>
+ );
+}
+
+/**
+ * How runs use a folder, always visible — "direct" included — because it is
+ * the first thing someone asks when a task queues (or does not). Picking an
+ * option saves it; a server rejection stays inline so the choice can be fixed.
+ */
+function ExecutionModeChip({
+ resource,
+ serverValidatesWorktree,
+}: {
+ resource: LocalDirectoryResource;
+ serverValidatesWorktree: boolean;
+}) {
+ const { t } = useT("projects");
+ const updateResource = useUpdateProjectResource(
+ resource.workspace_id,
+ resource.project_id,
+ );
+ const ref = resource.resource_ref;
+ const mode = executionModeOf(ref);
+ const [open, setOpen] = useState(false);
+ const [saving, setSaving] = useState(false);
+ const [error, setError] = useState<string | null>(null);
+
+ const handleOpenChange = (next: boolean) => {
+ if (saving) return;
+ setOpen(next);
+ if (next) setError(null);
+ };
+
+ const choose = async (next: LocalDirectoryExecutionMode) => {
+ if (saving) return;
+ if (next === mode) {
+ setOpen(false);
+ return;
+ }
+ setSaving(true);
+ setError(null);
+ try {
+ await updateResource.mutateAsync({
+ resourceId: resource.id,
+ // Spread first so every other ref field survives the edit — the server
+ // replaces the whole ref, it does not deep-merge.
+ data: { resource_ref: { ...ref, execution_mode: next } },
+ });
+ toast.success(t(($) => $.resources.toast_local_mode_updated));
+ setOpen(false);
} catch (err) {
- const msg = err instanceof Error ? err.message : t(($) => $.resources.toast_attach_failed);
- toast.error(msg);
+ // The most likely failure is the server's daemon-version gate; closing
+ // would leave a toast and no way to act on it.
+ setError(errorMessage(err, t(($) => $.resources.toast_local_mode_update_failed)));
+ } finally {
+ setSaving(false);
}
};
- const handleAttachLocalDirectory = async () => {
- if (picking) return;
+ return (
+ <Popover open={open} onOpenChange={handleOpenChange}>
+ <TooltipHint label={t(($) => $.resources.mode_edit_tooltip)}>
+ <PopoverTrigger
+ render={
+ <button type="button" className={cn(chipClassName, "text-foreground")}>
+ {mode === "worktree" ? (
+ <GitBranch className="size-3 shrink-0" />
+ ) : (
+ <Pencil className="size-3 shrink-0" />
+ )}
+ {mode === "worktree"
+ ? t(($) => $.resources.mode_badge_worktree)
+ : t(($) => $.resources.mode_badge_in_place)}
+ </button>
+ }
+ />
+ </TooltipHint>
+ <PopoverContent align="start" className="w-80 gap-2 p-2">
+ {/* The path is already saved, so there is nothing to re-validate from
+ the browser; unknown git status keeps the option available and the
+ daemon has the final say. */}
+ <LocalDirectoryModeOptions
+ value={mode}
+ onChange={(next) => void choose(next)}
+ unavailableReason={worktreeUnavailableReason(undefined, serverValidatesWorktree)}
+ />
+ {error && <InlineError message={error} />}
+ </PopoverContent>
+ </Popover>
+ );
+}
+
+type PendingFolder = {
+ path: string;
+ label: string;
+ mode: LocalDirectoryExecutionMode;
+ /** undefined = unknown (older desktop build); treated as "cannot verify". */
+ isGitRepo: boolean | undefined;
+};
+
+/**
+ * This machine's place in the group while it has no folder. Choosing one asks
+ * for the execution mode before anything is created: it is part of what the
+ * user is choosing — whether tasks edit this folder or hand back a branch —
+ * not a setting to discover afterwards.
+ */
+function LocalFolderSlot({
+ wsId,
+ projectId,
+ daemonStatus,
+ runtimes,
+ serverValidatesWorktree,
+}: {
+ wsId: string;
+ projectId: string;
+ daemonStatus: LocalDaemonStatus;
+ runtimes: AgentRuntime[];
+ serverValidatesWorktree: boolean;
+}) {
+ const { t } = useT("projects");
+ const createResource = useCreateProjectResource(wsId, projectId);
+ const [picking, setPicking] = useState(false);
+ const [pending, setPending] = useState<PendingFolder | null>(null);
+ const [saving, setSaving] = useState(false);
+ const [error, setError] = useState<string | null>(null);
+ const daemonId = daemonStatus.daemonId;
+ const ready = daemonStatus.running && daemonId !== null;
+
+ const pick = async () => {
+ if (picking || !ready) return;
setPicking(true);
try {
- if (!localDaemonId || !daemonStatus.running) {
- toast.error(t(($) => $.resources.toast_local_daemon_not_running));
- return;
- }
- // Race guard: the button gates on this already, but if the picker
- // is opened while a concurrent resource-create lands the user
- // would otherwise see a 409. Surface a clearer message instead.
- if (attachedLocalPaths.size > 0) {
- toast.error(t(($) => $.resources.toast_local_daemon_already_attached));
- return;
- }
const picked = await pickDirectory();
if (!picked.ok) {
if (picked.reason && picked.reason !== "cancelled") {
- toast.error(
- picked.error ?? t(($) => $.resources.toast_local_pick_failed),
- );
+ toast.error(picked.error ?? t(($) => $.resources.toast_local_pick_failed));
}
return;
}
const path = picked.path ?? "";
- const fallbackLabel = picked.basename ?? path;
- if (attachedLocalPaths.has(path)) {
- toast.error(t(($) => $.resources.toast_local_already_attached));
- return;
- }
const validation = await validateLocalDirectory(path);
if (!validation.ok) {
toast.error(
@@ -243,350 +990,120 @@ export function ProjectResourcesSection({ projectId }: { projectId: string }) {
);
return;
}
- // Ask for the execution mode before creating. It is part of what the
- // user is choosing — whether tasks edit this folder or hand back a
- // branch — not a setting to discover afterwards.
- setModeError(null);
- setModeDialog({
+ setError(null);
+ setPending({
path,
- daemonId: localDaemonId,
+ label: picked.basename ?? path,
// Same preselection rule as the create-project flow: a git repo this
- // daemon can actually run worktree mode on starts on parallel, anything
- // else starts on direct. Only the PRESELECTION differs by folder — the
- // user still confirms, and existing resources keep whatever they have.
+ // daemon can actually run worktree mode on starts on parallel,
+ // anything else starts on direct. The user still confirms.
mode:
validation.is_git_repo === true &&
serverValidatesWorktree &&
- advertisesWorktree(localDaemonId)
+ runtimeAdvertisesLocalWorktree(runtimes, daemonId)
? "worktree"
: "in_place",
isGitRepo: validation.is_git_repo,
- label: fallbackLabel,
});
- setAddOpen(false);
} catch (err) {
- const msg =
- err instanceof Error
- ? err.message
- : t(($) => $.resources.toast_local_pick_failed);
- toast.error(msg);
+ toast.error(errorMessage(err, t(($) => $.resources.toast_local_pick_failed)));
} finally {
setPicking(false);
}
};
- const handleConfirmMode = async (mode: LocalDirectoryExecutionMode) => {
- if (!modeDialog || modeSaving) return;
- setModeSaving(true);
- setModeError(null);
- try {
- if (modeDialog.resource) {
- const ref = modeDialog.resource.resource_ref;
- if (executionModeOf(ref) === mode) {
- setModeDialog(null);
- return;
- }
- await updateResource.mutateAsync({
- resourceId: modeDialog.resource.id,
- data: {
- // Spread first so every other ref field survives the edit — the
- // server replaces the whole ref, it does not deep-merge.
- resource_ref: { ...ref, execution_mode: mode },
- },
- });
- toast.success(t(($) => $.resources.toast_local_mode_updated));
- } else {
- if (!localDaemonId) return;
- await createResource.mutateAsync({
- resource_type: "local_directory",
- resource_ref: {
- local_path: modeDialog.path,
- daemon_id: localDaemonId,
- label: modeDialog.label ?? modeDialog.path,
- execution_mode: mode,
- },
- });
- toast.success(t(($) => $.resources.toast_local_attached));
- }
- setModeDialog(null);
- } catch (err) {
- // Keep the dialog open and show the reason inline: the most likely
- // failure is the server's daemon-version gate, and closing the dialog
- // would leave the user with a toast and no way to act on it.
- setModeError(
- err instanceof Error && err.message
- ? err.message
- : t(($) => $.resources.toast_local_mode_update_failed),
- );
- } finally {
- setModeSaving(false);
- }
- };
-
- const handleSaveRef = async (nextRef: string) => {
- if (!refDialog || refSaving) return;
- const ref = refDialog.resource.resource_ref;
- if ((ref.ref ?? "") === nextRef) {
- setRefDialog(null);
- return;
- }
- setRefSaving(true);
- setRefError(null);
+ const add = async () => {
+ if (!pending || !daemonId || saving) return;
+ setSaving(true);
+ setError(null);
try {
- await updateResource.mutateAsync({
- resourceId: refDialog.resource.id,
- data: {
- // Spread first so the url and any other ref field survive the edit —
- // the server replaces the whole ref, it does not deep-merge. Clearing
- // drops the key, which is how the default branch is restored.
- resource_ref: nextRef
- ? { ...ref, ref: nextRef }
- : { ...ref, ref: undefined },
+ await createResource.mutateAsync({
+ resource_type: "local_directory",
+ resource_ref: {
+ local_path: pending.path,
+ daemon_id: daemonId,
+ label: pending.label,
+ execution_mode: pending.mode,
},
});
- toast.success(
- nextRef
- ? t(($) => $.resources.toast_ref_updated)
- : t(($) => $.resources.toast_ref_cleared),
- );
- setRefDialog(null);
+ toast.success(t(($) => $.resources.toast_local_attached));
+ setPending(null);
} catch (err) {
- // Keep the dialog open so the rejected value is still there to fix.
- setRefError(
- err instanceof Error && err.message
- ? err.message
- : t(($) => $.resources.toast_ref_update_failed),
- );
+ // Keep the choice on screen: the likely failures (the one-per-machine
+ // conflict, the daemon-version gate) are things the user acts on here.
+ setError(errorMessage(err, t(($) => $.resources.toast_attach_failed)));
} finally {
- setRefSaving(false);
+ setSaving(false);
}
};
- return (
- <div>
- <button
- type="button"
- className={`flex w-full items-center gap-1 rounded-md px-2 py-1 text-caption font-medium transition-colors mb-2 hover:bg-accent/70 ${open ? "" : "text-muted-foreground hover:text-foreground"}`}
- onClick={() => setOpen(!open)}
- >
- {t(($) => $.resources.section_header)}
- <ChevronRight
- className={`!size-3 shrink-0 stroke-[2.5] text-muted-foreground transition-transform ${open ? "rotate-90" : ""}`}
- />
- </button>
- {open && (
- <div className="pl-2 space-y-1.5">
- {resources.length === 0 && (
- <p className="text-caption text-muted-foreground">
- {t(($) => $.resources.empty)}
- </p>
- )}
- {resources.length > 0 && (
- <div className="max-h-64 space-y-1.5 overflow-y-auto pr-1">
- {resources.map((resource) => (
- <ResourceRow
- key={resource.id}
- resource={resource}
- githubRepoDescription={
- isGithubRef(resource)
- ? workspace?.repos?.find((repo) => repo.url === resource.resource_ref.url)
- ?.description
- : undefined
- }
- localDaemonId={localDaemonId}
- onEditGithubRef={(target) => {
- setRefError(null);
- setRefDialog({ resource: target });
- }}
- onEditLocalDirectoryMode={(target) => {
- setModeError(null);
- setModeDialog({
- path: target.resource_ref.local_path,
- daemonId: target.resource_ref.daemon_id,
- mode: executionModeOf(target.resource_ref),
- // The path is already saved, so there is nothing to
- // re-validate from the browser; the desktop check only
- // runs at pick time. Unknown means the option stays
- // available and the daemon has the final say.
- isGitRepo: undefined,
- resource: target,
- });
- }}
- />
- ))}
- </div>
- )}
- <Popover
- open={addOpen}
- onOpenChange={(v) => {
- setAddOpen(v);
- if (!v) setRepoSearch("");
- }}
- >
- <PopoverTrigger
- render={
- <Button
- variant="ghost"
- size="sm"
- className="h-7 px-2 text-caption text-muted-foreground hover:text-foreground"
- >
- <Plus className="size-3" />
- {t(($) => $.resources.add_button)}
- </Button>
- }
- />
- <PopoverContent align="start" className="w-72 p-2 space-y-2">
- <div className="text-caption font-medium text-muted-foreground">
- {t(($) => $.resources.popover_title)}
- </div>
- {workspace?.repos && workspace.repos.length > 0 && (
- <>
- <div className="relative">
- <Search className="pointer-events-none absolute left-2 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground" />
- <input
- type="text"
- value={repoSearch}
- onChange={(e) => setRepoSearch(e.target.value)}
- aria-label={t(($) => $.resources.repos_search_placeholder)}
- placeholder={t(($) => $.resources.repos_search_placeholder)}
- className="h-8 w-full rounded-md border bg-transparent pl-7 pr-2 text-caption outline-none placeholder:text-muted-foreground focus-visible:ring-1 focus-visible:ring-ring"
- />
- </div>
- <div className="max-h-48 space-y-1 overflow-y-auto">
- {filteredRepos.length === 0 && repoQuery && (
- <p className="py-2 text-center text-caption text-muted-foreground">
- {t(($) => $.resources.repos_search_empty)}
- </p>
- )}
- {filteredRepos.map((repo) => {
- const isAttached = attachedUrls.has(repo.url);
- const isDisabled = isAttached || createResource.isPending;
- return (
- // Use aria-disabled instead of the native `disabled` attribute so
- // hover events still reach the tooltip trigger on attached rows
- // (browsers suppress pointer events on disabled form controls).
- <button
- key={repo.url}
- type="button"
- aria-disabled={isDisabled}
- onClick={async () => {
- if (isDisabled) return;
- await handleAttach(repo.url);
- setAddOpen(false);
- }}
- className="flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-caption text-left hover:bg-accent transition-colors aria-disabled:opacity-50 aria-disabled:cursor-not-allowed aria-disabled:hover:bg-transparent"
- >
- <FolderGit className="size-3.5" />
- <span className="min-w-0 flex-1">
- <Tooltip>
- <TooltipTrigger
- render={
- <span className="block truncate">
- {githubShortLabel(repo.url)}
- </span>
- }
- />
- <TooltipContent side="top">{repo.url}</TooltipContent>
- </Tooltip>
- {repo.description?.trim() && (
- <span className="block truncate text-micro text-muted-foreground">
- {repo.description.trim()}
- </span>
- )}
- </span>
- {isAttached && (
- <span className="text-micro text-muted-foreground">
- {t(($) => $.resources.attached_badge)}
- </span>
- )}
- </button>
- );
- })}
- </div>
- </>
- )}
- <CustomRepoForm
- onSubmit={async (url, ref) => {
- await handleAttach(url, ref);
- setAddOpen(false);
- }}
- />
- </PopoverContent>
- </Popover>
- {desktopMode && (
- <div className="flex flex-col">
- <Button
- variant="ghost"
- size="sm"
- className="h-7 justify-start px-2 text-caption text-muted-foreground hover:text-foreground"
- disabled={
- picking ||
- createResource.isPending ||
- !daemonStatus.running ||
- hasLocalDirectoryForCurrentDaemon
- }
- onClick={() => {
- void handleAttachLocalDirectory();
- }}
- >
- <FolderOpen className="size-3" />
- {t(($) => $.resources.add_local_directory_button)}
- </Button>
- {!daemonStatus.running && (
- <p className="px-2 pt-0.5 text-micro text-muted-foreground">
- {t(($) => $.resources.local_daemon_offline_hint)}
- </p>
- )}
- {daemonStatus.running && hasLocalDirectoryForCurrentDaemon && (
- <p className="px-2 pt-0.5 text-micro text-muted-foreground">
- {t(($) => $.resources.local_daemon_already_attached_hint)}
- </p>
- )}
+ if (pending) {
+ return (
+ <div className="space-y-2 rounded-md border p-2">
+ <div className="flex items-start gap-2 text-caption">
+ <FolderOpen className="mt-0.5 size-3.5 shrink-0 text-muted-foreground" />
+ <div className="min-w-0 flex-1">
+ <div className="truncate font-medium">{pending.label}</div>
+ <div className="break-all font-mono text-micro text-muted-foreground">
+ {pending.path}
</div>
- )}
+ </div>
</div>
- )}
- {refDialog && (
- <GithubRefDialog
- open
- onOpenChange={(next) => {
- if (!next) {
- setRefDialog(null);
- setRefError(null);
- }
- }}
- url={refDialog.resource.resource_ref.url}
- value={refDialog.resource.resource_ref.ref ?? ""}
- errorMessage={refError ?? undefined}
- saving={refSaving}
- onConfirm={(next) => void handleSaveRef(next)}
- />
- )}
- {modeDialog && (
- <LocalDirectoryModeDialog
- open
- onOpenChange={(next) => {
- if (!next) {
- setModeDialog(null);
- setModeError(null);
- }
- }}
- path={modeDialog.path}
- value={modeDialog.mode}
+ <LocalDirectoryModeOptions
+ value={pending.mode}
+ onChange={(mode) => setPending({ ...pending, mode })}
unavailableReason={worktreeUnavailableReason(
- modeDialog.isGitRepo,
+ pending.isGitRepo,
serverValidatesWorktree,
)}
- errorMessage={modeError ?? undefined}
- saving={modeSaving}
- confirmLabel={
- modeDialog.resource
- ? t(($) => $.resources.mode_save)
- : t(($) => $.resources.mode_add)
- }
- onConfirm={(mode) => void handleConfirmMode(mode)}
/>
- )}
+ {error && <InlineError message={error} />}
+ <div className="flex justify-end gap-1.5">
+ <Button
+ variant="ghost"
+ size="sm"
+ onClick={() => setPending(null)}
+ disabled={saving}
+ >
+ {t(($) => $.resources.mode_cancel)}
+ </Button>
+ <Button size="sm" onClick={() => void add()} disabled={saving}>
+ {t(($) => $.resources.mode_add)}
+ </Button>
+ </div>
+ </div>
+ );
+ }
+
+ return (
+ <div className="space-y-2 rounded-md border border-dashed px-2.5 py-2">
+ <p className="text-micro text-muted-foreground">
+ {ready
+ ? t(($) => $.resources.local_slot_description)
+ : t(($) => $.resources.local_daemon_offline_hint)}
+ </p>
+ <Button
+ variant="outline"
+ size="sm"
+ className="h-7 text-caption"
+ disabled={!ready || picking}
+ onClick={() => void pick()}
+ >
+ <FolderOpen className="size-3" />
+ {t(($) => $.resources.local_pick)}
+ </Button>
+ </div>
+ );
+}
+
+function UnknownResourceRow({ resource }: { resource: ProjectResource }) {
+ const { remove, removing } = useRemoveResource(resource);
+ return (
+ <div className="flex items-center gap-2 text-caption text-muted-foreground">
+ <span className="truncate flex-1">
+ {resource.label || resource.resource_type}
+ </span>
+ <RemoveButton onRemove={remove} removing={removing} alwaysVisible />
</div>
);
}
@@ -614,354 +1131,6 @@ function worktreeUnavailableReason(
return undefined;
}
-interface ResourceRowProps {
- resource: ProjectResource;
- githubRepoDescription?: string;
- localDaemonId: string | null;
- onEditGithubRef: (
- resource: ProjectResource & { resource_ref: GithubRepoResourceRef },
- ) => void;
- onEditLocalDirectoryMode: (
- resource: ProjectResource & { resource_ref: LocalDirectoryResourceRef },
- ) => void;
-}
-
-function ResourceRow({
- resource,
- githubRepoDescription,
- localDaemonId,
- onEditGithubRef,
- onEditLocalDirectoryMode,
-}: ResourceRowProps) {
- const { t } = useT("projects");
- const deleteResource = useDeleteProjectResource(
- resource.workspace_id,
- resource.project_id,
- );
- const onRemove = async () => {
- if (deleteResource.isPending) return;
- try {
- await deleteResource.mutateAsync(resource.id);
- toast.success(t(($) => $.resources.toast_removed));
- } catch (err) {
- toast.error(
- err instanceof Error && err.message
- ? err.message
- : t(($) => $.resources.toast_remove_failed),
- );
- }
- };
-
- if (isGithubRef(resource)) {
- const ref = resource.resource_ref;
- const display = resource.label || githubShortLabel(ref.url);
- // Workspace repository descriptions are source-of-truth metadata. They stay
- // live here rather than being copied into the resource label, while an
- // explicit resource label remains the user's preferred primary text.
- const description = resource.label ? undefined : githubRepoDescription?.trim();
- const tooltip = ref.ref ? `${ref.url}\nref: ${ref.ref}` : ref.url;
- return (
- <div className="text-caption group">
- <div className="flex items-center gap-2">
- <FolderGit className="size-3.5 text-muted-foreground shrink-0" />
- <div className="min-w-0 flex-1">
- <Tooltip>
- <TooltipTrigger
- render={
- <a
- href={ref.url}
- target="_blank"
- rel="noopener noreferrer"
- className="block truncate hover:underline"
- >
- {display}
- </a>
- }
- />
- <TooltipContent side="top" className="whitespace-pre-line">{tooltip}</TooltipContent>
- </Tooltip>
- {description && (
- <span className="block truncate text-micro text-muted-foreground">
- {description}
- </span>
- )}
- </div>
- <TooltipHint label={t(($) => $.resources.ref_edit_tooltip)}>
- <button
- type="button"
- onClick={() => onEditGithubRef(resource)}
- className="opacity-0 group-hover:opacity-100 transition-opacity rounded-sm p-0.5 hover:bg-accent"
- aria-label={t(($) => $.resources.ref_edit_tooltip)}
- >
- <GitBranch className="size-3 text-muted-foreground" />
- </button>
- </TooltipHint>
- <TooltipHint label={t(($) => $.resources.remove_tooltip)}>
- <button
- type="button"
- onClick={onRemove}
- disabled={deleteResource.isPending}
- aria-busy={deleteResource.isPending}
- className="opacity-0 group-hover:opacity-100 disabled:opacity-100 transition-opacity rounded-sm p-0.5 hover:bg-accent"
- aria-label={t(($) => $.resources.remove_tooltip)}
- >
- {deleteResource.isPending ? (
- <Spinner className="size-3" aria-hidden="true" />
- ) : (
- <Trash2 className="size-3 text-muted-foreground" />
- )}
- </button>
- </TooltipHint>
- </div>
- {/* Its own line rather than appended to the link text: a custom label
- takes that slot, and this panel is narrow enough that an inline
- badge truncates the repository name away — which is exactly when
- someone needs to read both.
-
- Rendered even when nothing is pinned, showing "Default branch".
- Without it, clearing a branch makes the line vanish, which reads
- the same as the setting never having existed — there is no way to
- confirm from the panel that the repo is deliberately on its
- default, or that this row has a branch setting at all. */}
- <Tooltip>
- <TooltipTrigger
- render={
- <div className="flex items-center gap-1 pl-[1.375rem] text-micro text-muted-foreground">
- <GitBranch className="size-3 shrink-0" />
- <span className="truncate">
- {ref.ref || t(($) => $.resources.ref_default_label)}
- </span>
- </div>
- }
- />
- <TooltipContent side="top">
- {ref.ref
- ? t(($) => $.resources.ref_badge_tooltip, { ref: ref.ref })
- : t(($) => $.resources.ref_default_tooltip)}
- </TooltipContent>
- </Tooltip>
- </div>
- );
- }
-
- if (isLocalDirectoryRef(resource)) {
- return (
- <LocalDirectoryRow
- resource={resource}
- localDaemonId={localDaemonId}
- onRemove={onRemove}
- removing={deleteResource.isPending}
- onEditMode={onEditLocalDirectoryMode}
- />
- );
- }
-
- return (
- <div className="flex items-center gap-2 text-caption text-muted-foreground">
- <span className="truncate flex-1">
- {resource.label || resource.resource_type}
- </span>
- <TooltipHint label={t(($) => $.resources.remove_tooltip)}>
- <button
- type="button"
- onClick={onRemove}
- disabled={deleteResource.isPending}
- aria-busy={deleteResource.isPending}
- className="rounded-sm p-0.5 hover:bg-accent"
- aria-label={t(($) => $.resources.remove_tooltip)}
- >
- {deleteResource.isPending ? (
- <Spinner className="size-3" aria-hidden="true" />
- ) : (
- <Trash2 className="size-3" />
- )}
- </button>
- </TooltipHint>
- </div>
- );
-}
-
-interface LocalDirectoryRowProps {
- resource: ProjectResource & { resource_ref: LocalDirectoryResourceRef };
- localDaemonId: string | null;
- onRemove: () => void;
- removing: boolean;
- onEditMode: (
- resource: ProjectResource & { resource_ref: LocalDirectoryResourceRef },
- ) => void;
-}
-
-function LocalDirectoryRow({
- resource,
- localDaemonId,
- onRemove,
- removing,
- onEditMode,
-}: LocalDirectoryRowProps) {
- const { t } = useT("projects");
- const ref = resource.resource_ref;
- const mode = executionModeOf(ref);
- const display = localDirectoryLabel(resource);
- const isForeignDaemon =
- localDaemonId !== null && ref.daemon_id !== localDaemonId;
- const isLocalUnknown = localDaemonId === null;
- // "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;
-
- return (
- <div
- className={`flex items-center gap-2 text-caption group ${
- mismatch ? "opacity-60" : ""
- }`}
- >
- <FolderOpen className="size-3.5 text-muted-foreground shrink-0" />
- {/* 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>}
- />
- <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 no
- way to tell whether tasks on this folder edit it directly or hand back
- a branch, which is the first thing someone asks when a task queues (or
- does not). */}
- {mode === "worktree" && (
- <Tooltip>
- <TooltipTrigger
- render={
- <Badge variant="secondary" className="shrink-0 gap-1 font-normal">
- <GitBranch className="size-3" />
- {t(($) => $.resources.mode_badge_worktree)}
- </Badge>
- }
- />
- <TooltipContent side="top">
- {t(($) => $.resources.mode_badge_worktree_tooltip)}
- </TooltipContent>
- </Tooltip>
- )}
- {/* Not gated on `mismatch`: switching the mode only rewrites a field, so
- it works from the web app or another device, unlike the folder
- picker. */}
- <TooltipHint label={t(($) => $.resources.mode_edit_tooltip)}>
- <button
- type="button"
- onClick={() => onEditMode(resource)}
- className="opacity-0 group-hover:opacity-100 transition-opacity rounded-sm p-0.5 hover:bg-accent"
- aria-label={t(($) => $.resources.mode_edit_tooltip)}
- >
- <GitBranch className="size-3 text-muted-foreground" />
- </button>
- </TooltipHint>
- <TooltipHint label={t(($) => $.resources.remove_tooltip)}>
- <button
- type="button"
- onClick={onRemove}
- disabled={removing}
- aria-busy={removing}
- className="opacity-0 group-hover:opacity-100 disabled:opacity-100 transition-opacity rounded-sm p-0.5 hover:bg-accent"
- aria-label={t(($) => $.resources.remove_tooltip)}
- >
- {removing ? (
- <Spinner className="size-3" aria-hidden="true" />
- ) : (
- <Trash2 className="size-3 text-muted-foreground" />
- )}
- </button>
- </TooltipHint>
- </div>
- );
-}
-
-function CustomRepoForm({
- onSubmit,
-}: {
- onSubmit: (url: string, ref?: string) => Promise<void> | void;
-}) {
- const { t } = useT("projects");
- const [url, setUrl] = useState("");
- const [ref, setRef] = useState("");
- const [submitting, setSubmitting] = useState(false);
- const refInvalid = githubRefHasError(ref);
-
- // Someone who wants a branch copies it out of the address bar, so a pasted
- // .../tree/<branch> URL is split into its two halves here rather than stored
- // whole as a clone URL that does not exist. The result lands in the visible
- // fields, so a wrong guess is obvious before anything is saved.
- //
- // Normalising the URL is unconditional. Gating it on the branch field being
- // empty meant a second pasted browse URL was stored whole. Whether to
- // overwrite the BRANCH is the separate question, and the pasted pair wins:
- // the branch field only appears once a URL is present, so a value sitting in
- // it came from the previous URL rather than from something typed ahead.
- const handleUrlChange = (next: string) => {
- const split = splitGithubUrlRef(next);
- setUrl(split.url);
- if (split.ref) setRef(split.ref);
- };
-
- const handle = async (e: React.FormEvent) => {
- e.preventDefault();
- const trimmedUrl = url.trim();
- const trimmedRef = ref.trim();
- if (!trimmedUrl || refInvalid) return;
- setSubmitting(true);
- try {
- await onSubmit(trimmedUrl, trimmedRef || undefined);
- setUrl("");
- setRef("");
- } finally {
- setSubmitting(false);
- }
- };
- return (
- <form onSubmit={handle} className="space-y-1.5 pt-1 border-t">
- <div className="flex items-center gap-1.5">
- <input
- type="text"
- value={url}
- onChange={(e) => handleUrlChange(e.target.value)}
- aria-label={t(($) => $.resources.popover_title)}
- placeholder={t(($) => $.resources.url_placeholder)}
- className="flex-1 min-w-0 bg-transparent text-caption px-2 py-1 outline-none placeholder:text-muted-foreground"
- />
- <Button
- type="submit"
- size="sm"
- variant="ghost"
- className="h-6 px-2 text-caption"
- disabled={!url.trim() || refInvalid || submitting}
- >
- {t(($) => $.resources.url_submit)}
- </Button>
- </div>
- {/* Only after a URL is entered: an empty attach form should still read as
- one field, and the default branch is the right answer often enough
- that this must not look like a second required step. */}
- {url.trim() && (
- <GithubRefField id="attach-repo-ref" value={ref} onChange={setRef} />
- )}
- </form>
- );
-}
-
function localValidationMessage(
result: ValidateLocalDirectoryResult,
strings: {
diff --git a/packages/views/test/shard-timings.json b/packages/views/test/shard-timings.json
index 86f895dc8a..12ad273718 100644
--- a/packages/views/test/shard-timings.json
+++ b/packages/views/test/shard-timings.json
@@ -464,7 +464,7 @@
"plugins/surface-document.test.ts": 75,
"projects/components/local-directory-hint.test.tsx": 865,
"projects/components/local-directory-label.test.ts": 72,
- "projects/components/local-directory-mode-dialog.test.tsx": 959,
+ "projects/components/local-directory-mode-options.test.tsx": 959,
"projects/components/project-date-pickers.test.tsx": 2767,
"projects/components/project-detail.test.tsx": 1907,
"projects/components/project-picker.open-state.test.tsx": 2105,