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: improve shortcut display UX and use chat window for AI button

Louis Beaumonte791e5a8addd
diff --git a/screenpipe-app-tauri/app/shortcut-reminder/page.tsx b/screenpipe-app-tauri/app/shortcut-reminder/page.tsx
index 7dcc42764..a7675a8b7 100644
--- a/screenpipe-app-tauri/app/shortcut-reminder/page.tsx
+++ b/screenpipe-app-tauri/app/shortcut-reminder/page.tsx
@@ -39,10 +39,10 @@ export default function ShortcutReminderPage() {
// Set default shortcuts once platform is detected (fallback if store fails)
useEffect(() => {
if (!isLoading && overlayShortcut === null) {
- setOverlayShortcut(isMac ? "⌃⌘S" : "Alt+S");
+ setOverlayShortcut(isMac ? "⌘⌃S" : "Alt+S");
}
if (!isLoading && chatShortcut === null) {
- setChatShortcut(isMac ? "⌃⌘L" : "Alt+L");
+ setChatShortcut(isMac ? "⌘⌃L" : "Alt+L");
}
}, [isMac, isLoading, overlayShortcut, chatShortcut]);
@@ -163,20 +163,60 @@ export default function ShortcutReminderPage() {
);
}
+/**
+ * Format a shortcut string for display with consistent modifier ordering.
+ * On macOS: Command (⌘) → Control (⌃) → Option (⌥) → Shift (⇧) → Key
+ * On Windows/Linux: Ctrl → Alt → Shift → Key
+ */
function formatShortcut(shortcut: string, isMac: boolean): string {
- // Default matches Control+Super+S from settings
- if (!shortcut) return isMac ? "⌃⌘S" : "Alt+S";
+ if (!shortcut) return isMac ? "⌘⌃S" : "Alt+S";
+
+ // Parse the shortcut into parts
+ const parts = shortcut.split("+").map(p => p.trim().toLowerCase());
+
+ // Define modifier priorities (lower = comes first)
+ // Command/Super comes first, then Control, then Alt/Option, then Shift
+ const modifierPriority: Record<string, number> = {
+ "super": 0, "command": 0, "cmd": 0,
+ "ctrl": 1, "control": 1,
+ "alt": 2, "option": 2,
+ "shift": 3,
+ };
+
+ // Separate modifiers from the key
+ const modifiers: string[] = [];
+ let key = "";
+
+ for (const part of parts) {
+ if (modifierPriority[part] !== undefined) {
+ modifiers.push(part);
+ } else {
+ key = part;
+ }
+ }
+
+ // Sort modifiers by priority (Command first)
+ modifiers.sort((a, b) => (modifierPriority[a] ?? 99) - (modifierPriority[b] ?? 99));
+
if (isMac) {
- return shortcut
- .replace(/Super|Command|Cmd/gi, "⌘")
- .replace(/Ctrl|Control/gi, "⌃")
- .replace(/Alt|Option/gi, "⌥")
- .replace(/Shift/gi, "⇧")
- .replace(/\+/g, "");
+ // Convert to Mac symbols in sorted order
+ const macSymbols: Record<string, string> = {
+ "super": "⌘", "command": "⌘", "cmd": "⌘",
+ "ctrl": "⌃", "control": "⌃",
+ "alt": "⌥", "option": "⌥",
+ "shift": "⇧",
+ };
+ const formattedMods = modifiers.map(m => macSymbols[m] || m).join("");
+ return formattedMods + key.toUpperCase();
+ } else {
+ // Windows/Linux: readable format
+ const winNames: Record<string, string> = {
+ "super": "Win", "command": "Ctrl", "cmd": "Ctrl",
+ "ctrl": "Ctrl", "control": "Ctrl",
+ "alt": "Alt", "option": "Alt",
+ "shift": "Shift",
+ };
+ const formattedMods = modifiers.map(m => winNames[m] || m);
+ return [...formattedMods, key.toUpperCase()].join("+");
}
- // Windows/Linux: use readable text
- return shortcut
- .replace(/Super/gi, "Win")
- .replace(/Command|Cmd/gi, "Ctrl")
- .replace(/Option/gi, "Alt");
}
diff --git a/screenpipe-app-tauri/components/global-chat.tsx b/screenpipe-app-tauri/components/global-chat.tsx
index fd01b8028..c4fb04518 100644
--- a/screenpipe-app-tauri/components/global-chat.tsx
+++ b/screenpipe-app-tauri/components/global-chat.tsx
@@ -31,6 +31,67 @@ import { UpgradeDialog } from "@/components/upgrade-dialog";
const SCREENPIPE_API = "http://localhost:3030";
+// ============================================================================
+// SHORTCUT FORMATTING - Consistent modifier ordering (⌘ → ⌃ → ⌥ → ⇧ → key)
+// ============================================================================
+
+/**
+ * Format a shortcut string for display with consistent modifier ordering.
+ * On macOS: Command (⌘) → Control (⌃) → Option (⌥) → Shift (⇧) → Key
+ * On Windows/Linux: Ctrl → Alt → Shift → Key
+ */
+export function formatShortcutDisplay(shortcut: string, isMac: boolean): string {
+ if (!shortcut) return "";
+
+ // Parse the shortcut into parts
+ const parts = shortcut.split("+").map(p => p.trim().toLowerCase());
+
+ // Define modifier priorities (lower = comes first)
+ const modifierPriority: Record<string, number> = {
+ "super": 0, "command": 0, "cmd": 0,
+ "ctrl": 1, "control": 1,
+ "alt": 2, "option": 2,
+ "shift": 3,
+ };
+
+ // Separate modifiers from the key
+ const modifiers: string[] = [];
+ let key = "";
+
+ for (const part of parts) {
+ if (modifierPriority[part] !== undefined) {
+ modifiers.push(part);
+ } else {
+ key = part;
+ }
+ }
+
+ // Sort modifiers by priority
+ modifiers.sort((a, b) => (modifierPriority[a] ?? 99) - (modifierPriority[b] ?? 99));
+
+ if (isMac) {
+ // Convert to Mac symbols
+ const macSymbols: Record<string, string> = {
+ "super": "⌘", "command": "⌘", "cmd": "⌘",
+ "ctrl": "⌃", "control": "⌃",
+ "alt": "⌥", "option": "⌥",
+ "shift": "⇧",
+ };
+ const formattedMods = modifiers.map(m => macSymbols[m] || m).join("");
+ return formattedMods + key.toUpperCase();
+ } else {
+ // Windows/Linux: readable format
+ const winNames: Record<string, string> = {
+ "super": "Win", "command": "Ctrl", "cmd": "Ctrl",
+ "ctrl": "Ctrl", "control": "Ctrl",
+ "alt": "Alt", "option": "Alt",
+ "shift": "Shift",
+ };
+ const formattedMods = modifiers.map(m => winNames[m] || m);
+ return [...formattedMods, key.toUpperCase()].join("+");
+ }
+}
+
// ============================================================================
// @MENTION SYSTEM - Time, Content Type, and App filters
// ============================================================================
@@ -1300,15 +1361,17 @@ export function GlobalChat() {
</motion.button>
)}
- {/* AI Chat button */}
+ {/* AI Chat button - opens standalone chat window */}
<button
- onClick={() => setOpen(true)}
+ onClick={() => commands.showWindow("Chat")}
className="group flex items-center gap-2 px-3 py-2 rounded-lg bg-background/90 backdrop-blur-md border border-border/50 hover:border-foreground/20 text-xs text-muted-foreground hover:text-foreground transition-all duration-200 shadow-lg shadow-black/5"
>
<div className="p-1 rounded bg-foreground/5 group-hover:bg-foreground/10 transition-colors">
<PipeAIIcon size={14} animated={false} />
</div>
- <span className="font-mono text-[10px] uppercase tracking-wider">{isMac ? "⌘L" : "Ctrl+L"}</span>
+ <span className="font-mono text-[10px] uppercase tracking-wider">
+ {formatShortcutDisplay(settings.showChatShortcut || "", isMac)}
+ </span>
</button>
</motion.div>
)}
@@ -1332,7 +1395,7 @@ export function GlobalChat() {
<p className="text-[10px] text-muted-foreground font-mono uppercase tracking-wider">Screen Activity Assistant</p>
</div>
<kbd className="hidden sm:inline-flex items-center gap-1 px-2 py-0.5 text-[10px] font-mono text-muted-foreground bg-muted/50 border border-border/50 rounded">
- {isMac ? "⌘" : "Ctrl"}+L
+ {formatShortcutDisplay(settings.showChatShortcut || "", isMac)}
</kbd>
</div>
diff --git a/screenpipe-app-tauri/components/onboarding/status.tsx b/screenpipe-app-tauri/components/onboarding/status.tsx
index 8cbdce32c..6c6ed8a95 100644
--- a/screenpipe-app-tauri/components/onboarding/status.tsx
+++ b/screenpipe-app-tauri/components/onboarding/status.tsx
@@ -17,22 +17,59 @@ import { version as osVersion, platform as osPlatform } from "@tauri-apps/plugin
import Lottie from "lottie-react";
import pipeFlowAnimation from "@/public/animations/pipe-flow.json";
-// Format shortcut for display (platform-aware)
+/**
+ * Format a shortcut string for display with consistent modifier ordering.
+ * On macOS: Command (⌘) → Control (⌃) → Option (⌥) → Shift (⇧) → Key
+ * On Windows/Linux: Ctrl → Alt → Shift → Key
+ */
function formatShortcut(shortcut: string, isMac: boolean): string {
if (!shortcut) return "";
+
+ // Parse the shortcut into parts
+ const parts = shortcut.split("+").map(p => p.trim().toLowerCase());
+
+ // Define modifier priorities (lower = comes first)
+ const modifierPriority: Record<string, number> = {
+ "super": 0, "command": 0, "cmd": 0,
+ "ctrl": 1, "control": 1,
+ "alt": 2, "option": 2,
+ "shift": 3,
+ };
+
+ // Separate modifiers from the key
+ const modifiers: string[] = [];
+ let key = "";
+
+ for (const part of parts) {
+ if (modifierPriority[part] !== undefined) {
+ modifiers.push(part);
+ } else {
+ key = part;
+ }
+ }
+
+ // Sort modifiers by priority (Command first)
+ modifiers.sort((a, b) => (modifierPriority[a] ?? 99) - (modifierPriority[b] ?? 99));
+
if (isMac) {
- return shortcut
- .replace(/Super|Command|Cmd/gi, "⌘")
- .replace(/Ctrl|Control/gi, "⌃")
- .replace(/Alt|Option/gi, "⌥")
- .replace(/Shift/gi, "⇧")
- .replace(/\+/g, " ");
+ const macSymbols: Record<string, string> = {
+ "super": "⌘", "command": "⌘", "cmd": "⌘",
+ "ctrl": "⌃", "control": "⌃",
+ "alt": "⌥", "option": "⌥",
+ "shift": "⇧",
+ };
+ const formattedMods = modifiers.map(m => macSymbols[m] || m).join("");
+ return formattedMods + " " + key.toUpperCase();
+ } else {
+ const winNames: Record<string, string> = {
+ "super": "Win", "command": "Ctrl", "cmd": "Ctrl",
+ "ctrl": "Ctrl", "control": "Ctrl",
+ "alt": "Alt", "option": "Alt",
+ "shift": "Shift",
+ };
+ const formattedMods = modifiers.map(m => winNames[m] || m);
+ return [...formattedMods, key.toUpperCase()].join("+");
}
- // Windows/Linux: use readable text
- return shortcut
- .replace(/Super/gi, "Win")
- .replace(/Command|Cmd/gi, "Ctrl")
- .replace(/Option/gi, "Alt");
}
interface OnboardingStatusProps {
diff --git a/screenpipe-app-tauri/components/onboarding/timeline-ai-demo.tsx b/screenpipe-app-tauri/components/onboarding/timeline-ai-demo.tsx
index 229c8335a..60bc231b7 100644
--- a/screenpipe-app-tauri/components/onboarding/timeline-ai-demo.tsx
+++ b/screenpipe-app-tauri/components/onboarding/timeline-ai-demo.tsx
@@ -4,21 +4,51 @@ import { MessageSquare, Sparkles } from "lucide-react";
import { useSettings } from "@/lib/hooks/use-settings";
import { usePlatform } from "@/lib/hooks/use-platform";
-// Format shortcut for display (platform-aware)
+/**
+ * Format a shortcut string for display with consistent modifier ordering.
+ * On macOS: Command (⌘) → Control (⌃) → Option (⌥) → Shift (⇧) → Key
+ */
function formatShortcut(shortcut: string, isMac: boolean): string {
if (!shortcut) return "";
+
+ const parts = shortcut.split("+").map(p => p.trim().toLowerCase());
+ const modifierPriority: Record<string, number> = {
+ "super": 0, "command": 0, "cmd": 0,
+ "ctrl": 1, "control": 1,
+ "alt": 2, "option": 2,
+ "shift": 3,
+ };
+
+ const modifiers: string[] = [];
+ let key = "";
+
+ for (const part of parts) {
+ if (modifierPriority[part] !== undefined) {
+ modifiers.push(part);
+ } else {
+ key = part;
+ }
+ }
+
+ modifiers.sort((a, b) => (modifierPriority[a] ?? 99) - (modifierPriority[b] ?? 99));
+
if (isMac) {
- return shortcut
- .replace(/Super|Command|Cmd/gi, "⌘")
- .replace(/Ctrl|Control/gi, "⌃")
- .replace(/Alt|Option/gi, "⌥")
- .replace(/Shift/gi, "⇧")
- .replace(/\+/g, "");
+ const macSymbols: Record<string, string> = {
+ "super": "⌘", "command": "⌘", "cmd": "⌘",
+ "ctrl": "⌃", "control": "⌃",
+ "alt": "⌥", "option": "⌥",
+ "shift": "⇧",
+ };
+ return modifiers.map(m => macSymbols[m] || m).join("") + key.toUpperCase();
+ } else {
+ const winNames: Record<string, string> = {
+ "super": "Win", "command": "Ctrl", "cmd": "Ctrl",
+ "ctrl": "Ctrl", "control": "Ctrl",
+ "alt": "Alt", "option": "Alt",
+ "shift": "Shift",
+ };
+ return [...modifiers.map(m => winNames[m] || m), key.toUpperCase()].join("+");
}
- return shortcut
- .replace(/Super/gi, "Win")
- .replace(/Command|Cmd/gi, "Ctrl")
- .replace(/Option/gi, "Alt");
}
/**
diff --git a/screenpipe-app-tauri/components/rewind/search-command.tsx b/screenpipe-app-tauri/components/rewind/search-command.tsx
index a653123d4..5cfd2ac7f 100644
--- a/screenpipe-app-tauri/components/rewind/search-command.tsx
+++ b/screenpipe-app-tauri/components/rewind/search-command.tsx
@@ -21,6 +21,8 @@ import { useQueryStates } from "nuqs";
import { commands } from "@/lib/utils/tauri";
import { Badge } from "./ui/badge";
import { usePlatform } from "@/lib/hooks/use-platform";
+import { useSettings } from "@/lib/hooks/use-settings";
+import { formatShortcutDisplay } from "@/components/global-chat";
const SCREENPIPE_API = "http://localhost:3030";
@@ -39,6 +41,7 @@ interface SearchResult {
export function SearchCommand() {
const [open, setOpen] = React.useState(false);
const { isMac } = usePlatform();
+ const { settings } = useSettings();
const inputRef = React.useRef<HTMLInputElement>(null);
const [state] = useQueryStates(queryParser);
@@ -265,7 +268,7 @@ export function SearchCommand() {
{/* Hint for AI chat */}
<div className="px-3 py-2 border-t text-xs text-muted-foreground flex items-center justify-between">
<span>Press Enter to search</span>
- <span>{isMac ? "⌘L" : "Ctrl+L"} for AI chat</span>
+ <span>{formatShortcutDisplay(settings.showChatShortcut || "", isMac)} for AI chat</span>
</div>
</CustomDialogContent>
</Dialog>
diff --git a/screenpipe-app-tauri/components/rewind/timeline/ai-panel.tsx b/screenpipe-app-tauri/components/rewind/timeline/ai-panel.tsx
index ee5f79748..e326e7cd3 100644
--- a/screenpipe-app-tauri/components/rewind/timeline/ai-panel.tsx
+++ b/screenpipe-app-tauri/components/rewind/timeline/ai-panel.tsx
@@ -16,6 +16,7 @@ import {
TooltipTrigger,
} from "@/components/ui/tooltip";
import { useSettings } from "@/lib/hooks/use-settings";
+import { formatShortcutDisplay } from "@/components/global-chat";
import { useLoginDialog } from "@/components/login-dialog";
import { ExportButton } from "../export-button";
import Image from "next/image";
@@ -418,7 +419,7 @@ export function AIPanel({
>
<span>ASK AI</span>
<span className="text-muted-foreground text-sm normal-case bg-muted px-2 py-0.5 rounded font-medium">
- {osType === "macos" ? "⌘L" : "Ctrl+L"}
+ {formatShortcutDisplay(settings.showChatShortcut || "", osType === "macos")}
</span>
</button>
</div>