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

revert: restore pre-workspace-swipe-fix shortcut behavior

Louis Beaumontda7a3715a8d8
diff --git a/apps/screenpipe-app-tauri/app/settings/page.tsx b/apps/screenpipe-app-tauri/app/settings/page.tsx
index 261fb397d..afd8407ad 100644
--- a/apps/screenpipe-app-tauri/app/settings/page.tsx
+++ b/apps/screenpipe-app-tauri/app/settings/page.tsx
@@ -299,14 +299,8 @@ function SettingsPageContent() {
return (
<div className="min-h-screen bg-background">
- {/* Transparent titlebar area with close button */}
- <div className="h-8 bg-transparent flex items-center" data-tauri-drag-region>
- <button
- onClick={() => commands.closeWindow({ Settings: { page: null } })}
- className="ml-2 w-3 h-3 rounded-full bg-[#ff5f57] hover:bg-[#ff5f57]/80 transition-colors flex-shrink-0"
- title="close"
- />
- </div>
+ {/* Transparent titlebar area */}
+ <div className="h-8 bg-transparent" data-tauri-drag-region></div>
<div className="px-4">
<div className="flex h-[calc(100vh-2rem)] min-h-0">
diff --git a/apps/screenpipe-app-tauri/src-tauri/Cargo.lock b/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
index 4665aa08a..110a010b8 100644
--- a/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
+++ b/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
@@ -9162,7 +9162,7 @@ dependencies = [
[[package]]
name = "screenpipe-app"
-version = "2.2.76"
+version = "2.2.77"
dependencies = [
"anyhow",
"arboard",
diff --git a/apps/screenpipe-app-tauri/src-tauri/Cargo.toml b/apps/screenpipe-app-tauri/src-tauri/Cargo.toml
index b96c400f6..f0d9971f3 100644
--- a/apps/screenpipe-app-tauri/src-tauri/Cargo.toml
+++ b/apps/screenpipe-app-tauri/src-tauri/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "screenpipe-app"
-version = "2.2.76"
+version = "2.2.77"
description = "24/7 memory for your desktop. 100% local."
authors = ["you"]
license = ""
diff --git a/apps/screenpipe-app-tauri/src-tauri/src/main.rs b/apps/screenpipe-app-tauri/src-tauri/src/main.rs
index ca50e7d18..91be691fe 100755
--- a/apps/screenpipe-app-tauri/src-tauri/src/main.rs
+++ b/apps/screenpipe-app-tauri/src-tauri/src/main.rs
@@ -406,21 +406,28 @@ async fn apply_shortcuts(app: &AppHandle, config: &ShortcutConfig) -> Result<(),
let _ = app.emit("shortcut-show", ());
#[cfg(target_os = "macos")]
{
- // Toggle the settings window (the main app window).
- // Check its visibility directly rather than the overlay panel,
- // since show_main_window/hide_main_window operate on the
- // settings window. The overlay panels ("main"/"main-window")
- // may not exist when the settings window is the primary UI.
- let is_visible = app
- .get_webview_window("settings")
- .and_then(|w| w.is_visible().ok())
- .unwrap_or(false);
-
- if is_visible {
- info!("settings window is visible, hiding");
- hide_main_window(app)
+ use crate::store::SettingsStore;
+ use crate::window_api::main_label_for_mode;
+ // Get current mode to find the right window label
+ let mode = SettingsStore::get(app)
+ .unwrap_or_default()
+ .unwrap_or_default()
+ .overlay_mode;
+ let label = main_label_for_mode(&mode);
+
+ if let Some(window) = app.get_webview_window(label) {
+ match window.is_visible() {
+ Ok(true) => {
+ info!("window is visible, hiding main window");
+ hide_main_window(app)
+ }
+ _ => {
+ info!("window is not visible, showing main window");
+ show_main_window(app, false)
+ }
+ }
} else {
- info!("settings window is not visible, showing");
+ info!("main window not found for mode '{}', creating it", mode);
show_main_window(app, false)
}
}
@@ -1376,16 +1383,6 @@ async fn main() {
let _ = window.set_always_on_top(false);
let _ = window.set_visible_on_all_workspaces(false);
- // Settings window on macOS: prevent close but do NOT hide.
- // macOS sends spurious CloseRequested during workspace swipes
- // and hiding the window makes it disappear when swiping back.
- // The frontend handles closing via the hide_settings_window command.
- #[cfg(target_os = "macos")]
- if window.label() == "settings" {
- api.prevent_close();
- return;
- }
-
#[cfg(target_os = "macos")]
crate::window_api::reset_to_regular_and_refresh_tray(window.app_handle());
// On Windows, let the settings window close normally when user
diff --git a/apps/screenpipe-app-tauri/src-tauri/src/window_api.rs b/apps/screenpipe-app-tauri/src-tauri/src/window_api.rs
index 6acbe44a9..276cd82f5 100644
--- a/apps/screenpipe-app-tauri/src-tauri/src/window_api.rs
+++ b/apps/screenpipe-app-tauri/src-tauri/src/window_api.rs
@@ -1947,16 +1947,6 @@ impl ShowRewindWindow {
// }
if let Some(window) = id.get(app) {
- // On macOS, the settings window has prevent_close to avoid
- // workspace swipe issues. Use hide() instead of close() so
- // programmatic close (shortcut toggle, close button) works.
- #[cfg(target_os = "macos")]
- if id.label() == RewindWindowId::Settings.label() {
- window.hide().ok();
- } else {
- window.close().ok();
- }
- #[cfg(not(target_os = "macos"))]
window.close().ok();
}
Ok(())