th-d5b446: conversation sidebar + resume + new-chat (daemon PWA) - #181
Merged
Merged
Conversation
The smooth-web SPA was a single ephemeral chat (one fresh session per load, no history). Add a toggleable slide-in sidebar listing recent conversations, resume-in-context, and a New chat button — driven by three more smooth-operator WS actions. operator.ts: on connect, request list_conversations (refreshed after each turn); resumeConversation(id) binds a session to an existing conversationId then loads its history via get_conversation_messages; newConversation() opens a fresh session and clears the transcript. New hook surface: conversations, activeConversationId, refreshConversations, resumeConversation, newConversation. App.tsx: Aurora-Glass Sidebar (overlay+backdrop on mobile, docks on desktop), active-row highlight, prominent New chat, brand mark relocated into the sidebar header. No sidebar interaction = unchanged single-chat behaviour. Also fills the required blocks: [] on the error/user ChatMessage literals so tsc --noEmit is clean (they previously only survived via vite's esbuild). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 9e0d264 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The Big Smooth daemon PWA (smooth-web SPA) was a single, ephemeral chat:
useOperatorcreated one fresh session per page load with a randomagentIdand had no history or conversation list. There was no way to see past conversations or resume one.Solution
A toggleable slide-in conversation sidebar + resume + new-chat, built against the sibling server agent's WS contract (pearl th-d5b446).
operator.ts— three more smooth-operator WS actionslist_conversations— sent on connect and after every completed turn (eventual_response); the reply'sdata.conversationspopulates a newconversations: ConversationSummary[]. Exposed withrefreshConversations().resumeConversation(conversationId)— clears the transcript, opens acreate_conversation_sessionbound to thatconversationId, and (once the session id comes back) chases it withget_conversation_messagesto load history intomessages. ApendingResumeRefsequences the history fetch after the session reply, since it needs thesessionId.newConversation()— freshcreate_conversation_session(no id), cleared transcript,activeConversationIdreset.immediate_responsenow branches on payload shape (conversations[]→ list,messages[]→ history,sessionId→ bind session + captureconversationIdfor highlighting).App.tsx— the sidebarSidebar: overlays with a backdrop on mobile, docks on desktop (lg:pl-72on the main column), highlights the active conversation, lists title + relative time + message count, and carries a prominent New chat button.Back-compat
No sidebar interaction ⇒ identical single-chat behaviour to before.
Assumptions to reconcile with the server agent
{ role, content }(defensive ontext/messagealiases). User turns render inbound, everything else assistant; past tool chips are NOT reconstructed — history is text-only.ConversationSummary.updatedAtread defensively (ISO string or epoch; a bare number < 1e12 treated as seconds) inrelTime.get_conversation_messagesis sent with bothsessionIdandconversationId(contract left it ambiguous).Build status
pnpm build:web— clean ✅tsc --noEmit— clean ✅ (also fixed two pre-existingChatMessageliterals missing the requiredblocksfield, which only survived via vite's esbuild)list_conversations/get_conversation_messages/ resume server actions integrate when the Rust side lands (the daemon path-deps the server).🤖 Generated with Claude Code