From 325f7b03671ed331dd3ab9ee0252dc8a8fd875d4 Mon Sep 17 00:00:00 2001 From: chengyongru Date: Fri, 7 Aug 2026 13:27:53 +0800 Subject: [PATCH] fix(webui): name temporary chats from first message --- webui/src/App.tsx | 3 ++- webui/src/components/ChatList.tsx | 3 ++- webui/src/lib/temporary-chat.ts | 9 +++++++++ webui/src/tests/app-layout.test.tsx | 5 ++++- webui/src/tests/chat-list.test.tsx | 6 +++--- 5 files changed, 20 insertions(+), 6 deletions(-) diff --git a/webui/src/App.tsx b/webui/src/App.tsx index 7033f6e30..1b50e0ce6 100644 --- a/webui/src/App.tsx +++ b/webui/src/App.tsx @@ -64,6 +64,7 @@ import { import { projectNameFromPath, scopeWithAccessMode } from "@/lib/workspace"; import { createTemporaryChatSession, + deriveTemporaryChatTitle, } from "@/lib/temporary-chat"; type BootState = @@ -2069,7 +2070,7 @@ function Shell({ }, []); const headerTitle = temporaryChatActive - ? t("temporaryChat.title") + ? deriveTemporaryChatTitle(activeSession?.preview, t("temporaryChat.title")) : activeSession ? sidebarState.title_overrides[activeSession.key] || activeSession.title || diff --git a/webui/src/components/ChatList.tsx b/webui/src/components/ChatList.tsx index f71a4e32a..e4abc146f 100644 --- a/webui/src/components/ChatList.tsx +++ b/webui/src/components/ChatList.tsx @@ -44,6 +44,7 @@ import { type ChatGroupLabels, } from "@/lib/chat-groups"; import { clearDraggedSession, writeDraggedSession } from "@/lib/session-drag"; +import { deriveTemporaryChatTitle } from "@/lib/temporary-chat"; import { cn } from "@/lib/utils"; import type { ChatSummary, SidebarDensity, SidebarSortMode } from "@/lib/types"; @@ -537,7 +538,7 @@ function TemporaryChatSection({