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(shortcut-reminder): remove tooltip and fix platform detection

Louis Beaumont9818a61b6085
diff --git a/screenpipe-app-tauri/app/shortcut-reminder/layout.tsx b/screenpipe-app-tauri/app/shortcut-reminder/layout.tsx
index c6ed246ee..2315fd115 100644
--- a/screenpipe-app-tauri/app/shortcut-reminder/layout.tsx
+++ b/screenpipe-app-tauri/app/shortcut-reminder/layout.tsx
@@ -17,6 +17,14 @@ export default function ShortcutReminderLayout({
padding: 0;
overflow: hidden;
}
+ /* Suppress all tooltips */
+ [title] {
+ pointer-events: auto;
+ }
+ [data-tauri-drag-region] {
+ -webkit-user-select: none;
+ user-select: none;
+ }
`}</style>
</head>
<body style={{ background: "transparent", margin: 0, padding: 0 }}>
diff --git a/screenpipe-app-tauri/app/shortcut-reminder/page.tsx b/screenpipe-app-tauri/app/shortcut-reminder/page.tsx
index ff6697d4a..b0d606bc7 100644
--- a/screenpipe-app-tauri/app/shortcut-reminder/page.tsx
+++ b/screenpipe-app-tauri/app/shortcut-reminder/page.tsx
@@ -1,18 +1,37 @@
"use client";
-import { useEffect, useState } from "react";
+import { useEffect, useState, useCallback } from "react";
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";
export default function ShortcutReminderPage() {
- const { isMac } = usePlatform();
- const [shortcut, setShortcut] = useState(isMac ? "⌘⌃S" : "Win+Ctrl+S");
+ const { isMac, isLoading } = usePlatform();
+ const [shortcut, setShortcut] = useState<string | null>(null);
+ const [rawShortcut, setRawShortcut] = useState<string | null>(null);
const [hovered, setHovered] = useState(false);
+ // Set default shortcut once platform is detected
+ useEffect(() => {
+ if (!isLoading && shortcut === null) {
+ setShortcut(isMac ? "⌘⌃S" : "Win+Ctrl+S");
+ }
+ }, [isMac, isLoading, shortcut]);
+
+ // Re-format shortcut when platform is detected
+ useEffect(() => {
+ if (!isLoading && rawShortcut) {
+ setShortcut(formatShortcut(rawShortcut, isMac));
+ }
+ }, [isMac, isLoading, rawShortcut]);
+
useEffect(() => {
const unlistenShortcut = listen<string>("shortcut-reminder-update", (event) => {
- setShortcut(formatShortcut(event.payload, isMac));
+ setRawShortcut(event.payload);
+ if (!isLoading) {
+ setShortcut(formatShortcut(event.payload, isMac));
+ }
});
posthog.capture("shortcut_reminder_shown");
@@ -20,7 +39,18 @@ export default function ShortcutReminderPage() {
return () => {
unlistenShortcut.then((fn) => fn());
};
- }, [isMac]);
+ }, [isMac, isLoading]);
+
+ // Manual drag handling to avoid Tauri tooltip
+ const handleMouseDown = useCallback(async (e: React.MouseEvent) => {
+ if (e.button === 0) {
+ try {
+ await getCurrentWindow().startDragging();
+ } catch {
+ // Ignore drag errors
+ }
+ }
+ }, []);
return (
<div
@@ -28,41 +58,37 @@ export default function ShortcutReminderPage() {
style={{ background: "transparent" }}
>
<div
- data-tauri-drag-region
+ onMouseDown={handleMouseDown}
onMouseEnter={() => setHovered(true)}
onMouseLeave={() => setHovered(false)}
className="select-none"
style={{ cursor: "grab" }}
>
- <div className="relative" data-tauri-drag-region>
+ <div className="relative">
{/* Subtle glow */}
<div
- data-tauri-drag-region
className={`absolute inset-0 bg-pink-500/20 rounded-full blur-md transition-opacity duration-300 ${hovered ? 'opacity-100' : 'opacity-40'}`}
/>
{/* Main pill */}
<div
- data-tauri-drag-region
className="relative flex items-center gap-1.5 py-1 px-2.5 bg-black/80 backdrop-blur-xl rounded-full border border-white/10 shadow-xl"
>
{/* Pulsing dot */}
- <span className="relative flex h-1 w-1 flex-shrink-0" data-tauri-drag-region>
+ <span className="relative flex h-1 w-1 flex-shrink-0">
<span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-pink-400 opacity-75" />
<span className="relative inline-flex rounded-full h-1 w-1 bg-pink-500" />
</span>
{/* Shortcut */}
<span
- data-tauri-drag-region
className="font-mono text-[10px] font-semibold text-white/90 tracking-wide"
>
- {shortcut}
+ {shortcut ?? "..."}
</span>
{/* Expanded text on hover */}
<span
- data-tauri-drag-region
className={`
text-[9px] text-white/50 whitespace-nowrap overflow-hidden
transition-all duration-300 ease-out