- {isLoading ? (
-
-
-
- ) : (
- <>
- {/* Terminal Worktrees Section */}
- {worktrees.length > 0 && (
- <>
-
- {t('terminal:worktree.existing')}
-
- {worktrees.map((wt) => (
-
{
- e.stopPropagation();
- setIsOpen(false);
- onSelectWorktree(wt);
- }}
- className="text-xs group"
- >
-
-
- {wt.name}
- {wt.branchName && (
-
- {wt.branchName}
-
- )}
-
-
-
- ))}
- >
- )}
-
- {/* Task Worktrees Section */}
- {taskWorktrees.length > 0 && (
- <>
-
-
- {t('terminal:worktree.taskWorktrees')}
-
- {taskWorktrees.map((wt) => (
-
{
- e.stopPropagation();
- setIsOpen(false);
- selectTaskWorktree(wt);
- }}
- className="text-xs group"
- >
-
-
- {wt.specName}
- {wt.branch && (
-
- {wt.branch}
-
- )}
-
-
- ))}
- >
- )}
-
- {/* Other Worktrees Section */}
- {otherWorktrees.length > 0 && (
- <>
-
-
- {t('terminal:worktree.otherWorktrees')}
-
- {otherWorktrees.map((wt) => (
-
{
- e.stopPropagation();
- setIsOpen(false);
- selectOtherWorktree(wt);
- }}
- className="text-xs group"
- >
-
-
- {wt.displayName}
-
- {wt.branch !== null ? wt.branch : `${wt.commitSha} ${t('terminal:worktree.detached')}`}
-
-
-
- ))}
- >
- )}
- >
- )}
+ {/* Search input */}
+
+
+ setSearchQuery(e.target.value)}
+ onKeyDown={handleKeyDown}
+ placeholder={t('terminal:worktree.searchPlaceholder')}
+ className="flex-1 bg-transparent text-xs outline-none placeholder:text-muted-foreground"
+ />
-
-
+
+
+
+ {/* Scrollable results */}
+
+
+ {isLoading ? (
+
+
+
+ ) : !hasResults ? (
+
+ {t('terminal:worktree.noResults')}
+
+ ) : (
+ <>
+ {/* Terminal Worktrees */}
+ {terminalItems.length > 0 && (
+ <>
+
+ {t('terminal:worktree.existing')}
+
+ {terminalItems.map((item, i) => renderWorktreeItem(item, i))}
+ >
+ )}
+
+ {/* Task Worktrees */}
+ {taskItems.length > 0 && (
+ <>
+ {terminalItems.length > 0 &&
}
+
+ {t('terminal:worktree.taskWorktrees')}
+
+ {taskItems.map((item, i) => renderWorktreeItem(item, terminalItems.length + i))}
+ >
+ )}
+
+ {/* Other Worktrees */}
+ {otherItems.length > 0 && (
+ <>
+ {(terminalItems.length > 0 || taskItems.length > 0) && (
+
+ )}
+
+ {t('terminal:worktree.otherWorktrees')}
+
+ {otherItems.map((item, i) => renderWorktreeItem(item, terminalItems.length + taskItems.length + i))}
+ >
+ )}
+ >
+ )}
+
+
+
+
{/* Delete Confirmation Dialog */}
!open && setDeleteWorktree(null)}>
diff --git a/apps/frontend/src/shared/i18n/locales/en/terminal.json b/apps/frontend/src/shared/i18n/locales/en/terminal.json
index 93c9d86b..7d87ea7d 100644
--- a/apps/frontend/src/shared/i18n/locales/en/terminal.json
+++ b/apps/frontend/src/shared/i18n/locales/en/terminal.json
@@ -39,6 +39,8 @@
"openInIDE": "Open in IDE",
"maxReached": "Maximum of 12 terminal worktrees reached",
"alreadyExists": "A worktree with this name already exists",
+ "searchPlaceholder": "Search worktrees...",
+ "noResults": "No worktrees found",
"deleteTitle": "Delete Worktree?",
"deleteDescription": "This will permanently delete the worktree and its branch. Any uncommitted changes will be lost.",
"detached": "(detached)",
diff --git a/apps/frontend/src/shared/i18n/locales/fr/terminal.json b/apps/frontend/src/shared/i18n/locales/fr/terminal.json
index 742bdb6e..a13c0ab0 100644
--- a/apps/frontend/src/shared/i18n/locales/fr/terminal.json
+++ b/apps/frontend/src/shared/i18n/locales/fr/terminal.json
@@ -39,6 +39,8 @@
"openInIDE": "Ouvrir dans IDE",
"maxReached": "Maximum de 12 worktrees terminal atteint",
"alreadyExists": "Un worktree avec ce nom existe deja",
+ "searchPlaceholder": "Rechercher des worktrees...",
+ "noResults": "Aucun worktree trouvé",
"deleteTitle": "Supprimer le Worktree?",
"deleteDescription": "Ceci supprimera definitivement le worktree et sa branche. Les modifications non committées seront perdues.",
"detached": "(détaché)",