diff options
| author | Alex Yaroshuk <[email protected]> | 2026-02-03 04:36:00 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-02-02 14:36:00 -0600 |
| commit | 824165eb792edfd8600d44aac83e1f6bba2a9e62 (patch) | |
| tree | 9694a8df448d9d036d0b4761d62607337f777370 /packages/app/src/pages | |
| parent | 562c9d76d9becbd485af589ab7ddd64f9c9fd31d (diff) | |
| download | opencode-824165eb792edfd8600d44aac83e1f6bba2a9e62.tar.gz opencode-824165eb792edfd8600d44aac83e1f6bba2a9e62.zip | |
feat(app): add workspace toggle command to command palette and prompt input (#11810)
Diffstat (limited to 'packages/app/src/pages')
| -rw-r--r-- | packages/app/src/pages/layout.tsx | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/packages/app/src/pages/layout.tsx b/packages/app/src/pages/layout.tsx index fe8618b73..ba888a280 100644 --- a/packages/app/src/pages/layout.tsx +++ b/packages/app/src/pages/layout.tsx @@ -1139,6 +1139,29 @@ export default function Layout(props: ParentProps) { }, }, { + id: "workspace.toggle", + title: language.t("command.workspace.toggle"), + description: language.t("command.workspace.toggle.description"), + category: language.t("command.category.workspace"), + slash: "workspace", + disabled: !currentProject() || currentProject()?.vcs !== "git", + onSelect: () => { + const project = currentProject() + if (!project) return + if (project.vcs !== "git") return + const wasEnabled = layout.sidebar.workspaces(project.worktree)() + layout.sidebar.toggleWorkspaces(project.worktree) + showToast({ + title: wasEnabled + ? language.t("toast.workspace.disabled.title") + : language.t("toast.workspace.enabled.title"), + description: wasEnabled + ? language.t("toast.workspace.disabled.description") + : language.t("toast.workspace.enabled.description"), + }) + }, + }, + { id: "theme.cycle", title: language.t("command.theme.cycle"), category: language.t("command.category.theme"), |
