From b2befb4feb00d0e5fb1cbddb834ba572477f2719 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Mon, 30 Mar 2026 19:08:54 +0300 Subject: [PATCH] feat(llm): automatic refresh of note title --- apps/client/src/widgets/sidebar/SidebarChat.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/client/src/widgets/sidebar/SidebarChat.tsx b/apps/client/src/widgets/sidebar/SidebarChat.tsx index cb3c4663b9..9aba9dae9e 100644 --- a/apps/client/src/widgets/sidebar/SidebarChat.tsx +++ b/apps/client/src/widgets/sidebar/SidebarChat.tsx @@ -9,7 +9,7 @@ import server from "../../services/server.js"; import ActionButton from "../react/ActionButton.js"; import Dropdown from "../react/Dropdown.js"; import { FormListItem } from "../react/FormList.js"; -import { useActiveNoteContext } from "../react/hooks.js"; +import { useActiveNoteContext, useNote, useNoteProperty } from "../react/hooks.js"; import NoItems from "../react/NoItems.js"; import ChatInputBar from "../type_widgets/llm_chat/ChatInputBar.js"; import ChatMessage from "../type_widgets/llm_chat/ChatMessage.js"; @@ -32,6 +32,10 @@ export default function SidebarChat() { // Get the current active note context const { noteId: activeNoteId, note: activeNote } = useActiveNoteContext(); + // Reactively watch the chat note's title (updates via WebSocket sync after auto-rename) + const chatNote = useNote(chatNoteId); + const chatTitle = useNoteProperty(chatNote, "title") || t("sidebar_chat.title"); + // Use shared chat hook with sidebar-specific options const chat = useLlmChat( // onMessagesChange - trigger save @@ -213,7 +217,7 @@ export default function SidebarChat() { return (