feat(app): add workspace toggle command to command palette and prompt input (#11810)

This commit is contained in:
Alex Yaroshuk
2026-02-03 04:36:00 +08:00
committed by GitHub
parent 562c9d76d9
commit 824165eb79
16 changed files with 107 additions and 3 deletions

View File

@@ -1138,6 +1138,29 @@ export default function Layout(props: ParentProps) {
if (session) archiveSession(session)
},
},
{
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"),