{t("editor.comingSoon")}
+ {project.ide === "terminal" && isMac && ( +{t("editor.noFolders")}
+ ) : ( +{f.name}
++ {f.path} +
+
+ {preview}
+
+ )}
+ + {t("projects.noSearchResults", { query: search })} +
+ {onClearSearch && ( + + )} ++ {t("projects.emptyDescription")} +
+{t("common.loading")}
; - } - - function update(patch: Partial+ {t("common.loading")} +
); } - - function removeFolder(id: string) { - const remainingFolders = project!.folders.filter((f) => f.id !== id); - const fallbackFolderId = remainingFolders[0]?.id ?? ""; - const updatedGroups = project!.terminal_groups.map((g) => ({ - ...g, - terminals: g.terminals.map((t) => - t.folder_id === id ? { ...t, folder_id: fallbackFolderId } : t - ), - })); - update({ folders: remainingFolders, terminal_groups: updatedGroups }); - } - - function addGroup() { - const nextOrder = project!.terminal_groups.length + 1; - const group: TerminalGroup = { - id: newId(), - name: `group${nextOrder}`, - order: nextOrder, - terminals: [], - }; - update({ terminal_groups: [...project!.terminal_groups, group] }); - } - - function removeGroup(groupId: string) { - update({ terminal_groups: project!.terminal_groups.filter((g) => g.id !== groupId) }); - } - - function addTerminal(groupId: string) { - if (project!.folders.length === 0) { - toast.error(t("editor.toasts.addFolderFirst")); - return; - } - // VS Code task labels must be unique across the whole workspace file, not just - // within a group — count every terminal in the project, not just this group's. - const totalTerminals = project!.terminal_groups.reduce((n, g) => n + g.terminals.length, 0); - update({ - terminal_groups: project!.terminal_groups.map((g) => - g.id !== groupId - ? g - : { - ...g, - terminals: [ - ...g.terminals, - { - id: newId(), - label: `${t("terminals.terminal")} ${totalTerminals + 1}`, - folder_id: project!.folders[0].id, - command: null, - keep_alive: true, - order: g.terminals.length, - } satisfies Terminal, - ], - } - ), - }); - } - - function updateTerminal(groupId: string, terminalId: string, patch: Partial{t("editor.comingSoon")}
- {project.ide === "terminal" && isMac && ( -{t("editor.noFolders")}
- ) : ( -{f.name}
-{f.path}
-
- {preview}
-
- )}
- - {t("projects.emptyDescription")} -
-- {t("projects.noSearchResults", { query: search })} -
- -