Skip to content

Modern Docker Management, Designed for Everyone

fix: save button showing behind mobile nav bar

Kyle Mendell574e22c6ec0a
diff --git a/frontend/src/routes/settings/+layout.svelte b/frontend/src/routes/settings/+layout.svelte
index fc7c9ef50..c597ea472 100644
--- a/frontend/src/routes/settings/+layout.svelte
+++ b/frontend/src/routes/settings/+layout.svelte
@@ -12,6 +12,8 @@
import { m } from '$lib/paraglide/messages';
import settingsStore from '$lib/stores/config-store';
import { IsMobile } from '$lib/hooks/is-mobile.svelte.js';
+ import { IsTablet } from '$lib/hooks/is-tablet.svelte.js';
+ import { getEffectiveNavigationSettings } from '$lib/utils/navigation.utils';
interface Props {
children: import('svelte').Snippet;
@@ -25,7 +27,75 @@
const sidebar = useSidebar();
const isMobile = new IsMobile();
+ const isTablet = new IsTablet();
const isReadOnly = $derived.by(() => $settingsStore.uiConfigDisabled);
+ const navigationSettings = $derived(getEffectiveNavigationSettings());
+ const navigationMode = $derived(navigationSettings.mode);
+ const scrollToHideEnabled = $derived(navigationSettings.scrollToHide);
+
+ // Track mobile nav visibility for FAB positioning
+ let mobileNavVisible = $state(true);
+
+ // Monitor mobile nav visibility when scroll-to-hide is enabled
+ $effect(() => {
+ if (typeof window === 'undefined') return;
+ if (!scrollToHideEnabled || !(isMobile.current || isTablet.current)) {
+ mobileNavVisible = true;
+ return;
+ }
+
+ // Check the mobile nav element's transform to determine visibility
+ const checkNavVisibility = () => {
+ const navElement = document.querySelector('[data-testid="mobile-floating-nav"], [data-testid="mobile-docked-nav"]');
+ if (!navElement) {
+ mobileNavVisible = true;
+ return;
+ }
+
+ const style = window.getComputedStyle(navElement);
+ const transform = style.transform;
+ const opacity = parseFloat(style.opacity);
+
+ // Check if nav is translated away or has low opacity
+ if (transform !== 'none' && transform.includes('matrix')) {
+ const matrix = transform.match(/matrix.*\((.+)\)/);
+ if (matrix) {
+ const values = matrix[1].split(', ');
+ const translateY = parseFloat(values[5] || '0');
+ // If translateY is positive (moved down), nav is hidden
+ mobileNavVisible = translateY === 0 && opacity > 0.5;
+ }
+ } else {
+ mobileNavVisible = opacity > 0.5;
+ }
+ };
+
+ // Initial check
+ checkNavVisibility();
+
+ // Use MutationObserver to watch for style changes on nav
+ const observer = new MutationObserver(checkNavVisibility);
+ const navElement = document.querySelector('[data-testid="mobile-floating-nav"], [data-testid="mobile-docked-nav"]');
+
+ if (navElement) {
+ observer.observe(navElement, {
+ attributes: true,
+ attributeFilter: ['style', 'class']
+ });
+ }
+
+ // Also check on scroll as a fallback
+ const handleScroll = () => {
+ requestAnimationFrame(checkNavVisibility);
+ };
+
+ window.addEventListener('scroll', handleScroll, { passive: true });
+
+ return () => {
+ observer.disconnect();
+ window.removeEventListener('scroll', handleScroll);
+ };
+ });
// Calculate left position based on sidebar state to match sidebar spacing system
// Uses the same CSS variables and spacing as the sidebar component
@@ -171,7 +241,16 @@
<!-- Mobile Floating Action Buttons -->
{#if isSubPage && !isReadOnly}
- <div class="fixed right-4 bottom-4 z-50 flex flex-col gap-3 sm:hidden">
+ <div
+ class="fixed right-4 z-50 flex flex-col gap-3 transition-all duration-300 ease-out sm:hidden"
+ style="bottom: {scrollToHideEnabled && !mobileNavVisible
+ ? '1rem'
+ : 'calc(var(--mobile-' +
+ navigationMode +
+ '-nav-offset, ' +
+ (navigationMode === 'docked' ? 'calc(3.5rem + env(safe-area-inset-bottom))' : '6rem') +
+ ') + 1rem)'};"
+ >
{#if formState.hasChanges && formState.resetFunction}
<Button
variant="outline"
@@ -199,7 +278,7 @@
<!-- Status indicator for mobile -->
{#if formState.hasChanges}
- <div class="absolute -top-2 -left-2 size-3 animate-pulse rounded-full bg-orange-500"></div>
+ <div class="absolute -left-2 -top-2 size-3 animate-pulse rounded-full bg-orange-500"></div>
{/if}
</div>
{/if}