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): default sidebar to screenpipe chats

Louis Beaumontab1577c5ccfe
diff --git a/apps/screenpipe-app-tauri/components/__tests__/chat-sidebar-focus.test.tsx b/apps/screenpipe-app-tauri/components/__tests__/chat-sidebar-focus.test.tsx
index 802bc9c72..e93e44ffe 100644
--- a/apps/screenpipe-app-tauri/components/__tests__/chat-sidebar-focus.test.tsx
+++ b/apps/screenpipe-app-tauri/components/__tests__/chat-sidebar-focus.test.tsx
@@ -7,6 +7,7 @@ import { afterEach, describe, expect, it, vi } from "vitest";
import {
filterRecentsBySource,
handleMenuShortcut,
+ hiddenRecentSourcesFromStoredValue,
isMachineOnlyImportedConversation,
sortRecents,
SidebarChatRow,
@@ -120,6 +121,17 @@ describe("SidebarChatRow current conversation", () => {
});
describe("Recents provider filtering", () => {
+ it("shows only screenpipe chats until source preferences are saved", () => {
+ expect([...hiddenRecentSourcesFromStoredValue(null)]).toEqual([
+ "codex",
+ "claude-code",
+ ]);
+ });
+
+ it("preserves an explicit preference to show external chats", () => {
+ expect([...hiddenRecentSourcesFromStoredValue("[]")]).toEqual([]);
+ });
+
it("can independently hide Codex, Claude, and screenpipe chats", () => {
const sessions: SessionRecord[] = [
baseSession,
diff --git a/apps/screenpipe-app-tauri/components/chat-sidebar.tsx b/apps/screenpipe-app-tauri/components/chat-sidebar.tsx
index 7d2bdb2cb..404f9860d 100644
--- a/apps/screenpipe-app-tauri/components/chat-sidebar.tsx
+++ b/apps/screenpipe-app-tauri/components/chat-sidebar.tsx
@@ -246,9 +246,13 @@ function readRecentSort(): RecentSort {
}
}
-function readHiddenRecentSources(): Set<RecentSource> {
+export function hiddenRecentSourcesFromStoredValue(
+ stored: string | null,
+): Set<RecentSource> {
+ if (stored === null) return new Set(["codex", "claude-code"]);
+
try {
- const parsed = JSON.parse(localStorage.getItem(RECENTS_SOURCE_FILTER_KEY) ?? "[]");
+ const parsed = JSON.parse(stored);
return new Set(
Array.isArray(parsed)
? parsed.filter((source): source is RecentSource =>
@@ -257,7 +261,17 @@ function readHiddenRecentSources(): Set<RecentSource> {
: [],
);
} catch {
- return new Set();
+ return new Set(["codex", "claude-code"]);
+ }
+}
+
+function readHiddenRecentSources(): Set<RecentSource> {
+ try {
+ return hiddenRecentSourcesFromStoredValue(
+ localStorage.getItem(RECENTS_SOURCE_FILTER_KEY),
+ );
+ } catch {
+ return hiddenRecentSourcesFromStoredValue(null);
}
}