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

feat(updates): banner-driven restart, auto-update off by default

Louis Beaumontcf1455dbcafc
diff --git a/apps/screenpipe-app-tauri/app/home/page.tsx b/apps/screenpipe-app-tauri/app/home/page.tsx
index a65c7a1cf..ae0e0f859 100644
--- a/apps/screenpipe-app-tauri/app/home/page.tsx
+++ b/apps/screenpipe-app-tauri/app/home/page.tsx
@@ -30,6 +30,7 @@ import { useChatStore, type SessionStatus } from "@/lib/stores/chat-store";
import { useOverlayData } from "@/app/shortcut-reminder/use-overlay-data";
import { cn } from "@/lib/utils";
import { AppSidebar, SidebarProvider, useSidebarContext } from "@/components/app-sidebar";
+import { UpdateBanner, useUpdateListener } from "@/components/update-banner";
import { usePlatform } from "@/lib/hooks/use-platform";
import { useIsFullscreen } from "@/lib/hooks/use-is-fullscreen";
import { FeedbackSection } from "@/components/settings/feedback-section";
@@ -87,6 +88,7 @@ const SETTINGS_SECTIONS = new Set<string>([
]);
function HomeContent() {
+ useUpdateListener();
const router = useRouter();
const { isMac } = usePlatform();
// In fullscreen, macOS hides the traffic lights — collapse the
@@ -1178,6 +1180,8 @@ function HomeContent() {
<div className="flex-1" />
)}
+ {!sidebarCollapsed && <UpdateBanner variant="sidebar" className="mb-2" />}
+
{/* Bottom items */}
<div className={cn("space-y-0.5 border-t pt-2", isTranslucent ? "vibrant-sidebar-border" : "border-border")}>
{/* Team link — hide invite promo in enterprise (unless team exists) */}
diff --git a/apps/screenpipe-app-tauri/components/settings/general-settings.tsx b/apps/screenpipe-app-tauri/components/settings/general-settings.tsx
index 94967f4a1..13cb13719 100644
--- a/apps/screenpipe-app-tauri/components/settings/general-settings.tsx
+++ b/apps/screenpipe-app-tauri/components/settings/general-settings.tsx
@@ -115,12 +115,12 @@ export default function GeneralSettings() {
<RefreshCw className="h-4 w-4 text-muted-foreground shrink-0" />
<div>
<h3 className="text-sm font-medium text-foreground">Auto-update</h3>
- <p className="text-xs text-muted-foreground">Install updates automatically</p>
+ <p className="text-xs text-muted-foreground">Restart automatically when an update is downloaded. Off: a "restart to update" banner appears instead.</p>
</div>
</div>
<Switch
id="auto-update-toggle"
- checked={settings?.autoUpdate ?? true}
+ checked={settings?.autoUpdate ?? false}
onCheckedChange={(checked) =>
handleSettingsChange({ autoUpdate: checked })
}
diff --git a/apps/screenpipe-app-tauri/components/update-banner.tsx b/apps/screenpipe-app-tauri/components/update-banner.tsx
index 760dc296d..045521c3f 100644
--- a/apps/screenpipe-app-tauri/components/update-banner.tsx
+++ b/apps/screenpipe-app-tauri/components/update-banner.tsx
@@ -67,9 +67,11 @@ export const useUpdateBanner = create<UpdateBannerState>((set) => ({
interface UpdateBannerProps {
className?: string;
compact?: boolean;
+ /** "sidebar" renders a vertical card sized for the app sidebar. */
+ variant?: "default" | "sidebar";
}
-export function UpdateBanner({ className, compact = false }: UpdateBannerProps) {
+export function UpdateBanner({ className, compact = false, variant = "default" }: UpdateBannerProps) {
const isEnterprise = useIsEnterpriseBuild();
const { isVisible, updateInfo, isInstalling, isDownloading, downloadProgress, setIsVisible, setIsInstalling, pendingUpdate, authRequired, setAuthRequired } = useUpdateBanner();
const { toast } = useToast();
@@ -219,6 +221,48 @@ export function UpdateBanner({ className, compact = false }: UpdateBannerProps)
if (!isVisible || !updateInfo) return null;
+ if (variant === "sidebar") {
+ if (isDownloading) {
+ const pct = downloadProgress?.percent ?? 0;
+ return (
+ <div className={cn(
+ "rounded-lg border border-border bg-card/50 px-2.5 py-2 text-xs",
+ className,
+ )}>
+ <div className="flex items-center gap-2 mb-1.5">
+ <Sparkles className="h-3.5 w-3.5 text-primary animate-pulse shrink-0" />
+ <span className="text-muted-foreground truncate">Downloading v{updateInfo.version}…</span>
+ </div>
+ <div className="h-1 bg-muted rounded-full overflow-hidden">
+ <div
+ className="h-full bg-primary rounded-full transition-all duration-300"
+ style={{ width: `${pct}%` }}
+ />
+ </div>
+ </div>
+ );
+ }
+ return (
+ <button
+ type="button"
+ onClick={handleUpdate}
+ disabled={isInstalling}
+ className={cn(
+ "w-full flex items-center gap-2.5 px-2.5 py-2 rounded-lg border border-border bg-card/50 hover:bg-card transition-colors text-left disabled:opacity-60",
+ className,
+ )}
+ >
+ <Sparkles className="h-4 w-4 text-primary shrink-0" />
+ <div className="flex-1 min-w-0">
+ <div className="text-xs font-medium text-foreground truncate">
+ {isInstalling ? "Restarting…" : "Restart to update"}
+ </div>
+ <div className="text-[10px] text-muted-foreground truncate">v{updateInfo.version}</div>
+ </div>
+ </button>
+ );
+ }
+
if (compact) {
return (
<div className={cn(
diff --git a/apps/screenpipe-app-tauri/src-tauri/Cargo.lock b/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
index a203aa72d..19483046f 100644
--- a/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
+++ b/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
@@ -10580,7 +10580,7 @@ dependencies = [
[[package]]
name = "screenpipe-app"
-version = "2.4.249"
+version = "2.4.250"
dependencies = [
"aes",
"aes-gcm",
diff --git a/apps/screenpipe-app-tauri/src-tauri/src/store.rs b/apps/screenpipe-app-tauri/src-tauri/src/store.rs
index 418ceffa0..dabe62995 100644
--- a/apps/screenpipe-app-tauri/src-tauri/src/store.rs
+++ b/apps/screenpipe-app-tauri/src-tauri/src/store.rs
@@ -1021,7 +1021,7 @@ Rules:
show_shortcut_overlay: true,
shortcut_overlay_size: "small".to_string(),
device_id: uuid::Uuid::new_v4().to_string(),
- auto_update: true,
+ auto_update: false,
auto_update_pipes: true,
enhanced_ai: false,
#[cfg(target_os = "macos")]
diff --git a/apps/screenpipe-app-tauri/src-tauri/src/updates.rs b/apps/screenpipe-app-tauri/src-tauri/src/updates.rs
index 442a893d9..aef83cbac 100644
--- a/apps/screenpipe-app-tauri/src-tauri/src/updates.rs
+++ b/apps/screenpipe-app-tauri/src-tauri/src/updates.rs
@@ -255,7 +255,7 @@ impl UpdatesManager {
.ok()
.flatten()
.map(|s| s.auto_update)
- .unwrap_or(true);
+ .unwrap_or(false);
if let Some(ref item) = self.update_menu_item {
item.set_enabled(true)?;
@@ -292,51 +292,9 @@ impl UpdatesManager {
});
}
- let should_download_now = if show_dialog {
- let (tx, rx) = oneshot::channel();
- let update_dialog = self
- .app
- .dialog()
- .message("update available")
- .title("screenpipe update")
- .buttons(MessageDialogButtons::OkCancelCustom(
- "update now".to_string(),
- "later".to_string(),
- ));
-
- update_dialog.show(move |answer| {
- let _ = tx.send(answer);
- });
-
- rx.await?
- } else {
- auto_update
- };
-
- if !should_download_now {
- let app_notif = self.app.clone();
- let version_str = update.version.clone();
- // std::thread::spawn (not spawn_blocking) to escape tokio runtime context entirely.
- // notify_rust on Linux internally calls block_on for D-Bus, which panics
- // if any tokio runtime exists on the current thread — even blocking threads.
- std::thread::spawn(move || {
- if let Err(e) = app_notif
- .notification()
- .builder()
- .title("screenpipe update available")
- .body(format!(
- "v{} is ready — update when you choose",
- version_str
- ))
- .show()
- {
- error!("failed to send update notification: {}", e);
- }
- });
- return Result::Ok(true);
- }
-
- // Emit "update-downloading" only when we are actually downloading.
+ // Always download in the background. auto_update only controls
+ // whether we restart automatically after — the banner is the user's
+ // "restart now" trigger when auto_update is off.
let download_info = serde_json::json!({
"version": update.version,
"body": update.body.clone().unwrap_or_default(),
@@ -434,6 +392,11 @@ impl UpdatesManager {
}
}
+ // Stash the current version so the "what's new" notification can fire
+ // after restart — needs to happen here because banner-driven restarts
+ // bypass the auto_update path below.
+ save_pre_update_version(&self.app, update.body.clone());
+
// Emit event to frontend for in-app banner (visible if window is open)
let update_info = serde_json::json!({
"version": update.version,
@@ -445,10 +408,9 @@ impl UpdatesManager {
let app_notif = self.app.clone();
let version_str = update.version.clone();
- let restarting_automatically = auto_update && !show_dialog;
std::thread::spawn(move || {
let notification = app_notif.notification().builder();
- let result = if restarting_automatically {
+ let result = if auto_update {
notification
.title("screenpipe updating")
.body(format!("v{} downloaded — restarting now", version_str))
@@ -464,19 +426,7 @@ impl UpdatesManager {
}
});
- if show_dialog {
- save_pre_update_version(&self.app, update.body.clone());
-
- #[cfg(not(target_os = "windows"))]
- {
- if let Err(err) =
- stop_screenpipe(self.app.state::<RecordingState>(), self.app.clone()).await
- {
- error!("Failed to stop recording: {}", err);
- }
- }
- self.update_screenpipe();
- } else if auto_update && *self.update_installed.lock().await {
+ if auto_update && *self.update_installed.lock().await {
info!(
"auto-update enabled, restarting to apply update v{}",
update.version
@@ -488,7 +438,6 @@ impl UpdatesManager {
"delay_secs": 30,
}),
);
- save_pre_update_version(&self.app, update.body.clone());
tokio::time::sleep(Duration::from_secs(30)).await;
if let Err(err) =
stop_screenpipe(self.app.state::<RecordingState>(), self.app.clone()).await
@@ -526,10 +475,6 @@ impl UpdatesManager {
*self.update_installed.lock().await
}
- pub fn update_screenpipe(&self) -> Option<Error> {
- self.app.restart();
- }
-
/// Show dialog explaining auto-updates are not available for source builds
async fn show_source_build_dialog(&self) -> Result<(), Box<dyn std::error::Error>> {
let (tx, rx) = oneshot::channel();