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(macos): enable hover on shortcut reminder without focus

Louis Beaumont94ec9ea8aa64
diff --git a/screenpipe-app-tauri/app/shortcut-reminder/page.tsx b/screenpipe-app-tauri/app/shortcut-reminder/page.tsx
index b0d606bc7..c4f0e67b6 100644
--- a/screenpipe-app-tauri/app/shortcut-reminder/page.tsx
+++ b/screenpipe-app-tauri/app/shortcut-reminder/page.tsx
@@ -5,6 +5,7 @@ import { listen } from "@tauri-apps/api/event";
import { getCurrentWindow } from "@tauri-apps/api/window";
import posthog from "posthog-js";
import { usePlatform } from "@/lib/hooks/use-platform";
+import { getStore } from "@/lib/hooks/use-settings";
export default function ShortcutReminderPage() {
const { isMac, isLoading } = usePlatform();
@@ -12,14 +13,31 @@ export default function ShortcutReminderPage() {
const [rawShortcut, setRawShortcut] = useState<string | null>(null);
const [hovered, setHovered] = useState(false);
- // Set default shortcut once platform is detected
+ // Load shortcut from store on mount
useEffect(() => {
- if (!isLoading && shortcut === null) {
- setShortcut(isMac ? "⌘⌃S" : "Win+Ctrl+S");
+ const loadShortcutFromStore = async () => {
+ try {
+ const store = await getStore();
+ const settings = await store.get<{ showScreenpipeShortcut?: string }>("settings");
+ if (settings?.showScreenpipeShortcut) {
+ setRawShortcut(settings.showScreenpipeShortcut);
+ }
+ } catch (e) {
+ console.error("Failed to load shortcut from store:", e);
+ }
+ };
+ loadShortcutFromStore();
+ }, []);
+
+ // Set default shortcut once platform is detected (fallback if store fails)
+ useEffect(() => {
+ if (!isLoading && shortcut === null && rawShortcut === null) {
+ // Default matches Super+Alt+S from settings
+ setShortcut(isMac ? "⌘⌥S" : "Win+Alt+S");
}
- }, [isMac, isLoading, shortcut]);
+ }, [isMac, isLoading, shortcut, rawShortcut]);
- // Re-format shortcut when platform is detected
+ // Re-format shortcut when platform is detected or rawShortcut changes
useEffect(() => {
if (!isLoading && rawShortcut) {
setShortcut(formatShortcut(rawShortcut, isMac));
@@ -105,7 +123,8 @@ export default function ShortcutReminderPage() {
}
function formatShortcut(shortcut: string, isMac: boolean): string {
- if (!shortcut) return isMac ? "⌘⌃S" : "Win+Ctrl+S";
+ // Default matches Super+Alt+S from settings
+ if (!shortcut) return isMac ? "⌘⌥S" : "Win+Alt+S";
if (isMac) {
return shortcut
.replace(/Super|Command|Cmd/gi, "⌘")
diff --git a/screenpipe-app-tauri/components/screenpipe-chat/index.tsx b/screenpipe-app-tauri/components/screenpipe-chat/index.tsx
index 7c5f78ab0..fb2d2b62d 100644
--- a/screenpipe-app-tauri/components/screenpipe-chat/index.tsx
+++ b/screenpipe-app-tauri/components/screenpipe-chat/index.tsx
@@ -309,7 +309,7 @@ Current time: ${new Date().toISOString()}`,
<Button
onClick={() => setIsOpen(true)}
className={cn(
- "fixed bottom-4 right-4 h-14 w-14 rounded-full shadow-lg",
+ "fixed bottom-4 right-4 h-14 w-14 rounded-full shadow-lg z-50",
className
)}
size="icon"
@@ -322,7 +322,7 @@ Current time: ${new Date().toISOString()}`,
return (
<Card
className={cn(
- "fixed bottom-4 right-4 flex flex-col shadow-2xl border-border bg-background",
+ "fixed bottom-4 right-4 flex flex-col shadow-2xl border-border bg-background z-50",
isMinimized ? "w-80 h-14" : "w-96 h-[500px]",
className
)}
diff --git a/screenpipe-app-tauri/src-tauri/Cargo.lock b/screenpipe-app-tauri/src-tauri/Cargo.lock
index 1660b8f9b..0bfd72bd9 100755
--- a/screenpipe-app-tauri/src-tauri/Cargo.lock
+++ b/screenpipe-app-tauri/src-tauri/Cargo.lock
@@ -5629,7 +5629,7 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
[[package]]
name = "screenpipe-app"
-version = "2.0.23"
+version = "2.0.24"
dependencies = [
"anyhow",
"async-stream",
diff --git a/screenpipe-app-tauri/src-tauri/src/commands.rs b/screenpipe-app-tauri/src-tauri/src/commands.rs
index d9bd1f378..4c15eb70f 100644
--- a/screenpipe-app-tauri/src-tauri/src/commands.rs
+++ b/screenpipe-app-tauri/src-tauri/src/commands.rs
@@ -429,6 +429,8 @@ pub async fn show_shortcut_reminder(
// Use to_panel() on window_clone directly instead of get_webview_panel
// This avoids race conditions with panel registration
if let Ok(panel) = window_clone.to_panel() {
+ use tauri_nspanel::objc::{msg_send, sel, sel_impl};
+
// Level 1001 = above CGShieldingWindowLevel, shows over fullscreen
panel.set_level(1001);
panel.set_style_mask(0);
@@ -438,6 +440,14 @@ pub async fn show_shortcut_reminder(
NSWindowCollectionBehavior::NSWindowCollectionBehaviorFullScreenAuxiliary |
NSWindowCollectionBehavior::NSWindowCollectionBehaviorStationary
);
+ // Enable hover/mouse events without requiring focus
+ unsafe {
+ use std::ops::Deref;
+ let panel_ptr = panel.deref() as *const _ as *mut objc::runtime::Object;
+ let _: () = msg_send![panel_ptr, setFloatingPanel: true];
+ let _: () = msg_send![panel_ptr, setAcceptsMouseMovedEvents: true];
+ let _: () = msg_send![panel_ptr, setBecomesKeyOnlyIfNeeded: true];
+ }
// Order front regardless to show above fullscreen
panel.order_front_regardless();
info!("Panel configured for fullscreen support");