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: convert raw shortcut names to symbols in Swift overlay

Louis Beaumont83cc5766e075
diff --git a/apps/screenpipe-app-tauri/src-tauri/swift/shortcut_reminder.swift b/apps/screenpipe-app-tauri/src-tauri/swift/shortcut_reminder.swift
index 92867a6f0..f2739c25b 100644
--- a/apps/screenpipe-app-tauri/src-tauri/swift/shortcut_reminder.swift
+++ b/apps/screenpipe-app-tauri/src-tauri/swift/shortcut_reminder.swift
@@ -507,13 +507,32 @@ class ShortcutReminderController: NSObject {
// Expects {"overlay":"…","chat":"…","search":"…"} plus optional URLs from Rust when API auth is on.
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 s = dict["overlay"] { overlayShortcut = prettifyShortcut(s) }
+ if let s = dict["chat"] { chatShortcut = prettifyShortcut(s) }
+ if let s = dict["search"] { searchShortcut = prettifyShortcut(s) }
if let s = dict["metrics_ws_url"] { metricsWsUrl = s }
if let s = dict["meetings_status_url"] { meetingsStatusUrl = s }
}
+ /// Convert "Super+Ctrl+S" → "⌘⌃S" for compact overlay display.
+ private func prettifyShortcut(_ raw: String) -> String {
+ // Already contains symbols — return as-is
+ if raw.contains("⌘") || raw.contains("⌃") || raw.contains("⌥") || raw.contains("⇧") { return raw }
+ let parts = raw.split(separator: "+").map(String.init)
+ var symbols = ""
+ var key = ""
+ for part in parts {
+ switch part.lowercased() {
+ case "super", "cmd", "command", "meta": symbols += "⌘"
+ case "ctrl", "control": symbols += "⌃"
+ case "alt", "option", "opt": symbols += "⌥"
+ case "shift": symbols += "⇧"
+ default: key = part.uppercased()
+ }
+ }
+ return symbols + key
+ }
+
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