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
Rust agentsagiaiai-memoryaudio-recordingcomputer-visionhermeshermes-agentllmlocal-ailocal-firstmachine-learningmcpmultimodalopenclawprivacyrewindscreen-recordingspeech-to-textycombinator
feat: resizable shortcut overlay (small/medium/large)
Louis Beaumont1e1e1717136f
diff --git a/apps/screenpipe-app-tauri/components/settings/display-section.tsx b/apps/screenpipe-app-tauri/components/settings/display-section.tsxindex 742565c28..4ff0dcfaf 100644--- a/apps/screenpipe-app-tauri/components/settings/display-section.tsx+++ b/apps/screenpipe-app-tauri/components/settings/display-section.tsx@@ -8,7 +8,7 @@ import { useSettings } from "@/lib/hooks/use-settings";import { useTheme } from "@/components/theme-provider";import { Switch } from "@/components/ui/switch";import { Card, CardContent } from "@/components/ui/card";-import { Moon, Sun, Monitor, Layers, MessageSquare, PanelLeft } from "lucide-react";+import { Moon, Sun, Monitor, Layers, MessageSquare, PanelLeft, Maximize2 } from "lucide-react";import { usePlatform } from "@/lib/hooks/use-platform";import { HelpTooltip } from "@/components/ui/help-tooltip";import { useToast } from "@/components/ui/use-toast";@@ -246,6 +246,51 @@ export function DisplaySection() {</CardContent></Card>+ {settings?.showShortcutOverlay && (+ <Card className="border-border bg-card">+ <CardContent className="px-3 py-2.5">+ <div className="space-y-2.5">+ <div className="flex items-center space-x-2.5">+ <Maximize2 className="h-4 w-4 text-muted-foreground shrink-0" />+ <div>+ <h3 className="text-sm font-medium text-foreground">Overlay size</h3>+ <p className="text-xs text-muted-foreground">Size of the shortcut reminder overlay</p>+ </div>+ </div>+ <div className="flex gap-2 ml-[26px]">+ {([+ { value: "small", label: "Small" },+ { value: "medium", label: "Medium" },+ { value: "large", label: "Large" },+ ]).map((option) => {+ const isActive = (settings?.shortcutOverlaySize ?? "small") === option.value;+ return (+ <button+ key={option.value}+ onClick={async () => {+ handleSettingsChange({ shortcutOverlaySize: option.value });+ try {+ await invoke("hide_shortcut_reminder");+ await invoke("show_shortcut_reminder", { shortcut: settings.showScreenpipeShortcut });+ } catch {}+ }}+ type="button"+ className={`flex-1 px-2.5 py-1.5 rounded-md border-2 transition-all text-center cursor-pointer ${+ isActive+ ? "border-primary bg-primary/5"+ : "border-border hover:border-muted-foreground/30"+ }`}+ >+ <div className="font-medium text-xs text-foreground">{option.label}</div>+ </button>+ );+ })}+ </div>+ </div>+ </CardContent>+ </Card>+ )}+</div></div>);diff --git a/apps/screenpipe-app-tauri/src-tauri/src/commands.rs b/apps/screenpipe-app-tauri/src-tauri/src/commands.rsindex eab8bc8d5..a5a1b2b23 100644--- a/apps/screenpipe-app-tauri/src-tauri/src/commands.rs+++ b/apps/screenpipe-app-tauri/src-tauri/src/commands.rs@@ -4,7 +4,7 @@use crate::{native_notification, native_shortcut_reminder,- store::OnboardingStore,+ store::{OnboardingStore, SettingsStore},updates::is_enterprise_build,window::{RewindWindowId, ShowRewindWindow},};@@ -1023,7 +1023,15 @@ pub async fn show_shortcut_reminder(if native_shortcut_reminder::is_available() {info!("Using native SwiftUI shortcut reminder");- if native_shortcut_reminder::show(Some(&shortcut)) {+ let size = SettingsStore::get(&app_handle)+ .unwrap_or_default()+ .unwrap_or_default()+ .shortcut_overlay_size;+ let json = serde_json::json!({+ "overlay": &shortcut,+ "size": &size,+ }).to_string();+ if native_shortcut_reminder::show(Some(&json)) {return Ok(());}warn!("Native shortcut reminder failed, falling back to webview");diff --git a/apps/screenpipe-app-tauri/src-tauri/src/store.rs b/apps/screenpipe-app-tauri/src-tauri/src/store.rsindex c50f444eb..ab9c339b8 100644--- a/apps/screenpipe-app-tauri/src-tauri/src/store.rs+++ b/apps/screenpipe-app-tauri/src-tauri/src/store.rs@@ -188,6 +188,9 @@ pub struct SettingsStore {pub disable_ocr: bool,#[serde(rename = "showShortcutOverlay", default = "default_true")]pub show_shortcut_overlay: bool,+ /// Overlay size: "small" (default), "medium" (1.5x), "large" (2x)+ #[serde(rename = "shortcutOverlaySize", default = "default_overlay_size")]+ pub shortcut_overlay_size: String,/// Unique device ID for AI usage tracking (generated on first launch)#[serde(rename = "deviceId", default = "generate_device_id")]pub device_id: String,@@ -239,6 +242,10 @@ fn default_true() -> bool {true}+fn default_overlay_size() -> String {+ "small".to_string()+}+fn default_ui_theme() -> String {"system".to_string()}@@ -518,6 +525,7 @@ Rules:lock_vault_shortcut: "Super+Shift+L".to_string(),disable_ocr: false,show_shortcut_overlay: true,+ shortcut_overlay_size: "small".to_string(),device_id: uuid::Uuid::new_v4().to_string(),auto_update: true,auto_update_pipes: true,diff --git a/apps/screenpipe-app-tauri/src-tauri/swift/shortcut_reminder.swift b/apps/screenpipe-app-tauri/src-tauri/swift/shortcut_reminder.swiftindex df7c335bf..0f5e37135 100644--- a/apps/screenpipe-app-tauri/src-tauri/swift/shortcut_reminder.swift+++ b/apps/screenpipe-app-tauri/src-tauri/swift/shortcut_reminder.swift@@ -350,6 +350,7 @@ class ShortcutReminderController: NSObject {private var overlayShortcut = "⌘⌃S"private var chatShortcut = "⌘⌃L"private var searchShortcut = "⌘⌃K"+ private var scaleFactor: CGFloat = 1.0private var metrics = OverlayMetrics()@Published var isExpanded = falseprivate var wsTask: URLSessionWebSocketTask?@@ -360,10 +361,15 @@ class ShortcutReminderController: NSObject {func show(shortcuts: String?) {DispatchQueue.main.async { [self] in+ let prevScale = scaleFactorif let shortcuts = shortcuts {parseShortcuts(shortcuts)}- if panel == nil {+ if panel == nil || prevScale != scaleFactor {+ panel?.orderOut(nil)+ panel = nil+ hostingView = nil+ trackingView = nilcreatePanel()}updateContent()@@ -478,19 +484,28 @@ class ShortcutReminderController: NSObject {}private func parseShortcuts(_ json: String) {- // Simple parse — expects {"overlay":"⌘⌃S","chat":"⌘⌃L","search":"⌘⌃K"}+ // Simple parse — expects {"overlay":"⌘⌃S","chat":"⌘⌃L","search":"⌘⌃K","size":"small"}guard let data = json.data(using: .utf8),let dict = try? JSONDecoder().decode([String: String].self, from: data) else { return }if let s = dict["overlay"] { overlayShortcut = s }if let s = dict["chat"] { chatShortcut = s }if let s = dict["search"] { searchShortcut = s }+ if let size = dict["size"] {+ switch size {+ case "large": scaleFactor = 2.0+ case "medium": scaleFactor = 1.5+ default: scaleFactor = 1.0+ }+ }}private func createPanel() {// Start with expanded size — the content will be smaller but the panel// needs room so the hover area catches mouse events during animation+ let scaledW = kExpandedW * scaleFactor+ let scaledH = kExpandedH * scaleFactorlet p = NSPanel(- contentRect: NSRect(x: 0, y: 0, width: Int(kExpandedW), height: Int(kExpandedH)),+ contentRect: NSRect(x: 0, y: 0, width: Int(scaledW), height: Int(scaledH)),styleMask: [.nonactivatingPanel, .borderless],backing: .buffered,defer: false@@ -507,7 +522,7 @@ class ShortcutReminderController: NSObject {p.isReleasedWhenClosed = falsep.sharingType = .readOnly- let tracking = ReminderTrackingView(frame: NSRect(x: 0, y: 0, width: Int(kExpandedW), height: Int(kExpandedH)))+ let tracking = ReminderTrackingView(frame: NSRect(x: 0, y: 0, width: Int(scaledW), height: Int(scaledH)))tracking.autoresizingMask = [.width, .height]p.contentView = trackingself.trackingView = tracking@@ -521,8 +536,10 @@ class ShortcutReminderController: NSObject {for screen in NSScreen.screens {if NSMouseInRect(mouseLocation, screen.frame, false) {let visible = screen.visibleFrame- let x = screen.frame.origin.x + (screen.frame.size.width - kExpandedW) / 2- let y = visible.origin.y + visible.size.height - kExpandedH - 4+ let scaledW = kExpandedW * scaleFactor+ let scaledH = kExpandedH * scaleFactor+ let x = screen.frame.origin.x + (screen.frame.size.width - scaledW) / 2+ let y = visible.origin.y + visible.size.height - scaledH - 4panel.setFrameOrigin(NSPoint(x: x, y: y))break}@@ -532,6 +549,7 @@ class ShortcutReminderController: NSObject {private func updateContent() {guard let panel = panel else { return }let controller = self+ let scale = scaleFactorlet view = ShortcutReminderView(overlayShortcut: overlayShortcut,chatShortcut: chatShortcut,@@ -545,11 +563,12 @@ class ShortcutReminderController: NSObject {set: { controller.isExpanded = $0 }))+ let scaled = AnyView(view.scaleEffect(scale, anchor: .center))let contentView = panel.contentView!if let hosting = hostingView {- hosting.rootView = AnyView(view)+ hosting.rootView = scaled} else {- let hosting = NSHostingView(rootView: AnyView(view))+ let hosting = NSHostingView(rootView: scaled)hosting.frame = contentView.boundshosting.autoresizingMask = [.width, .height]contentView.addSubview(hosting)