diff --git a/src/routes/v2/pages/Editor/EditorV2.tsx b/src/routes/v2/pages/Editor/EditorV2.tsx index 37b9e8997..41f4fe518 100644 --- a/src/routes/v2/pages/Editor/EditorV2.tsx +++ b/src/routes/v2/pages/Editor/EditorV2.tsx @@ -97,12 +97,12 @@ const PipelineEditor = withSuspenseWrapper( useEditorEscapeShortcut(); useDebugPanelWindow(); useTipOfTheDayWindow(); - useSeedInitialDockLayoutFromPreset(componentSearchV2Enabled); const aiEnabled = useFlagValue("ai-assistant"); useAiChatWindow(aiEnabled); useComponentSearchV2Window(componentSearchV2Enabled); + useSeedInitialDockLayoutFromPreset(componentSearchV2Enabled); const activeSpec = navigation.activeSpec; diff --git a/src/routes/v2/pages/Editor/hooks/useAiChatWindow.tsx b/src/routes/v2/pages/Editor/hooks/useAiChatWindow.tsx index 56176a676..2810db3eb 100644 --- a/src/routes/v2/pages/Editor/hooks/useAiChatWindow.tsx +++ b/src/routes/v2/pages/Editor/hooks/useAiChatWindow.tsx @@ -26,11 +26,13 @@ export function useAiChatWindow(enabled: boolean) { />, { id: AI_CHAT_WINDOW_ID, - title: "AI Assistant", + title: "Sidekick", position: { x: 100, y: 80 }, size: { width: 380, height: 520 }, disabledActions: ["close"], + startVisible: true, persisted: true, + defaultDockState: "left", }, ); }, [enabled, windows, editorSession]); diff --git a/src/routes/v2/shared/windows/viewPresets.ts b/src/routes/v2/shared/windows/viewPresets.ts index a5b6ff3ce..48f830658 100644 --- a/src/routes/v2/shared/windows/viewPresets.ts +++ b/src/routes/v2/shared/windows/viewPresets.ts @@ -12,6 +12,7 @@ export interface ViewPreset { dockAreas?: PresetDockAreas; } +const AI_ASSISTANT_WINDOW_ID = "ai-assistant-chat"; const COMPONENT_SEARCH_WINDOW_ID = "component-search-v2"; const COMPONENT_LIBRARY_WINDOW_ID = "component-library"; @@ -21,6 +22,7 @@ export const DEFAULT_DOCK_AREAS: PresetDockAreas = { "runs-and-submission", COMPONENT_SEARCH_WINDOW_ID, COMPONENT_LIBRARY_WINDOW_ID, + AI_ASSISTANT_WINDOW_ID, "pipeline-tree", "history", "debug-panel", @@ -45,12 +47,14 @@ export function dockSideByWindowId( export const DEFAULT_VIEW_PRESET: ViewPreset = { label: "Default", - description: "Components, Runs & Submissions, Recent Runs, Pipeline Details", + description: + "Components, Runs & Submissions, Sidekick, Recent Runs, Pipeline Details", visible: new Set([ "runs-and-submission", "recent-runs", "component-search-v2", "component-library", + AI_ASSISTANT_WINDOW_ID, "pipeline-details", "tip-of-the-day", ]), @@ -62,11 +66,12 @@ export const VIEW_PRESETS: ViewPreset[] = [ { label: "All", description: - "All windows visible, including Runs & Submissions and Recent Runs", + "All windows visible, including Runs & Submissions, Sidekick, and Recent Runs", visible: new Set([ "runs-and-submission", COMPONENT_SEARCH_WINDOW_ID, COMPONENT_LIBRARY_WINDOW_ID, + AI_ASSISTANT_WINDOW_ID, "history", "pipeline-tree", "pipeline-details", diff --git a/src/routes/v2/shared/windows/windowStore.viewPreset.test.ts b/src/routes/v2/shared/windows/windowStore.viewPreset.test.ts index 075f6dafe..1b013e2af 100644 --- a/src/routes/v2/shared/windows/windowStore.viewPreset.test.ts +++ b/src/routes/v2/shared/windows/windowStore.viewPreset.test.ts @@ -23,10 +23,16 @@ describe("WindowStoreImpl view preset dock layout", () => { title: "Runs", defaultDockState: "left", }); + store.openWindow(stubContent, { + id: "ai-assistant-chat", + title: "Sidekick", + defaultDockState: "left", + }); expect(store.getDockAreaWindowIds("left")).toEqual([ "component-library", "runs-and-submission", + "ai-assistant-chat", ]); store.seedInitialDockLayoutFromPreset(DEFAULT_VIEW_PRESET);