From 2a919211d93e4885da565e2868f78839c6243ec1 Mon Sep 17 00:00:00 2001 From: spinline Date: Fri, 6 Feb 2026 17:17:07 +0300 Subject: [PATCH] fix: fixed statusbar at bottom, fix dropdown toggle race, fix theme buttons on iOS - StatusBar now uses fixed positioning at viewport bottom (z-[99]) - Dropdown toggle uses skip_next_close guard to prevent close-then-reopen - Global close listener uses click instead of pointerdown (fires after toggle) - Theme/limit buttons use on:pointerdown instead of on:click for iOS compat - Main content has pb-8 to prevent overlap with fixed statusbar - Rebuilt tailwind.css --- frontend/public/tailwind.css | 6 +++++ frontend/src/app.rs | 25 +++++++++---------- frontend/src/components/layout/statusbar.rs | 27 +++++++++++++++------ 3 files changed, 36 insertions(+), 22 deletions(-) diff --git a/frontend/public/tailwind.css b/frontend/public/tailwind.css index 3305169..585cb49 100644 --- a/frontend/public/tailwind.css +++ b/frontend/public/tailwind.css @@ -1366,6 +1366,9 @@ .right-0 { right: calc(var(--spacing) * 0); } + .bottom-0 { + bottom: calc(var(--spacing) * 0); + } .bottom-full { bottom: 100%; } @@ -2172,6 +2175,9 @@ .pt-1 { padding-top: calc(var(--spacing) * 1); } + .pb-8 { + padding-bottom: calc(var(--spacing) * 8); + } .pb-20 { padding-bottom: calc(var(--spacing) * 20); } diff --git a/frontend/src/app.rs b/frontend/src/app.rs index 43e5b0c..e8d27e8 100644 --- a/frontend/src/app.rs +++ b/frontend/src/app.rs @@ -64,22 +64,19 @@ pub fn App() -> impl IntoView {
-
- // Toolbar + main wrapped so overflow-hidden doesn't clip StatusBar dropdowns -
- +
+ -
- - - } /> - "Settings Page (Coming Soon)"
} /> - - - -
+
+ + + } /> + "Settings Page (Coming Soon)"
} /> + + + - // Status Bar at the bottom - outside overflow-hidden so dropdowns can open upward + // StatusBar is rendered via fixed positioning, just mount it here
diff --git a/frontend/src/components/layout/statusbar.rs b/frontend/src/components/layout/statusbar.rs index 41323ce..1769af5 100644 --- a/frontend/src/components/layout/statusbar.rs +++ b/frontend/src/components/layout/statusbar.rs @@ -111,13 +111,18 @@ pub fn StatusBar() -> impl IntoView { // Signal-based dropdown state: 0=none, 1=download, 2=upload, 3=theme let (active_dropdown, set_active_dropdown) = create_signal(0u8); + // Guard to prevent global close from firing right after toggle opens + let skip_next_close = store_value(false); // Toggle a specific dropdown let toggle = move |id: u8| { - if active_dropdown.get_untracked() == id { + let current = active_dropdown.get_untracked(); + if current == id { set_active_dropdown.set(0); } else { set_active_dropdown.set(id); + // Mark that the next global close should be skipped + skip_next_close.set_value(true); } }; @@ -126,14 +131,17 @@ pub fn StatusBar() -> impl IntoView { set_active_dropdown.set(0); }; - // Close dropdowns when tapping outside - let _ = window_event_listener(ev::pointerdown, move |_| { - // This fires first; dropdown buttons call stop_propagation to prevent closing + // Close dropdowns when tapping outside — uses click (fires after pointerdown) + let _ = window_event_listener(ev::click, move |_| { + if skip_next_close.get_value() { + skip_next_close.set_value(false); + return; + } set_active_dropdown.set(0); }); view! { -
+
// --- DOWNLOAD SPEED DROPDOWN ---
@@ -171,7 +179,8 @@ pub fn StatusBar() -> impl IntoView {