feat(frontend): session list sidebar and persisted history loading
- Sidebar lists sessions with title/relative time, click to switch, hover-to-delete; refreshes after each round so new titles appear - ChatPage loads message history from GET /sessions/:id/messages when entering a session - WS connect now passes user_id so persisted messages have an owner
This commit is contained in:
1 parent
f8196c111c
commit
8190007865
5 files changed
+103
-13
No files matched your search
@@ -10,6 +10,7 @@ interface ChatState {
|
||||
|
||||
setInput: (text: string) => void
|
||||
setSessionId: (id: string) => void
|
||||
setMessages: (msgs: Message[]) => void
|
||||
addMessage: (msg: Message) => void
|
||||
appendToLast: (content: string) => void
|
||||
setStreaming: (v: boolean) => void
|
||||
@@ -26,6 +27,7 @@ export const useChatStore = create<ChatState>((set, get) => ({
|
||||
|
||||
setInput: (text) => set({ inputText: text }),
|
||||
setSessionId: (id) => set({ currentSessionId: id }),
|
||||
setMessages: (msgs) => set({ messages: msgs }),
|
||||
setStreaming: (v) => set({ isStreaming: v }),
|
||||
setIotDevices: (d) => set({ iotDevices: d }),
|
||||
|
||||
|
||||
Reference in new issue
Block a user