diff --git a/packages/app/src/pages/layout.tsx b/packages/app/src/pages/layout.tsx index 7895b8308..485deae99 100644 --- a/packages/app/src/pages/layout.tsx +++ b/packages/app/src/pages/layout.tsx @@ -548,6 +548,7 @@ export default function Layout(props: ParentProps) { const workspaceSetting = createMemo(() => { const project = currentProject() if (!project) return false + if (project.vcs !== "git") return false return layout.sidebar.workspaces(project.worktree)() }) @@ -587,7 +588,7 @@ export default function Layout(props: ParentProps) { if (!expanded) continue const project = projects.find((item) => item.worktree === directory || item.sandboxes?.includes(directory)) if (!project) continue - if (layout.sidebar.workspaces(project.worktree)()) continue + if (project.vcs === "git" && layout.sidebar.workspaces(project.worktree)()) continue setStore("workspaceExpanded", directory, false) } }) @@ -2041,7 +2042,9 @@ export default function Layout(props: ParentProps) { }) const workspaces = createMemo(() => workspaceIds(props.project).slice(0, 2)) - const workspaceEnabled = createMemo(() => layout.sidebar.workspaces(props.project.worktree)()) + const workspaceEnabled = createMemo( + () => props.project.vcs === "git" && layout.sidebar.workspaces(props.project.worktree)(), + ) const [open, setOpen] = createSignal(false) const label = (directory: string) => { @@ -2301,7 +2304,7 @@ export default function Layout(props: ParentProps) { title: language.t("workspace.new"), category: language.t("command.category.workspace"), keybind: "mod+shift+w", - disabled: !layout.sidebar.workspaces(project()?.worktree ?? "")(), + disabled: !workspaceSetting(), onSelect: createWorkspace, }, ]) @@ -2429,7 +2432,18 @@ export default function Layout(props: ParentProps) { dialog.show(() => )}> {language.t("common.edit")} - layout.sidebar.toggleWorkspaces(p.worktree)}> + { + const enabled = layout.sidebar.workspaces(p.worktree)() + if (enabled) { + layout.sidebar.toggleWorkspaces(p.worktree) + return + } + if (p.vcs !== "git") return + layout.sidebar.toggleWorkspaces(p.worktree) + }} + > {layout.sidebar.workspaces(p.worktree)() ? language.t("sidebar.workspaces.disable") @@ -2447,7 +2461,7 @@ export default function Layout(props: ParentProps) {