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: add missing useCallback import, move history button to sidebar only

Louis Beaumonte4fc1f3bfb2c
diff --git a/apps/screenpipe-app-tauri/components/hooks/use-chat-conversations.ts b/apps/screenpipe-app-tauri/components/hooks/use-chat-conversations.ts
index 42241172d..367e845c7 100644
--- a/apps/screenpipe-app-tauri/components/hooks/use-chat-conversations.ts
+++ b/apps/screenpipe-app-tauri/components/hooks/use-chat-conversations.ts
@@ -7,6 +7,7 @@ import {
useRef,
useEffect,
useMemo,
+ useCallback,
type Dispatch,
type SetStateAction,
type RefObject,
@@ -95,7 +96,16 @@ export function useChatConversations(opts: UseChatConversationsOpts) {
settings,
} = opts;
- const [showHistory, setShowHistory] = useState(false);
+ const [showHistory, setShowHistoryRaw] = useState(() => {
+ try { return localStorage.getItem("screenpipe:chat-history-open") === "true"; } catch { return false; }
+ });
+ const setShowHistory = useCallback((v: boolean | ((prev: boolean) => boolean)) => {
+ setShowHistoryRaw((prev) => {
+ const next = typeof v === "function" ? v(prev) : v;
+ try { localStorage.setItem("screenpipe:chat-history-open", String(next)); } catch {}
+ return next;
+ });
+ }, []);
const [historySearch, setHistorySearch] = useState("");
const [fileConversations, setFileConversations] = useState<ChatConversation[]>([]);
diff --git a/apps/screenpipe-app-tauri/components/standalone-chat.tsx b/apps/screenpipe-app-tauri/components/standalone-chat.tsx
index d74d4a945..6437355e0 100644
--- a/apps/screenpipe-app-tauri/components/standalone-chat.tsx
+++ b/apps/screenpipe-app-tauri/components/standalone-chat.tsx
@@ -2976,24 +2976,6 @@ export function StandaloneChat({ className }: { className?: string } = {}) {
<h2 className="font-semibold text-sm tracking-tight">Pipe AI</h2>
<p className="text-[10px] text-muted-foreground font-mono uppercase tracking-wider">Screen Activity Assistant</p>
</div>
- <Button
- variant={showHistory ? "secondary" : "ghost"}
- size="sm"
- onMouseDown={(e) => e.stopPropagation()}
- onClick={async (e) => {
- e.stopPropagation();
- if (!showHistory) {
- // Refresh settings from store to ensure we have latest conversations
- await reloadStore();
- }
- setShowHistory(!showHistory);
- }}
- className="relative z-10 h-7 px-2 gap-1 text-xs"
- title="Chat history"
- >
- <History size={14} />
- <span className="hidden sm:inline">History</span>
- </Button>
<Button
variant="default"
size="sm"