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): move history icon to top-left of chat header

Louis Beaumont77dd2e768683
diff --git a/apps/screenpipe-app-tauri/app/home/page.tsx b/apps/screenpipe-app-tauri/app/home/page.tsx
index 789106fc0..9d0873dd6 100644
--- a/apps/screenpipe-app-tauri/app/home/page.tsx
+++ b/apps/screenpipe-app-tauri/app/home/page.tsx
@@ -52,7 +52,7 @@ import { MemoriesSection } from "@/components/settings/memories-section";
import { NotificationsSettings } from "@/components/settings/notifications-settings";
import { UsageSection } from "@/components/settings/usage-section";
import { SpeakersSection } from "@/components/settings/speakers-section";
-import { HomeStatsBadge } from "@/components/home-stats-badge";
+// HomeStatsBadge is rendered inside SummaryCards (chat empty state)
import { StandaloneChat } from "@/components/standalone-chat";
import Timeline from "@/components/rewind/timeline";
import { useQueryState } from "nuqs";
@@ -565,48 +565,6 @@ function SettingsPageContent() {
})}
</div>
- {/* Chat history toggle — only visible when on home (chat) */}
- {activeSection === "home" && !settingsModalOpen && (
- <div className="mt-1">
- {(() => {
- const btn = (
- <button
- onClick={() => {
- setActiveSection("home");
- setSettingsModalOpen(false);
- emit("toggle-chat-history", {});
- }}
- className={cn(
- "w-full flex items-center px-3 py-2 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",
- )}
- >
- <History className={cn("h-4 w-4 flex-shrink-0 transition-colors", isTranslucent ? "" : "text-muted-foreground group-hover:text-foreground")} />
- {!sidebarCollapsed && <span className="text-sm font-medium">History</span>}
- </button>
- );
- if (sidebarCollapsed) {
- return (
- <Tooltip>
- <TooltipTrigger asChild>{btn}</TooltipTrigger>
- <TooltipContent side="right" className="text-xs">History</TooltipContent>
- </Tooltip>
- );
- }
- return btn;
- })()}
- </div>
- )}
-
- {/* Stats badge */}
- {!sidebarCollapsed && (
- <div className="px-2 py-1.5">
- <HomeStatsBadge />
- </div>
- )}
{/* Spacer */}
<div className="flex-1" />
diff --git a/apps/screenpipe-app-tauri/components/standalone-chat.tsx b/apps/screenpipe-app-tauri/components/standalone-chat.tsx
index 6437355e0..a4cb389e5 100644
--- a/apps/screenpipe-app-tauri/components/standalone-chat.tsx
+++ b/apps/screenpipe-app-tauri/components/standalone-chat.tsx
@@ -1191,17 +1191,6 @@ export function StandaloneChat({ className }: { className?: string } = {}) {
return () => { unlisten.then((fn) => fn()); };
}, []);
- // Listen for toggle-chat-history event from sidebar
- useEffect(() => {
- const unlisten = listen("toggle-chat-history", async () => {
- if (!showHistory) {
- await reloadStore();
- }
- setShowHistory((prev) => !prev);
- });
- return () => { unlisten.then((fn) => fn()); };
- }, [showHistory, reloadStore, setShowHistory]);
-
// Guard against duplicate chat-prefill processing. The listener below
// re-subscribes when piInfo changes; during the brief overlap window
// (async unlisten hasn't resolved yet) both old and new listeners can
@@ -2969,6 +2958,22 @@ export function StandaloneChat({ className }: { className?: string } = {}) {
{!isMac && !className && (
<div className="absolute top-0 left-0 w-8 h-8 border-l-2 border-t-2 border-foreground/10 rounded-tl-lg" />
)}
+ <Button
+ variant={showHistory ? "secondary" : "ghost"}
+ size="icon"
+ onMouseDown={(e) => e.stopPropagation()}
+ onClick={async (e) => {
+ e.stopPropagation();
+ if (!showHistory) {
+ await reloadStore();
+ }
+ setShowHistory(!showHistory);
+ }}
+ className="relative z-10 h-7 w-7"
+ title="Chat history"
+ >
+ <History size={14} />
+ </Button>
<div className="relative z-10 p-1.5 rounded-lg bg-foreground/5 border border-border/50">
<PipeAIIcon size={18} animated={false} className="text-foreground" />
</div>