From 2ab9d35c85315714c15eb33fd1e8c4db6cacaca1 Mon Sep 17 00:00:00 2001 From: Guilhem Lemouel Date: Wed, 29 Apr 2026 11:08:23 +0200 Subject: [PATCH] feat: move AI chat history to sidebar and drop in-panel header - Add an "AI chat" section to the sidebar (mobile drawer, desktop, and operator views) showing past chats from HistoryManager with a + button in the header that creates a new chat and routes to /design-sandbox. Section title fades out when the sidebar is collapsed. - Remove the in-panel chat header from AIChatDisplay (Chat title, HideButton slot, History popover, + button, headerRight slot) along with the now-unused props (pastChats, loadPastChat, deletePastChat, saveAndClear, headerLeft, headerRight). The chat panel now starts directly with the messages, and history/new-chat live in the sidebar. - AIChat.svelte updated to drop the headerLeft snippet, the HideButton import, and the now-unused props on AIChatDisplay. - design-sandbox page mocks aiChatManager.historyManager.getPastChats() with realistic Windmill-style chat titles so the sidebar history is populated for the design preview without writing to IndexedDB. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../lib/components/copilot/chat/AIChat.svelte | 23 ----- .../copilot/chat/AIChatDisplay.svelte | 90 ------------------- .../src/routes/(root)/(logged)/+layout.svelte | 48 +++++++++- .../(logged)/design-sandbox/+page.svelte | 18 ++++ 4 files changed, 65 insertions(+), 114 deletions(-) diff --git a/frontend/src/lib/components/copilot/chat/AIChat.svelte b/frontend/src/lib/components/copilot/chat/AIChat.svelte index 007675d0bf..056bd01961 100644 --- a/frontend/src/lib/components/copilot/chat/AIChat.svelte +++ b/frontend/src/lib/components/copilot/chat/AIChat.svelte @@ -5,7 +5,6 @@ import { dbSchemas, userStore, workspaceStore } from '$lib/stores' import { aiChatManager, AIMode } from './AIChatManager.svelte' import { base } from '$lib/base' - import HideButton from '$lib/components/apps/editor/settingsPanel/HideButton.svelte' import { SUPPORTED_CHAT_SCRIPT_LANGUAGES } from './script/core' import { copilotInfo, copilotSessionModel } from '$lib/aiStore' @@ -53,8 +52,6 @@ aiChatManager.sendRequest(options) } - const historyManager = aiChatManager.historyManager - let aiChatDisplay: AIChatDisplay | undefined = $state(undefined) $effect(() => { @@ -80,20 +77,8 @@ }} /> -{#snippet headerLeft()} -