Skip to content

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

fix(chat): close-button works, parallel-chat double-write, status dot, smaller nav

Louis Beaumonta4b85977551b
diff --git a/apps/screenpipe-app-tauri/app/globals.css b/apps/screenpipe-app-tauri/app/globals.css
index 2a4eabbc8..55a27d094 100644
--- a/apps/screenpipe-app-tauri/app/globals.css
+++ b/apps/screenpipe-app-tauri/app/globals.css
@@ -460,6 +460,24 @@
}
}
+ /* sp-pulse — slow soft halo for live-streaming chat rows in the
+ sidebar. Tailwind's default `animate-pulse` is too loud (opacity
+ fades from 1 → 0.5) and `animate-ping` flashes outward too
+ aggressively. We want a calmer breath — opacity dips less far,
+ scales out slightly, and breathes at 1.6s so it reads as
+ "background activity" rather than "alert me now". */
+ @keyframes sp-pulse {
+ 0%,
+ 100% {
+ transform: scale(1);
+ opacity: 0.55;
+ }
+ 50% {
+ transform: scale(1.6);
+ opacity: 0;
+ }
+ }
+
.animate-shimmer {
animation: shimmer 1.5s infinite linear;
}
diff --git a/apps/screenpipe-app-tauri/app/home/page.tsx b/apps/screenpipe-app-tauri/app/home/page.tsx
index 162ceee6c..c75f310de 100644
--- a/apps/screenpipe-app-tauri/app/home/page.tsx
+++ b/apps/screenpipe-app-tauri/app/home/page.tsx
@@ -322,10 +322,10 @@ function HomeContent() {
// Top-level nav items (filtered by enterprise policy)
const mainSections = [
- { id: "home", label: "Home", icon: <Home className="h-4 w-4" /> },
- { id: "pipes", label: "Pipes", icon: <Workflow className="h-4 w-4" /> },
- { id: "timeline", label: "Timeline", icon: <Clock className="h-4 w-4" /> },
- { id: "memories", label: "Memories", icon: <Sparkles className="h-4 w-4" /> },
+ { id: "home", label: "Home", icon: <Home className="h-3.5 w-3.5" /> },
+ { id: "pipes", label: "Pipes", icon: <Workflow className="h-3.5 w-3.5" /> },
+ { id: "timeline", label: "Timeline", icon: <Clock className="h-3.5 w-3.5" /> },
+ { id: "memories", label: "Memories", icon: <Sparkles className="h-3.5 w-3.5" /> },
].filter((s) => !isSectionHidden(s.id));
// Listen for navigation events from other windows (e.g. tray, Rust-side links)
@@ -485,7 +485,7 @@ function HomeContent() {
setActiveSection(section.id);
}}
className={cn(
- "w-full flex items-center px-3 py-2 rounded-lg transition-all duration-150 text-left group",
+ "w-full flex items-center px-2.5 py-1.5 rounded-lg transition-all duration-150 text-left group",
sidebarCollapsed ? "justify-center" : "space-x-2.5",
isActive
? isTranslucent
@@ -504,7 +504,7 @@ function HomeContent() {
)}>
{section.icon}
</div>
- {!sidebarCollapsed && <span className={cn("text-sm truncate", isActive && isTranslucent ? "font-semibold vibrant-sidebar-fg" : "font-medium")}>{section.label}</span>}
+ {!sidebarCollapsed && <span className={cn("text-xs truncate", isActive && isTranslucent ? "font-semibold vibrant-sidebar-fg" : "font-medium")}>{section.label}</span>}
</button>
);
if (sidebarCollapsed) {
@@ -548,13 +548,13 @@ function HomeContent() {
<button
onClick={() => openSettings("team")}
className={cn(
- "w-full flex items-center px-3 py-2 rounded-lg transition-all duration-150 text-left group",
+ "w-full flex items-center px-2.5 py-1.5 rounded-lg transition-all duration-150 text-left group",
sidebarCollapsed ? "justify-center" : "space-x-2.5",
isTranslucent ? "vibrant-nav-item vibrant-nav-hover" : "hover:bg-card/50 text-muted-foreground hover:text-foreground",
)}
>
- <UserPlus className={cn("h-4 w-4 transition-colors flex-shrink-0", isTranslucent ? "" : "text-muted-foreground group-hover:text-foreground")} />
- {!sidebarCollapsed && <span className="font-medium text-sm truncate">{teamLabel}</span>}
+ <UserPlus className={cn("h-3.5 w-3.5 transition-colors flex-shrink-0", isTranslucent ? "" : "text-muted-foreground group-hover:text-foreground")} />
+ {!sidebarCollapsed && <span className="font-medium text-xs truncate">{teamLabel}</span>}
</button>
);
if (sidebarCollapsed) {
@@ -574,13 +574,13 @@ function HomeContent() {
<button
onClick={() => openSettings("referral")}
className={cn(
- "w-full flex items-center px-3 py-2 rounded-lg transition-all duration-150 text-left group",
+ "w-full flex items-center px-2.5 py-1.5 rounded-lg transition-all duration-150 text-left group",
sidebarCollapsed ? "justify-center" : "space-x-2.5",
isTranslucent ? "vibrant-nav-item vibrant-nav-hover" : "hover:bg-card/50 text-muted-foreground hover:text-foreground",
)}
>
- <Gift className={cn("h-4 w-4 transition-colors flex-shrink-0", isTranslucent ? "" : "text-muted-foreground group-hover:text-foreground")} />
- {!sidebarCollapsed && <span className="font-medium text-sm truncate">Get free month</span>}
+ <Gift className={cn("h-3.5 w-3.5 transition-colors flex-shrink-0", isTranslucent ? "" : "text-muted-foreground group-hover:text-foreground")} />
+ {!sidebarCollapsed && <span className="font-medium text-xs truncate">Get free month</span>}
</button>
);
if (sidebarCollapsed) {
@@ -601,7 +601,7 @@ function HomeContent() {
data-testid="nav-settings"
onClick={() => openSettings("general")}
className={cn(
- "w-full flex items-center px-3 py-2 rounded-lg transition-all duration-150 text-left group",
+ "w-full flex items-center px-2.5 py-1.5 rounded-lg transition-all duration-150 text-left group",
sidebarCollapsed ? "justify-center" : "space-x-2.5",
isTranslucent
? "vibrant-nav-item vibrant-nav-hover"
@@ -612,9 +612,9 @@ function HomeContent() {
"transition-colors flex-shrink-0",
isTranslucent ? "" : "text-muted-foreground group-hover:text-foreground"
)}>
- <SettingsIcon className="h-4 w-4" />
+ <SettingsIcon className="h-3.5 w-3.5" />
</div>
- {!sidebarCollapsed && <span className="font-medium text-sm truncate">Settings</span>}
+ {!sidebarCollapsed && <span className="font-medium text-xs truncate">Settings</span>}
</button>
);
if (sidebarCollapsed) {
@@ -638,7 +638,7 @@ function HomeContent() {
setActiveSection("help");
}}
className={cn(
- "w-full flex items-center px-3 py-2 rounded-lg transition-all duration-150 text-left group",
+ "w-full flex items-center px-2.5 py-1.5 rounded-lg transition-all duration-150 text-left group",
sidebarCollapsed ? "justify-center" : "space-x-2.5",
isActive
? isTranslucent
@@ -655,9 +655,9 @@ function HomeContent() {
? isTranslucent ? "" : "text-primary"
: isTranslucent ? "" : "text-muted-foreground group-hover:text-foreground"
)}>
- <HelpCircle className="h-4 w-4" />
+ <HelpCircle className="h-3.5 w-3.5" />
</div>
- {!sidebarCollapsed && <span className="font-medium text-sm truncate">Help</span>}
+ {!sidebarCollapsed && <span className="font-medium text-xs truncate">Help</span>}
</button>
);
if (sidebarCollapsed) {
diff --git a/apps/screenpipe-app-tauri/components/chat-sidebar.tsx b/apps/screenpipe-app-tauri/components/chat-sidebar.tsx
index 1cac5452a..2f656e141 100644
--- a/apps/screenpipe-app-tauri/components/chat-sidebar.tsx
+++ b/apps/screenpipe-app-tauri/components/chat-sidebar.tsx
@@ -270,6 +270,25 @@ interface ChatRowProps {
onTogglePin: (e: React.MouseEvent, id: string) => Promise<void> | void;
}
+/**
+ * One chat row.
+ *
+ * Outer element is a div role=button (NOT a real <button>) so the inline
+ * pin/close actions can be real <button>s without nesting — nested
+ * <button>s are invalid HTML and broke click handling on the inner ones.
+ * (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)
+ *
+ * Animation is a custom ~1.4s ping that's slower + subtler than Tailwind's
+ * default — minimal, not a distraction in your peripheral vision.
+ */
function ChatRow({
session,
isCurrent,
@@ -282,11 +301,20 @@ function ChatRow({
session.status === "thinking" ||
session.status === "tool";
const isError = session.status === "error";
+ const isUnread = session.unread && !isCurrent;
return (
- <button
+ <div
+ role="button"
+ tabIndex={0}
onClick={() => onSelect(session.id)}
+ onKeyDown={(e) => {
+ if (e.key === "Enter" || e.key === " ") {
+ e.preventDefault();
+ onSelect(session.id);
+ }
+ }}
className={cn(
- "group relative flex flex-col items-stretch text-left px-3 py-1 mx-1 rounded-md",
+ "group relative flex flex-col items-stretch text-left px-2 py-1 mx-1 rounded-md cursor-pointer select-none",
"transition-colors",
isCurrent
? "bg-muted/70 text-foreground"
@@ -295,15 +323,19 @@ function ChatRow({
data-testid={`chat-row-${session.id}`}
title={isError && session.lastError ? session.lastError : undefined}
>
- <div className="flex items-center gap-1.5 min-w-0">
+ <div className="flex items-center gap-2 min-w-0">
+ {/* Left-side status indicator. One slot, four states, no jitter
+ between them (same outer dimensions). */}
+ <StatusDot
+ isLive={isLive}
+ isError={isError}
+ isUnread={isUnread}
+ status={session.status}
+ />
<span
className={cn(
"truncate flex-1 text-xs",
- // Email-style: unread rows are bold + foreground; once
- // viewed, fade back to normal weight + muted color. The
- // store atomically clears unread when the user makes the
- // session current (see chat-store setCurrent).
- session.unread && !isCurrent
+ isUnread
? "font-semibold text-foreground"
: isCurrent
? "text-foreground"
@@ -312,25 +344,19 @@ function ChatRow({
>
{session.title || "untitled"}
</span>
- {isLive && (
- <span
- className="h-1.5 w-1.5 rounded-full bg-orange-500 animate-pulse shrink-0"
- title={session.status}
- />
- )}
- {isError && (
- <AlertCircle
- className="h-3 w-3 text-red-500 shrink-0"
- aria-label={session.lastError || "error"}
- />
- )}
- {/* hover-only actions */}
- <span className="hidden group-hover:inline-flex items-center gap-1 shrink-0">
- <span
- role="button"
- onClick={(e) => onTogglePin(e, session.id)}
+ {/* hover-only actions — REAL <button>s now (was <span role=button>
+ inside the outer <button>, which is invalid nested-button HTML
+ and made the X click silently no-op on close). */}
+ <span className="hidden group-hover:inline-flex items-center gap-0.5 shrink-0">
+ <button
+ type="button"
+ onClick={(e) => {
+ e.stopPropagation();
+ void onTogglePin(e, session.id);
+ }}
className="p-0.5 rounded hover:bg-muted"
title={session.pinned ? "unpin" : "pin"}
+ aria-label={session.pinned ? "unpin" : "pin"}
>
<Pin
className={cn(
@@ -340,21 +366,25 @@ function ChatRow({
: "text-muted-foreground"
)}
/>
- </span>
- <span
- role="button"
- onClick={(e) => onClose(e, session.id)}
+ </button>
+ <button
+ type="button"
+ onClick={(e) => {
+ e.stopPropagation();
+ void onClose(e, session.id);
+ }}
className="p-0.5 rounded hover:bg-muted text-muted-foreground"
title="close"
+ aria-label="close"
>
<X className="h-3 w-3" />
- </span>
+ </button>
</span>
</div>
{session.preview && (
<div
className={cn(
- "text-[10px] truncate mt-0.5",
+ "text-[10px] truncate mt-0.5 ml-4",
isError
? "text-red-500/80"
: isLive
@@ -365,6 +395,57 @@ function ChatRow({
{session.preview}
</div>
)}
- </button>
+ </div>
+ );
+}
+
+/** Status indicator dot — 8px hit-target, 6px visual, single-slot so the
+ * row layout doesn't shift between states. */
+function StatusDot({
+ isLive,
+ isError,
+ isUnread,
+ status,
+}: {
+ isLive: boolean;
+ isError: boolean;
+ isUnread: boolean;
+ status: string;
+}) {
+ if (isError) {
+ return (
+ <AlertCircle
+ className="h-3 w-3 text-red-500 shrink-0"
+ aria-label="error"
+ />
+ );
+ }
+ if (isLive) {
+ return (
+ <span
+ 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" />
+ </span>
+ );
+ }
+ if (isUnread) {
+ return (
+ <span
+ className="h-1.5 w-1.5 rounded-full bg-foreground shrink-0"
+ aria-label="unread"
+ />
+ );
+ }
+ // idle — hollow ring (matches Claude's pattern)
+ return (
+ <span
+ className="h-1.5 w-1.5 rounded-full border border-muted-foreground/40 shrink-0"
+ aria-hidden
+ />
);
}
diff --git a/apps/screenpipe-app-tauri/lib/stores/pi-event-router.ts b/apps/screenpipe-app-tauri/lib/stores/pi-event-router.ts
index 55d7c419c..05f3e3f7b 100644
--- a/apps/screenpipe-app-tauri/lib/stores/pi-event-router.ts
+++ b/apps/screenpipe-app-tauri/lib/stores/pi-event-router.ts
@@ -369,6 +369,19 @@ function applyEventToSessionContent(sid: string, payload: PiEventPayload) {
const existing = store.sessions[sid];
if (!existing) return; // upsert will fire on the next call
+ // CRITICAL: skip content writes for the session the panel is actively
+ // rendering. The chat panel's own pi_event handler in standalone-chat
+ // owns the message lifecycle for the current session (it creates the
+ // assistant placeholder, appends deltas, handles agent_end, persists
+ // to disk). If both this router AND the local handler write messages
+ // for the same session, you get DOUBLE messages — one from each
+ // writer — and the panel renders the same assistant reply twice.
+ // The router's job is exclusively to keep BACKGROUND sessions in
+ // sync; the panel handles foreground. On switch, loadConversation
+ // snapshots the panel's state to the store before the router takes
+ // over for what's now a background session.
+ if (store.currentId === sid) return;
+
const t = payload.type;
// Assistant message starts — create a new in-flight message shell
diff --git a/apps/screenpipe-app-tauri/src-tauri/Cargo.toml b/apps/screenpipe-app-tauri/src-tauri/Cargo.toml
index 759645cda..a18383034 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.61"
+version = "2.4.62"
description = "24/7 memory for your desktop. 100% local."
authors = ["you"]
license = ""