From 48cd29822b7911f8bf029ed7c9ff4e8022954980 Mon Sep 17 00:00:00 2001 From: Diogo Chaves Date: Tue, 8 Sep 2026 14:15:19 -0300 Subject: [PATCH] Size the taskbar flyout to its content The native taskbar-widget flyout sized its window with Math.max(174, section.scrollHeight). Everything outside the .taskbar-flyout section is transparent, so whenever the content measured under 174px the extra window height showed the desktop as a bare strip under the "Open Ceiling" row. The shortest real layout hits it: header + one Unavailable row + footer is 163px, i.e. one provider whose last sync failed. Drop the floor and size to the measured section. 174 stays only as a fallback for the no-layout case, matching FLYOUT_INITIAL_HEIGHT on the Rust side, and can never inflate a real measurement. Co-Authored-By: Claude Fable 5.1 --- apps/desktop-tauri/src/surfaces/TaskbarFlyout.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/desktop-tauri/src/surfaces/TaskbarFlyout.tsx b/apps/desktop-tauri/src/surfaces/TaskbarFlyout.tsx index a579cfd0..2c5d1153 100644 --- a/apps/desktop-tauri/src/surfaces/TaskbarFlyout.tsx +++ b/apps/desktop-tauri/src/surfaces/TaskbarFlyout.tsx @@ -31,6 +31,12 @@ import { } from "../lib/providerRow"; const FLYOUT_WIDTH = 344; +// Mirrors `FLYOUT_INITIAL_HEIGHT` in `shell/flyout_window.rs`. Used only when +// the section has no layout to measure yet — never as a floor. Everything +// outside `.taskbar-flyout` is transparent, so a window taller than the section +// shows the desktop as a bare strip under the footer: header + one Unavailable +// row + footer measures 163px, which the old `Math.max(174, …)` padded to 174. +const FLYOUT_FALLBACK_HEIGHT = 174; const MAX_VISIBLE_PROVIDERS = 6; const MAX_VISIBLE_WINDOWS_PER_PROVIDER = 4; @@ -359,7 +365,8 @@ export default function TaskbarFlyout({ state }: { state: BootstrapState }) { frame = null; // Windows owns the rounded outer edge; size directly to the content so // no transparent or CSS-border gutter can appear around that shape. - const height = Math.max(174, Math.ceil(surfaceRef.current?.scrollHeight ?? 174)); + const measured = Math.ceil(surfaceRef.current?.scrollHeight ?? 0); + const height = measured > 0 ? measured : FLYOUT_FALLBACK_HEIGHT; void (async () => { await getCurrentWindow().setSize(new LogicalSize(FLYOUT_WIDTH, height)).catch(() => {}); await reanchorTrayPanel().catch(() => {});