From d4c4f451faa3f432781bf21535d9d4b52d21c088 Mon Sep 17 00:00:00 2001 From: Westline Marketing Date: Thu, 4 Jun 2026 09:10:33 -0400 Subject: [PATCH] fix(panel): clamp panel to visible screen when menu bar auto-hides When the macOS menu bar is set to auto-hide, the tray icon rect sits above the visible screen, so the panel anchored to its bottom edge rendered partially off-screen with the header clipped. Clamp the panel's top edge to the monitor's top edge. Behavior with a visible menu bar is unchanged, since the anchor already lands below the bar. Fixes #556 Co-Authored-By: Claude Opus 4.8 (1M context) --- src-tauri/src/panel.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src-tauri/src/panel.rs b/src-tauri/src/panel.rs index ce440aee..bfc0a997 100644 --- a/src-tauri/src/panel.rs +++ b/src-tauri/src/panel.rs @@ -272,7 +272,10 @@ pub fn position_panel_at_tray_icon( let icon_center_x = icon_logical_x + (icon_logical_w / 2.0); let panel_x = icon_center_x - (panel_width / 2.0); let nudge_up: f64 = 6.0; - let panel_y = icon_logical_y + icon_logical_h - nudge_up; + // Clamp to the monitor's top edge: when the menu bar is set to auto-hide, + // the tray rect sits above the visible screen, which would otherwise push + // the panel's top edge off-screen and clip it. + let panel_y = (icon_logical_y + icon_logical_h - nudge_up).max(mon_logical_y); set_panel_top_left_immediately(&window, app_handle, panel_x, panel_y, primary_logical_h); }