YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context
Rust agentsagiaiai-memoryaudio-recordingcomputer-visionhermeshermes-agentllmlocal-ailocal-firstmachine-learningmcpmultimodalopenclawprivacyrewindscreen-recordingspeech-to-textycombinator
fix(chat): parallel-chat reset on switch + monochrome sidebar
Louis Beaumont5213a35b9316
diff --git a/apps/screenpipe-app-tauri/components/chat-sidebar.tsx b/apps/screenpipe-app-tauri/components/chat-sidebar.tsxindex 7b9f142b6..6e724c1c2 100644--- a/apps/screenpipe-app-tauri/components/chat-sidebar.tsx+++ b/apps/screenpipe-app-tauri/components/chat-sidebar.tsx@@ -267,15 +267,18 @@ interface ChatRowProps {* (That's why "delete chat doesn't work" — the X click was eaten by the* outer button.)*- * Left-side status indicator follows Claude's pattern but uses screenpipe- * brand:- * ● small filled dot, current/orange + slow pulse → streaming/thinking/tool- * ● small filled dot, foreground (no pulse) → unread (new content)- * ⚠ alert icon, red → error- * ○ hollow ring, muted → idle (default)+ * Left-side status indicator — minimalist, monochrome (no brand colors;+ * screenpipe is black/white):+ * ● filled foreground dot + slow pulse → streaming/thinking/tool+ * ● filled foreground dot → unread (new content)+ * ⚠ alert icon, red (single exception) → error+ * ○ hollow ring → idle (default)*- * Animation is a custom ~1.4s ping that's slower + subtler than Tailwind's- * default — minimal, not a distraction in your peripheral vision.+ * Animation is a custom ~1.6s pulse — slow + soft so it sits in the+ * peripheral vision without pulling focus.+ *+ * No preview line below the title. The title alone is what the user+ * picks chats by; partial Pi tokens leaking into the row read as noise.*/function ChatRow({session,@@ -369,20 +372,6 @@ function ChatRow({</button></span></div>- {session.preview && (- <div- className={cn(- "text-[10px] truncate mt-0.5 ml-4",- isError- ? "text-red-500/80"- : isLive- ? "text-orange-600/80 italic"- : "text-muted-foreground/70"- )}- >- {session.preview}- </div>- )}</div>);}@@ -414,10 +403,10 @@ function StatusDot({className="relative h-2 w-2 shrink-0 flex items-center justify-center"aria-label={status}>- {/* outer halo — slow gentle pulse */}- <span className="absolute inset-0 rounded-full bg-orange-500/40 animate-[sp-pulse_1.6s_ease-in-out_infinite]" />- {/* inner dot — solid */}- <span className="relative h-1.5 w-1.5 rounded-full bg-orange-500" />+ {/* outer halo — slow gentle pulse, monochrome */}+ <span className="absolute inset-0 rounded-full bg-foreground/30 animate-[sp-pulse_1.6s_ease-in-out_infinite]" />+ {/* inner dot — solid foreground */}+ <span className="relative h-1.5 w-1.5 rounded-full bg-foreground" /></span>);}diff --git a/apps/screenpipe-app-tauri/components/standalone-chat.tsx b/apps/screenpipe-app-tauri/components/standalone-chat.tsxindex 1f22db65e..9cac809ae 100644--- a/apps/screenpipe-app-tauri/components/standalone-chat.tsx+++ b/apps/screenpipe-app-tauri/components/standalone-chat.tsx@@ -1635,22 +1635,45 @@ export function StandaloneChat({const unlisten = listen<{ conversationId: string }>("chat-load-conversation", async (event) => {const { conversationId: convId } = event.payload;const { loadConversationFile } = await import("@/lib/chat-storage");+ const { useChatStore } = await import("@/lib/stores/chat-store");++ // 1) Disk first — saved conversations are the canonical source.const conv = await loadConversationFile(convId);if (conv) {loadConversation(conv);- } else {- // Unknown id → start a new chat that adopts the requested id so- // sidebar + chat (and the chat-store's currentId) all agree from- // message 0. Pass the id directly into startNewConversation- // instead of overriding piSessionIdRef after the fact — the- // override pattern left store.currentId stuck on the throwaway- // uuid that startNewConversation had generated, which made the- // router treat the new id as a background session and the- // sidebar lose its highlight until the user typed.- await startNewConversation(convId);- // Mirror the new id back to the sidebar so its currentId matches.- emit("chat-current-session", { id: convId });+ return;+ }++ // 2) Store fallback — the conversation may exist only in memory+ // because it was started in this session and hasn't completed+ // a turn yet (no agent_end → no save). Without this branch,+ // clicking back to a chat that's been streaming in the+ // background would fall through to startNewConversation and+ // silently WIPE the in-memory state. That's the "switch to a+ // new chat, switch back, A is empty" repro: A had messages+ // only in the store (mid-stream when the user left), so the+ // disk lookup missed and the panel reset.+ const session = useChatStore.getState().sessions[convId];+ if (session?.messages && session.messages.length > 0) {+ // Stub conversation — loadConversation prefers store messages+ // over the conv arg whenever the store has them, so the empty+ // messages array here is just a satisfaction of the type.+ loadConversation({+ id: convId,+ title: session.title || "untitled",+ messages: [],+ createdAt: Date.now(),+ updatedAt: session.updatedAt,+ });+ return;}++ // 3) Truly new id (sidebar's "+ new chat" path) — adopt the+ // requested id so sidebar + chat (and the chat-store's+ // currentId) all agree from message 0.+ await startNewConversation(convId);+ // Mirror the new id back to the sidebar so its currentId matches.+ emit("chat-current-session", { id: convId });});return () => { unlisten.then((fn) => fn()); };// eslint-disable-next-line react-hooks/exhaustive-depsdiff --git a/apps/screenpipe-app-tauri/src-tauri/Cargo.toml b/apps/screenpipe-app-tauri/src-tauri/Cargo.tomlindex 91390e742..8fe27aad8 100644--- a/apps/screenpipe-app-tauri/src-tauri/Cargo.toml+++ b/apps/screenpipe-app-tauri/src-tauri/Cargo.toml@@ -1,6 +1,6 @@[package]name = "screenpipe-app"-version = "2.4.66"+version = "2.4.67"description = "24/7 memory for your desktop. 100% local."authors = ["you"]license = ""