From 6ed2ef750b5e24f63f0de6d814154b65bf9c5240 Mon Sep 17 00:00:00 2001 From: Bohdan Triapitsyn Date: Mon, 13 Jul 2026 02:25:18 +0300 Subject: [PATCH] fix: hide craft-goal starter in VS Code runtime Omits the craft-goal command from draft starters in VS Code Prevents the starter from being resolved or pinnable in that runtime Keeps non-VS Code behavior unchanged --- packages/ui/src/components/chat/useDraftStarters.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/ui/src/components/chat/useDraftStarters.ts b/packages/ui/src/components/chat/useDraftStarters.ts index 6a49b5fe..909f5804 100644 --- a/packages/ui/src/components/chat/useDraftStarters.ts +++ b/packages/ui/src/components/chat/useDraftStarters.ts @@ -7,6 +7,7 @@ import { useSkillsStore } from '@/stores/useSkillsStore'; import { useProjectsStore } from '@/stores/useProjectsStore'; import { updateDesktopSettings } from '@/lib/persistence'; import { getProjectDraftStarters, saveProjectDraftStarters } from '@/lib/openchamberConfig'; +import { isVSCodeRuntime } from '@/lib/desktop'; import type { IconName } from '@/components/icon/icons'; import { BUILTIN_STARTERS, @@ -58,6 +59,7 @@ export type UseDraftStartersResult = { export function useDraftStarters(): UseDraftStartersResult { const { t } = useI18n(); + const isVSCode = React.useMemo(() => isVSCodeRuntime(), []); const globalRaw = useUIStore((s) => s.globalDraftStarters); const commands = useCommandsStore((s) => s.commands); const skills = useSkillsStore((s) => s.skills); @@ -105,6 +107,7 @@ export function useDraftStarters(): UseDraftStartersResult { const skillNames = React.useMemo(() => new Set(skills.map((s) => s.name)), [skills]); const resolve = React.useCallback((ref: DraftStarterRef, group: StarterGroup): ResolvedStarter | null => { + if (isVSCode && ref.type === 'command' && ref.name === 'craft-goal') return null; if (ref.type === 'command') { const builtin = getBuiltInStarter(ref.name); if (builtin) { @@ -115,7 +118,7 @@ export function useDraftStarters(): UseDraftStartersResult { } if (!skillNames.has(ref.name)) return null; return { id: chipId(group, ref), ref, group, label: normalizeStarterLabel(ref.name), icon: SKILL_FALLBACK_ICON, submitText: `/${ref.name}` }; - }, [t, commandNames, skillNames]); + }, [t, commandNames, skillNames, isVSCode]); const globalRefs = React.useMemo( () => globalRaw ?? DEFAULT_GLOBAL_STARTERS, @@ -141,6 +144,7 @@ export function useDraftStarters(): UseDraftStartersResult { const pinnable = React.useMemo(() => { const items: PinnableItem[] = []; for (const b of BUILTIN_STARTERS) { + if (isVSCode && b.name === 'craft-goal') continue; items.push({ type: 'command', name: b.name, label: t(b.labelKey), icon: b.icon, section: 'built-in', scope: 'user' }); } for (const c of commands) { @@ -152,7 +156,7 @@ export function useDraftStarters(): UseDraftStartersResult { } // Only offer items that are not already pinned (removed built-ins reappear here). return items.filter((item) => !pinnedKeys.has(`${item.type}:${item.name}`)); - }, [t, commands, skills, pinnedKeys]); + }, [t, commands, skills, pinnedKeys, isVSCode]); const persistGlobal = React.useCallback((next: DraftStarterRef[]) => { useUIStore.getState().setGlobalDraftStarters(next);