Skip to content

Modern Docker Management, Designed for Everyone

fix: mobile navigation glitches and scrolling issues (#709)

Kyle Mendelle03235f367f8
diff --git a/frontend/src/app.css b/frontend/src/app.css
index cc0a0bfe6..4f459067a 100644
--- a/frontend/src/app.css
+++ b/frontend/src/app.css
@@ -157,7 +157,7 @@ html,
body {
overflow-x: hidden;
max-width: 100vw;
- height: 100%;
+ min-height: 100vh;
}
body {
diff --git a/frontend/src/lib/components/locale-picker.svelte b/frontend/src/lib/components/locale-picker.svelte
index 5ac898f35..0339b7feb 100644
--- a/frontend/src/lib/components/locale-picker.svelte
+++ b/frontend/src/lib/components/locale-picker.svelte
@@ -59,7 +59,7 @@
<Select.Trigger {id} class="bg-background/50 border-border/30 text-foreground h-9 w-32 text-sm font-medium">
<span class="truncate">{locales[currentLocale]}</span>
</Select.Trigger>
- <Select.Content class="min-w-[160px] max-w-[280px]">
+ <Select.Content class="max-w-[280px] min-w-[160px]">
{#each Object.entries(locales) as [value, label]}
<Select.Item class="text-sm" {value}>{label}</Select.Item>
{/each}
@@ -68,7 +68,7 @@
{:else}
<div class="px-3 py-2">
<div class="grid gap-2">
- <Label for={id} class="text-sm font-medium leading-none">
+ <Label for={id} class="text-sm leading-none font-medium">
{m.language()}
</Label>
<Select.Root
diff --git a/frontend/src/lib/components/logs/log-viewer.svelte b/frontend/src/lib/components/logs/log-viewer.svelte
index 6cda34049..4472a1a80 100644
--- a/frontend/src/lib/components/logs/log-viewer.svelte
+++ b/frontend/src/lib/components/logs/log-viewer.svelte
@@ -362,7 +362,7 @@
});
</script>
-<div class={cn('log-viewer rounded-b-xl rounded-t-none border bg-black text-white', className)}>
+<div class={cn('log-viewer rounded-t-none rounded-b-xl border bg-black text-white', className)}>
{#if error}
<div class="border-b border-red-700 bg-red-900/20 p-3 text-sm text-red-200">
{error}
@@ -371,7 +371,7 @@
<div
bind:this={logContainer}
- class="log-viewer overflow-y-auto rounded-b-xl rounded-t-none border bg-black font-mono text-xs text-white sm:text-sm"
+ class="log-viewer overflow-y-auto rounded-t-none rounded-b-xl border bg-black font-mono text-xs text-white sm:text-sm"
style="height: {height}; min-height: 300px;"
role="log"
aria-live={isStreaming ? 'polite' : 'off'}
@@ -407,7 +407,7 @@
{log.level.toUpperCase()}
</span>
</div>
- <div class="whitespace-pre-wrap break-words text-sm text-gray-300">
+ <div class="text-sm break-words whitespace-pre-wrap text-gray-300">
{log.message}
</div>
</div>
@@ -418,7 +418,7 @@
>
{#if type === 'project' && log.service}
<span
- class="mr-3 min-w-[120px] max-w-[120px] shrink-0 truncate text-xs font-semibold {getServiceColor(log.service)}"
+ class="mr-3 max-w-[120px] min-w-[120px] shrink-0 truncate text-xs font-semibold {getServiceColor(log.service)}"
title={log.service}
>
{log.service}
@@ -427,7 +427,7 @@
<span class="mr-2 shrink-0 text-xs {getLevelClass(log.level)} min-w-fit">
{log.level.toUpperCase()}
</span>
- <span class="flex-1 whitespace-pre-wrap break-words text-gray-300">
+ <span class="flex-1 break-words whitespace-pre-wrap text-gray-300">
{log.message}
</span>
</div>
diff --git a/frontend/src/lib/components/mobile-nav/mobile-docked-nav.svelte b/frontend/src/lib/components/mobile-nav/mobile-docked-nav.svelte
deleted file mode 100644
index 6244cf6af..000000000
--- a/frontend/src/lib/components/mobile-nav/mobile-docked-nav.svelte
+++ /dev/null
@@ -1,151 +0,0 @@
-<script lang="ts">
- import { page } from '$app/state';
- import type { NavigationItem, MobileNavigationSettings } from '$lib/config/navigation-config';
- import { getAvailableMobileNavItems } from '$lib/config/navigation-config';
- import MobileNavItem from './mobile-nav-item.svelte';
- import { m } from '$lib/paraglide/messages';
- import { cn } from '$lib/utils';
- import { createMobileNavInteractions } from '$lib/hooks/use-mobile-nav-interactions';
- import { registerNavigationManager } from '$lib/utils/navigation.utils';
- import MobileNavSheet from './mobile-nav-sheet.svelte';
- import './styles.css';
-
- let {
- navigationSettings,
- user = null,
- versionInformation = null,
- class: className = ''
- }: {
- navigationSettings: MobileNavigationSettings;
- user?: any;
- versionInformation?: any;
- class?: string;
- } = $props();
-
- // Get pinned items from navigation settings
- const pinnedItems = $derived.by(() => {
- const availableItems = getAvailableMobileNavItems();
- return navigationSettings.pinnedItems
- .map((url) => availableItems.find((item) => item.url === url))
- .filter((item) => item !== undefined);
- });
-
- const currentPath = $derived(page.url.pathname);
-
- // Get navigation settings from props
- const showLabels = $derived(navigationSettings.showLabels);
- const scrollToHideEnabled = $derived(navigationSettings.scrollToHide);
- const tapToHideEnabled = $derived(navigationSettings.tapToHide);
-
- // Local state for visibility and menu
- let visible = $state(true);
- let menuOpen = $state(false);
- let navElement: HTMLElement;
- let autoHidden = $state(false);
-
- // Compute visibility based on scroll direction - always use manual state
- const shouldShow = $derived(visible);
-
- // Setup mobile navigation interactions
- const mobileNavInteractions = createMobileNavInteractions(
- {
- onVisibilityChange: (newVisible: boolean) => {
- visible = newVisible;
- // Sync the interaction manager's state
- mobileNavInteractions.updateState({ visible: newVisible });
- },
- onMenuOpen: () => {
- menuOpen = true;
- },
- shouldPreventTouch: (currentMenuOpen: boolean) => currentMenuOpen
- },
- {
- // Docked nav specific tuning
- scrollThreshold: 15,
- scrollMinDistance: 100,
- scrollTopThreshold: 100,
- scrollChangeThreshold: 50,
- tapDebounceTimeout: 300,
- swipeThreshold: 20,
- swipeVelocity: 0.1,
- swipeTimeLimit: 1000,
- touchEndDelay: 150,
- menuOpenRestoreDelay: 50,
- wheelThreshold: 10
- }
- );
-
- $effect(() => {
- const direction = mobileNavInteractions.scrollDirection;
- const scrollY = mobileNavInteractions.scrollY;
-
- // Update interaction manager state
- mobileNavInteractions.updateState({
- menuOpen,
- scrollToHideEnabled,
- tapToHideEnabled
- });
-
- // Handle scroll effects
- mobileNavInteractions.handleScrollEffect(direction, scrollY);
- });
-
- // Make navigation bar visible when navigation sheet closes and ensure touch is restored
- let previousMenuOpen = $state(false);
- $effect(() => {
- const currentMenuOpen = menuOpen;
-
- // Handle menu state changes
- mobileNavInteractions.handleMenuStateChange(previousMenuOpen, currentMenuOpen);
-
- previousMenuOpen = currentMenuOpen;
- });
-
- // Update auto-hidden state
- $effect(() => {
- const newAutoHidden = !shouldShow;
- if (newAutoHidden !== autoHidden) {
- autoHidden = newAutoHidden;
- }
- });
-
- // Set up mobile navigation interactions
- $effect(() => {
- if (navElement) {
- // Setup the element with the interaction manager
- mobileNavInteractions.setupElement(navElement);
-
- // Register this manager globally so settings can access it
- registerNavigationManager(mobileNavInteractions);
-
- // Return cleanup function
- return () => {
- mobileNavInteractions.cleanup();
- };
- }
- });
-</script>
-
-<nav
- bind:this={navElement}
- class={cn(
- 'mobile-nav-base mobile-nav-docked',
- 'fixed right-0 bottom-0 left-0 z-50 gap-2',
- 'bg-background/95 border-border/50 border-t backdrop-blur-sm',
- 'shadow-lg',
- 'select-none', // Prevent text selection but allow touch
- 'transition-all duration-300 ease-out', // Smoother easing
- 'flex items-center justify-around',
- showLabels ? 'px-3 py-2' : 'px-3 py-2.5',
- shouldShow ? 'translate-y-0 opacity-100' : 'translate-y-full opacity-0',
- className
- )}
- data-testid="mobile-docked-nav"
- aria-label={m.mobile_navigation()}
->
- {#each pinnedItems as item (item.url)}
- <MobileNavItem {item} {showLabels} active={currentPath === item.url || currentPath.startsWith(item.url + '/')} />
- {/each}
-</nav>
-
-<MobileNavSheet bind:open={menuOpen} {user} {versionInformation} />
diff --git a/frontend/src/lib/components/mobile-nav/mobile-floating-nav.svelte b/frontend/src/lib/components/mobile-nav/mobile-floating-nav.svelte
deleted file mode 100644
index b56fcea74..000000000
--- a/frontend/src/lib/components/mobile-nav/mobile-floating-nav.svelte
+++ /dev/null
@@ -1,145 +0,0 @@
-<script lang="ts">
- import { page } from '$app/state';
- import type { NavigationItem, MobileNavigationSettings } from '$lib/config/navigation-config';
- import { getAvailableMobileNavItems } from '$lib/config/navigation-config';
- import MobileNavItem from './mobile-nav-item.svelte';
- import { cn } from '$lib/utils';
- import { createMobileNavInteractions } from '$lib/hooks/use-mobile-nav-interactions';
- import { registerNavigationManager } from '$lib/utils/navigation.utils';
- import MobileNavSheet from './mobile-nav-sheet.svelte';
- import './styles.css';
-
- let {
- navigationSettings,
- user = null,
- versionInformation = null,
- class: className = ''
- }: {
- navigationSettings: MobileNavigationSettings;
- user?: any;
- versionInformation?: any;
- class?: string;
- } = $props();
-
- // Get pinned items from navigation settings
- const pinnedItems = $derived.by(() => {
- const availableItems = getAvailableMobileNavItems();
- return navigationSettings.pinnedItems
- .map((url) => availableItems.find((item) => item.url === url))
- .filter((item) => item !== undefined);
- });
-
- const currentPath = $derived(page.url.pathname);
-
- const showLabels = $derived(navigationSettings.showLabels);
- const scrollToHideEnabled = $derived(navigationSettings.scrollToHide);
- const tapToHideEnabled = $derived(navigationSettings.tapToHide);
-
- let visible = $state(true);
- let menuOpen = $state(false);
- let navElement: HTMLElement;
- let autoHidden = $state(false);
-
- const shouldShow = $derived(visible);
-
- // Setup mobile navigation interactions with floating nav specific tuning
- const mobileNavInteractions = createMobileNavInteractions(
- {
- onVisibilityChange: (newVisible: boolean) => {
- visible = newVisible;
- // Sync the interaction manager's state
- mobileNavInteractions.updateState({ visible: newVisible });
- },
- onMenuOpen: () => {
- menuOpen = true;
- },
- shouldPreventTouch: (currentMenuOpen: boolean) => currentMenuOpen
- },
- {
- // Floating nav specific tuning - potentially different from docked
- scrollThreshold: 15,
- scrollMinDistance: 100,
- scrollTopThreshold: 100,
- scrollChangeThreshold: 50,
- tapDebounceTimeout: 300,
- swipeThreshold: 20,
- swipeVelocity: 0.1,
- swipeTimeLimit: 1000,
- touchEndDelay: 150,
- menuOpenRestoreDelay: 50,
- wheelThreshold: 10
- }
- );
-
- $effect(() => {
- const direction = mobileNavInteractions.scrollDirection;
- const scrollY = mobileNavInteractions.scrollY;
-
- // Update interaction manager state
- mobileNavInteractions.updateState({
- menuOpen,
- scrollToHideEnabled,
- tapToHideEnabled
- });
-
- // Handle scroll effects
- mobileNavInteractions.handleScrollEffect(direction, scrollY);
- });
-
- // Make navigation bar visible when navigation sheet closes and ensure touch is restored
- let previousMenuOpen = $state(false);
- $effect(() => {
- const currentMenuOpen = menuOpen;
-
- // Handle menu state changes
- mobileNavInteractions.handleMenuStateChange(previousMenuOpen, currentMenuOpen);
-
- previousMenuOpen = currentMenuOpen;
- });
-
- // Update auto-hidden state
- $effect(() => {
- const newAutoHidden = !shouldShow;
- if (newAutoHidden !== autoHidden) {
- autoHidden = newAutoHidden;
- }
- });
-
- $effect(() => {
- if (navElement) {
- // Setup the element with the interaction manager
- mobileNavInteractions.setupElement(navElement);
-
- // Register this manager globally so settings can access it
- registerNavigationManager(mobileNavInteractions);
-
- // Return cleanup function
- return () => {
- mobileNavInteractions.cleanup();
- };
- }
- });
-</script>
-
-<nav
- bind:this={navElement}
- class={cn(
- 'mobile-nav-base mobile-nav-floating',
- 'fixed left-1/2 z-50 -translate-x-1/2 transform',
- 'bg-background/60 border-border/30 border backdrop-blur-xl',
- 'rounded-3xl shadow-sm',
- 'select-none', // Prevent text selection but allow touch
- 'transition-all duration-300 ease-out', // Smoother easing
- showLabels ? 'flex items-center gap-2 px-3 py-2' : 'flex items-center gap-3 px-4 py-2.5',
- shouldShow ? 'translate-y-0 scale-100 opacity-100' : 'translate-y-full scale-95 opacity-0',
- className
- )}
- data-testid="mobile-floating-nav"
- aria-label="Mobile navigation"
->
- {#each pinnedItems as item (item.url)}
- <MobileNavItem {item} {showLabels} active={currentPath === item.url || currentPath.startsWith(item.url + '/')} />
- {/each}
-</nav>
-
-<MobileNavSheet bind:open={menuOpen} {user} {versionInformation} />
diff --git a/frontend/src/lib/components/mobile-nav/mobile-nav-sheet.svelte b/frontend/src/lib/components/mobile-nav/mobile-nav-sheet.svelte
index 05876dc0f..b7bc7fd43 100644
--- a/frontend/src/lib/components/mobile-nav/mobile-nav-sheet.svelte
+++ b/frontend/src/lib/components/mobile-nav/mobile-nav-sheet.svelte
@@ -6,20 +6,24 @@
import { page } from '$app/state';
import userStore from '$lib/stores/user-store';
import { m } from '$lib/paraglide/messages';
- import { onMount } from 'svelte';
+ import { onMount, tick } from 'svelte';
import MobileUserCard from './mobile-user-card.svelte';
+ import { fly } from 'svelte/transition';
+ import { cubicOut } from 'svelte/easing';
let {
open = $bindable(false),
user = null,
- versionInformation = null
+ versionInformation = null,
+ navigationMode = 'floating'
}: {
open: boolean;
user?: any;
versionInformation?: any;
+ navigationMode?: 'floating' | 'docked';
} = $props();
- let menuElement: HTMLElement;
+ let menuElement = $state<HTMLElement | undefined>(undefined);
let storeUser: any = $state(null);
// Interaction state
@@ -27,6 +31,7 @@
isDragging: boolean;
dragDistance: number;
startY: number;
+ startX: number;
currentY: number;
inputType: 'touch' | 'wheel' | 'none';
isAtScrollTop: boolean;
@@ -39,6 +44,7 @@
isDragging: false,
dragDistance: 0,
startY: 0,
+ startX: 0,
currentY: 0,
inputType: 'none',
isAtScrollTop: true,
@@ -102,6 +108,7 @@
interaction.isDragging = false;
interaction.dragDistance = 0;
interaction.startY = 0;
+ interaction.startX = 0;
interaction.currentY = 0;
interaction.inputType = 'none';
interaction.canDragToClose = false;
@@ -132,54 +139,89 @@
const touch = e.touches[0];
const target = e.target as HTMLElement;
+
+ // Don't interfere with interactive elements
+ if (target.closest('button, a, input, select, textarea, [role="button"]')) {
+ return;
+ }
+
const isOnHandle = target.closest('[data-drag-handle]');
// Check current scroll position in real-time
const currentScrollTop = menuElement.scrollTop;
const isAtScrollTop = currentScrollTop === 0;
- // Initialize interaction state
+ // Initialize interaction state but don't start dragging yet
interaction.startY = touch.clientY;
+ interaction.startX = touch.clientX;
interaction.currentY = touch.clientY;
interaction.inputType = 'touch';
interaction.dragStartedFromHandle = !!isOnHandle;
- // Determine if we can drag to close (handle always works, content only at scroll top)
+ // Determine if we can drag to close (handle always qualifies, otherwise needs to be at top)
interaction.canDragToClose = !!isOnHandle || isAtScrollTop;
- if (interaction.canDragToClose) {
- interaction.isDragging = true;
- provideFeedback('grab');
- }
+ // Don't set isDragging yet - wait for touchmove to determine intent
+ interaction.isDragging = false;
+ interaction.dragDistance = 0;
}
function handleTouchMove(e: TouchEvent) {
- if (!open || isClosing || !interaction.isDragging) return;
+ if (!open || interaction.inputType !== 'touch') return;
const touch = e.touches[0];
interaction.currentY = touch.clientY;
+ const deltaY = interaction.currentY - interaction.startY;
+ const deltaX = touch.clientX - interaction.startX;
+
+ // Check if this is a horizontal swipe - if so, don't interfere
+ if (Math.abs(deltaX) > Math.abs(deltaY) && !interaction.isDragging) {
+ return;
+ }
// For handle-based drags, always allow
- // For content-based drags, ensure we're still at scroll top
+ // For content-based drags, ensure we're still at scroll top AND moving down
let canContinueDrag = interaction.dragStartedFromHandle;
if (!interaction.dragStartedFromHandle) {
- const currentScrollTop = menuElement.scrollTop;
+ const currentScrollTop = menuElement?.scrollTop ?? 0;
const isAtScrollTop = currentScrollTop === 0;
- canContinueDrag = isAtScrollTop;
+ // Only allow content drag if at top AND pulling down (not scrolling up)
+ canContinueDrag = isAtScrollTop && interaction.canDragToClose && deltaY > 0;
}
- // Calculate drag distance using unified physics
- const newDistance = calculateDragDistance(interaction.currentY);
+ // Only start dragging if moving downward past threshold and conditions allow
+ // Use larger threshold for content (15px) vs handle (5px)
+ const threshold = interaction.dragStartedFromHandle ? 5 : 15;
+
+ if (deltaY > threshold && canContinueDrag && !interaction.isDragging) {
+ // Now we can start dragging
+ interaction.isDragging = true;
+ provideFeedback('grab');
+ // Prevent default to stop background scroll
+ e.preventDefault();
+ }
- // Only update if dragging downward and we can continue the drag
- if (newDistance > 0 && canContinueDrag) {
- interaction.dragDistance = newDistance;
+ if (interaction.isDragging) {
+ // Prevent scrolling background when dragging
e.preventDefault();
- } else if (interaction.currentY < interaction.startY || !canContinueDrag) {
- // Reset if dragging upward or conditions no longer allow dragging
+
+ // Apply resistance
+ const rawDistance = Math.max(0, deltaY);
+ interaction.dragDistance = rawDistance * PHYSICS.resistanceFactor;
+ } else if (deltaY < 0 && menuElement) {
+ // Scrolling up - allow native scroll but prevent background interaction
+ // This ensures smooth scrolling within the sheet
+ const currentScrollTop = menuElement.scrollTop;
+ if (currentScrollTop === 0 && deltaY < 0) {
+ // At top and trying to scroll up more - prevent overscroll
+ e.preventDefault();
+ }
+ } else if (deltaY > threshold && !canContinueDrag) {
+ // Lost the conditions for dragging (e.g., scrolled down)
resetInteractionState();
}
+ // If not dragging, let the native scroll work (don't preventDefault)
}
function handleTouchEnd(e: TouchEvent) {
@@ -300,11 +342,13 @@
updateScrollPosition();
return () => {
- menuElement.removeEventListener('scroll', updateScrollPosition);
- menuElement.removeEventListener('touchstart', handleTouchStart);
- menuElement.removeEventListener('touchmove', handleTouchMove);
- menuElement.removeEventListener('touchend', handleTouchEnd);
- menuElement.removeEventListener('wheel', handleWheel);
+ if (menuElement) {
+ menuElement.removeEventListener('scroll', updateScrollPosition);
+ menuElement.removeEventListener('touchstart', handleTouchStart);
+ menuElement.removeEventListener('touchmove', handleTouchMove);
+ menuElement.removeEventListener('touchend', handleTouchEnd);
+ menuElement.removeEventListener('wheel', handleWheel);
+ }
};
}
});
@@ -328,56 +372,69 @@
};
});
- // Focus management and body scroll prevention for accessibility
+ // Proper body scroll locking that prevents background scroll but allows sheet scroll
$effect(() => {
- if (open) {
- // Prevent body scroll when menu is open but allow menu content to scroll
- const originalOverflow = document.body.style.overflow;
- const originalPosition = document.body.style.position;
- const originalTop = document.body.style.top;
- const originalWidth = document.body.style.width;
+ if (open && menuElement) {
+ // Store original styles
const scrollY = window.scrollY;
-
- // Properly lock the body while preserving menu scrollability
- document.body.style.overflow = 'hidden';
- document.body.style.position = 'fixed';
- document.body.style.top = `-${scrollY}px`;
- document.body.style.width = '100%';
- document.body.style.left = '0';
- document.body.style.right = '0';
-
- // Ensure the menu element can scroll independently
- if (menuElement) {
- // Reset any overflow restrictions that might interfere
+ const bodyStyle = document.body.style;
+ const htmlStyle = document.documentElement.style;
+
+ const originalBodyOverflow = bodyStyle.overflow;
+ const originalBodyPosition = bodyStyle.position;
+ const originalBodyTop = bodyStyle.top;
+ const originalBodyWidth = bodyStyle.width;
+ const originalHtmlOverflow = htmlStyle.overflow;
+
+ // Lock background scroll - iOS and desktop compatible
+ bodyStyle.overflow = 'hidden';
+ bodyStyle.position = 'fixed';
+ bodyStyle.top = `-${scrollY}px`;
+ bodyStyle.width = '100%';
+ bodyStyle.left = '0';
+ bodyStyle.right = '0';
+ htmlStyle.overflow = 'hidden';
+
+ // Wait for layout then setup sheet scrolling
+ tick().then(() => {
+ if (!menuElement || !open) return;
+
+ // Ensure the menu element can scroll independently
menuElement.style.overflowY = 'auto';
- // Disable momentum scrolling to prevent glidy feeling when closing
- (menuElement.style as any).webkitOverflowScrolling = 'auto';
- menuElement.style.touchAction = 'pan-y'; // Allow vertical scrolling only
+ menuElement.style.touchAction = 'pan-y';
+ (menuElement.style as any).webkitOverflowScrolling = 'touch';
+ // Force layout recalculation
+ void menuElement.offsetHeight;
- // Focus the menu container itself for accessibility without highlighting specific elements
+ // Focus for accessibility
requestAnimationFrame(() => {
- menuElement.focus();
+ if (menuElement && open) {
+ menuElement.focus();
+ }
});
- }
+ });
return () => {
- // Restore body scroll when menu closes
- document.body.style.overflow = originalOverflow;
- document.body.style.position = originalPosition;
- document.body.style.top = originalTop;
- document.body.style.width = originalWidth;
- document.body.style.left = '';
- document.body.style.right = '';
-
- // Restore scroll position
- window.scrollTo(0, scrollY);
-
- // Clean up menu styles
+ // Clean up menu styles immediately
if (menuElement) {
menuElement.style.overflowY = '';
- (menuElement.style as any).webkitOverflowScrolling = '';
menuElement.style.touchAction = '';
+ (menuElement.style as any).webkitOverflowScrolling = '';
}
+
+ // Restore immediately, not deferred
+ bodyStyle.overflow = originalBodyOverflow;
+ bodyStyle.position = originalBodyPosition;
+ bodyStyle.top = originalBodyTop;
+ bodyStyle.width = originalBodyWidth;
+ bodyStyle.left = '';
+ bodyStyle.right = '';
+ htmlStyle.overflow = originalHtmlOverflow;
+
+ // Restore scroll position after a single frame
+ requestAnimationFrame(() => {
+ window.scrollTo(0, scrollY);
+ });
};
}
});
@@ -396,7 +453,6 @@
}
</script>
-<!-- Backdrop -->
{#if open}
<div
class={cn(
@@ -405,7 +461,9 @@
)}
style={`
${interaction.isDragging && !isClosing ? `opacity: ${Math.max(0.1, 1 - interaction.dragDistance / 400)};` : ''}
- touch-action: manipulation;
+ touch-action: none;
+ -webkit-user-select: none;
+ user-select: none;
`}
onclick={() => {
provideFeedback('close');
@@ -417,197 +475,122 @@
open = false;
}
}}
- ontouchstart={(e) => {
- // Only prevent if touch is outside menu area
- if (!menuElement || !menuElement.contains(e.target as Node)) {
- e.preventDefault();
- }
- }}
- ontouchmove={(e) => {
- // Only prevent if touch is outside menu area
- if (!menuElement || !menuElement.contains(e.target as Node)) {
- e.preventDefault();
- }
- }}
aria-hidden="true"
role="presentation"
></div>
{/if}
<!-- Menu Content -->
-<div
- bind:this={menuElement}
- class={cn(
- 'bg-background/60 border-border/30 fixed inset-x-0 bottom-0 z-50 rounded-t-3xl border-t shadow-sm backdrop-blur-xl',
- 'transition-all duration-300 ease-[cubic-bezier(0.32,0.72,0,1)]',
- 'max-h-[85vh] overflow-y-auto overscroll-contain',
- open ? 'translate-y-0 opacity-100' : 'translate-y-full opacity-0',
- interaction.isDragging && !isClosing ? 'transition-none' : ''
- )}
- style={`
- touch-action: pan-y;
- -webkit-overflow-scrolling: touch;
- ${
- interaction.isDragging && !isClosing
- ? `transform: translateY(${interaction.dragDistance}px); opacity: ${Math.max(0.3, 1 - interaction.dragDistance / 300)};`
- : ''
- }
- `}
- data-testid="mobile-nav-sheet"
- role="dialog"
- aria-modal="true"
- aria-label="Main navigation sheet"
- aria-hidden={!open}
- tabindex={open ? 0 : -1}
->
- <!-- Handle indicator -->
- <div class="flex justify-center pt-4 pb-3" data-drag-handle>
- <div
- class={cn(
- 'h-1.5 w-10 rounded-full transition-all duration-150',
- interaction.isDragging && !isClosing ? 'bg-muted-foreground/50 h-2 w-12' : 'bg-muted-foreground/20',
- 'hover:bg-muted-foreground/30 active:bg-muted-foreground/50'
- )}
- style={`transform: ${interaction.isDragging && !isClosing ? 'scale(1.15)' : 'scale(1)'};
+{#if open}
+ <div
+ bind:this={menuElement}
+ transition:fly={{ y: 500, duration: 300, easing: cubicOut }}
+ class={cn(
+ 'bg-background/60 border-border/30 fixed inset-x-0 bottom-0 z-50 rounded-t-3xl border-t shadow-sm backdrop-blur-xl',
+ 'max-h-[85vh] overflow-y-auto',
+ interaction.isDragging && !isClosing ? 'transition-none' : ''
+ )}
+ style={`
+ touch-action: pan-y;
+ -webkit-overflow-scrolling: touch;
+ overscroll-behavior: contain;
+ ${
+ interaction.isDragging && !isClosing
+ ? `transform: translateY(${interaction.dragDistance}px); opacity: ${Math.max(0.3, 1 - interaction.dragDistance / 300)};`
+ : ''
+ }
+ `}
+ data-testid="mobile-nav-sheet"
+ role="dialog"
+ aria-modal="true"
+ aria-label="Main navigation sheet"
+ tabindex={0}
+ >
+ <!-- Handle indicator -->
+ <div class="flex justify-center pt-4 pb-3" data-drag-handle>
+ <div
+ class={cn(
+ 'h-1.5 w-10 rounded-full transition-all duration-150',
+ interaction.isDragging && !isClosing ? 'bg-muted-foreground/50 h-2 w-12' : 'bg-muted-foreground/20',
+ 'hover:bg-muted-foreground/30 active:bg-muted-foreground/50'
+ )}
+ style={`transform: ${interaction.isDragging && !isClosing ? 'scale(1.15)' : 'scale(1)'};
transition: transform 150ms cubic-bezier(0.34, 1.56, 0.64, 1), background-color 150ms ease;`}
- ></div>
- </div>
+ ></div>
+ </div>
- <div class="px-6 pb-8">
- <!-- User Profile Section -->
- {#if memoizedUser}
- <MobileUserCard user={memoizedUser} class="mb-6" />
- {/if}
-
- <!-- Navigation Sections -->
- <div class="space-y-8">
- <!-- Management -->
- <section>
- <h4 class="text-muted-foreground/70 mb-4 px-3 text-[11px] font-bold tracking-widest uppercase">
- {m.sidebar_management()}
- </h4>
- <div class="space-y-2">
- {#each navigationItems.managementItems as item}
- {@const IconComponent = item.icon}
- <a
- href={item.url}
- onclick={() => handleItemClick(item)}
- class={cn(
- 'flex items-center gap-3 rounded-2xl px-4 py-3 text-sm font-medium transition-all duration-200 ease-out',
- 'focus-visible:ring-muted-foreground/50 hover:scale-[1.01] focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:ring-offset-transparent',
- isActiveItem(item) ? 'bg-muted text-foreground hover:bg-muted/70 shadow-sm' : 'text-foreground hover:bg-muted/50'
- )}
- aria-current={isActiveItem(item) ? 'page' : undefined}
- >
- <IconComponent size={20} />
- <span>{item.title}</span>
- </a>
- {/each}
- </div>
- </section>
-
- <!-- Customization -->
- <section>
- <h4 class="text-muted-foreground/70 mb-4 px-3 text-[11px] font-bold tracking-widest uppercase">
- {m.sidebar_customization()}
- </h4>
- <div class="space-y-2">
- {#each navigationItems.customizationItems as item}
- {@const IconComponent = item.icon}
- <a
- href={item.url}
- onclick={() => handleItemClick(item)}
- class={cn(
- 'flex items-center gap-3 rounded-2xl px-4 py-3 text-sm font-medium transition-all duration-200 ease-out',
- 'focus-visible:ring-muted-foreground/50 hover:scale-[1.01] focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:ring-offset-transparent',
- isActiveItem(item) ? 'bg-muted text-foreground hover:bg-muted/70 shadow-sm' : 'text-foreground hover:bg-muted/50'
- )}
- aria-current={isActiveItem(item) ? 'page' : undefined}
- >
- <IconComponent size={20} />
- <span>{item.title}</span>
- </a>
- {/each}
- </div>
- </section>
-
- <!-- Admin Sections -->
- {#if memoizedIsAdmin}
- <!-- Environments -->
- {#if navigationItems.environmentItems}
- <section>
- <h4 class="text-muted-foreground/70 mb-4 px-3 text-[11px] font-bold tracking-widest uppercase">
- {m.sidebar_environments()}
- </h4>
- <div class="space-y-2">
- {#each navigationItems.environmentItems as item}
- {@const IconComponent = item.icon}
- <a
- href={item.url}
- onclick={() => handleItemClick(item)}
- class={cn(
- 'flex items-center gap-3 rounded-2xl px-4 py-3 text-sm font-medium transition-all duration-200 ease-out',
- isActiveItem(item)
- ? 'bg-muted text-foreground hover:bg-muted/70 shadow-sm'
- : 'text-foreground hover:bg-muted/50'
- )}
- >
- <IconComponent size={20} />
- <span>{item.title}</span>
- </a>
- {/each}
- </div>
- </section>
- {/if}
+ <div class="px-6 pb-4">
+ <!-- User Profile Section -->
+ {#if memoizedUser}
+ <MobileUserCard user={memoizedUser} class="mb-6" />
+ {/if}
- <!-- Administration -->
- {#if navigationItems.settingsItems}
- <section>
- <h4 class="text-muted-foreground/70 mb-4 px-3 text-[11px] font-bold tracking-widest uppercase">
- {m.sidebar_administration()}
- </h4>
- <div class="space-y-2">
- {#each navigationItems.settingsItems as item}
- {#if item.items}
- <!-- Settings with subitems -->
- {@const IconComponent = item.icon}
- <div class="space-y-2">
- <a
- href={item.url}
- onclick={() => handleItemClick(item)}
- class={cn(
- 'flex items-center gap-3 rounded-2xl px-4 py-3 text-sm font-medium transition-all duration-200 ease-out',
- isActiveItem(item)
- ? 'bg-muted text-foreground hover:bg-muted/70 shadow-sm'
- : 'text-foreground hover:bg-muted/50'
- )}
- >
- <IconComponent size={20} />
- <span>{item.title}</span>
- </a>
- <!-- Sub-items -->
- <div class="ml-6 space-y-1">
- {#each item.items as subItem}
- {@const SubIconComponent = subItem.icon}
- <a
- href={subItem.url}
- onclick={() => handleItemClick(subItem)}
- class={cn(
- 'flex items-center gap-3 rounded-xl px-4 py-2 text-sm transition-all duration-200 ease-out',
- 'focus-visible:ring-muted-foreground/50 hover:scale-[1.01] focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:ring-offset-transparent',
- isActiveItem(subItem)
- ? 'bg-muted/70 text-foreground shadow-sm'
- : 'text-muted-foreground hover:text-foreground hover:bg-muted/40'
- )}
- aria-current={isActiveItem(subItem) ? 'page' : undefined}
- >
- <SubIconComponent size={16} />
- <span>{subItem.title}</span>
- </a>
- {/each}
- </div>
- </div>
- {:else}
+ <!-- Navigation Sections -->
+ <div class="space-y-8">
+ <!-- Management -->
+ <section>
+ <h4 class="text-muted-foreground/70 mb-4 px-3 text-[11px] font-bold tracking-widest uppercase">
+ {m.sidebar_management()}
+ </h4>
+ <div class="space-y-2">
+ {#each navigationItems.managementItems as item}
+ {@const IconComponent = item.icon}
+ <a
+ href={item.url}
+ onclick={() => handleItemClick(item)}
+ class={cn(
+ 'flex items-center gap-3 rounded-2xl px-4 py-3 text-sm font-medium transition-all duration-200 ease-out',
+ 'focus-visible:ring-muted-foreground/50 hover:scale-[1.01] focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:ring-offset-transparent',
+ isActiveItem(item)
+ ? 'bg-muted text-foreground hover:bg-muted/70 shadow-sm'
+ : 'text-foreground hover:bg-muted/50'
+ )}
+ aria-current={isActiveItem(item) ? 'page' : undefined}
+ >
+ <IconComponent size={20} />
+ <span>{item.title}</span>
+ </a>
+ {/each}
+ </div>
+ </section>
+
+ <!-- Customization -->
+ <section>
+ <h4 class="text-muted-foreground/70 mb-4 px-3 text-[11px] font-bold tracking-widest uppercase">
+ {m.sidebar_customization()}
+ </h4>
+ <div class="space-y-2">
+ {#each navigationItems.customizationItems as item}
+ {@const IconComponent = item.icon}
+ <a
+ href={item.url}
+ onclick={() => handleItemClick(item)}
+ class={cn(
+ 'flex items-center gap-3 rounded-2xl px-4 py-3 text-sm font-medium transition-all duration-200 ease-out',
+ 'focus-visible:ring-muted-foreground/50 hover:scale-[1.01] focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:ring-offset-transparent',
+ isActiveItem(item)
+ ? 'bg-muted text-foreground hover:bg-muted/70 shadow-sm'
+ : 'text-foreground hover:bg-muted/50'
+ )}
+ aria-current={isActiveItem(item) ? 'page' : undefined}
+ >
+ <IconComponent size={20} />
+ <span>{item.title}</span>
+ </a>
+ {/each}
+ </div>
+ </section>
+
+ <!-- Admin Sections -->
+ {#if memoizedIsAdmin}
+ <!-- Environments -->
+ {#if navigationItems.environmentItems}
+ <section>
+ <h4 class="text-muted-foreground/70 mb-4 px-3 text-[11px] font-bold tracking-widest uppercase">
+ {m.sidebar_environments()}
+ </h4>
+ <div class="space-y-2">
+ {#each navigationItems.environmentItems as item}
{@const IconComponent = item.icon}
<a
href={item.url}
@@ -622,56 +605,114 @@
<IconComponent size={20} />
<span>{item.title}</span>
</a>
- {/if}
- {/each}
- </div>
- </section>
- {/if}
- {/if}
- </div>
+ {/each}
+ </div>
+ </section>
+ {/if}
- <!-- Version Information -->
- {#if versionInformation}
- <div class="border-border/30 mt-6 border-t pt-4">
- <div class="text-muted-foreground/60 text-center text-xs">
- <p class="font-medium">Arcane v{versionInformation.currentVersion}</p>
- {#if versionInformation.updateAvailable}
- <p class="text-primary/80 mt-1 font-medium">Update available</p>
+ <!-- Administration -->
+ {#if navigationItems.settingsItems}
+ <section>
+ <h4 class="text-muted-foreground/70 mb-4 px-3 text-[11px] font-bold tracking-widest uppercase">
+ {m.sidebar_administration()}
+ </h4>
+ <div class="space-y-2">
+ {#each navigationItems.settingsItems as item}
+ {#if item.items}
+ <!-- Settings with subitems -->
+ {@const IconComponent = item.icon}
+ <div class="space-y-2">
+ <a
+ href={item.url}
+ onclick={() => handleItemClick(item)}
+ class={cn(
+ 'flex items-center gap-3 rounded-2xl px-4 py-3 text-sm font-medium transition-all duration-200 ease-out',
+ isActiveItem(item)
+ ? 'bg-muted text-foreground hover:bg-muted/70 shadow-sm'
+ : 'text-foreground hover:bg-muted/50'
+ )}
+ >
+ <IconComponent size={20} />
+ <span>{item.title}</span>
+ </a>
+ <!-- Sub-items -->
+ <div class="ml-6 space-y-1">
+ {#each item.items as subItem}
+ {@const SubIconComponent = subItem.icon}
+ <a
+ href={subItem.url}
+ onclick={() => handleItemClick(subItem)}
+ class={cn(
+ 'flex items-center gap-3 rounded-xl px-4 py-2 text-sm transition-all duration-200 ease-out',
+ 'focus-visible:ring-muted-foreground/50 hover:scale-[1.01] focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:ring-offset-transparent',
+ isActiveItem(subItem)
+ ? 'bg-muted/70 text-foreground shadow-sm'
+ : 'text-muted-foreground hover:text-foreground hover:bg-muted/40'
+ )}
+ aria-current={isActiveItem(subItem) ? 'page' : undefined}
+ >
+ <SubIconComponent size={16} />
+ <span>{subItem.title}</span>
+ </a>
+ {/each}
+ </div>
+ </div>
+ {:else}
+ {@const IconComponent = item.icon}
+ <a
+ href={item.url}
+ onclick={() => handleItemClick(item)}
+ class={cn(
+ 'flex items-center gap-3 rounded-2xl px-4 py-3 text-sm font-medium transition-all duration-200 ease-out',
+ isActiveItem(item)
+ ? 'bg-muted text-foreground hover:bg-muted/70 shadow-sm'
+ : 'text-foreground hover:bg-muted/50'
+ )}
+ >
+ <IconComponent size={20} />
+ <span>{item.title}</span>
+ </a>
+ {/if}
+ {/each}
+ </div>
+ </section>
{/if}
- </div>
+ {/if}
</div>
- {/if}
+
+ <!-- Version Information -->
+ {#if versionInformation}
+ <div class={cn('border-border/30 mt-6 border-t pt-4', navigationMode === 'docked' ? 'pb-24' : 'pb-6')}>
+ <div class="text-muted-foreground/60 text-center text-xs">
+ <p class="font-medium">Arcane v{versionInformation.currentVersion}</p>
+ {#if versionInformation.updateAvailable}
+ <p class="text-primary/80 mt-1 font-medium">Update available</p>
+ {/if}
+ </div>
+ </div>
+ {:else}
+ <!-- Add padding even if no version info to prevent content hiding behind nav -->
+ <div class="pb-20"></div>
+ {/if}
+ </div>
</div>
-</div>
+{/if}
<style>
/* Ensure smooth scrolling and prevent overscroll issues */
- @supports (overscroll-behavior: contain) {
- div[data-testid='mobile-nav-sheet'] {
- overscroll-behavior: contain;
- }
+ div[data-testid='mobile-nav-sheet'] {
+ overscroll-behavior: contain;
+ /* Prevent white background showing through */
+ background-clip: padding-box;
+ /* Ensure smooth momentum scrolling on iOS */
+ -webkit-overflow-scrolling: touch;
+ /* Force GPU acceleration */
+ transform: translateZ(0);
+ will-change: transform, opacity;
}
/* Remove focus outline from dialog container since it's focused for accessibility */
div[data-testid='mobile-nav-sheet']:focus {
outline: none;
}
-
- /* Respect reduced motion preferences */
- @media (prefers-reduced-motion: reduce) {
- div[data-testid='mobile-nav-sheet'] {
- transition: none;
- }
-
- /* Instantly show/hide without animation */
- div[data-testid='mobile-nav-sheet']:not([aria-hidden='true']) {
- transform: translateY(0);
- opacity: 1;
- }
-
- div[data-testid='mobile-nav-sheet'][aria-hidden='true'] {
- transform: translateY(100%);
- opacity: 0;
- }
- }
</style>
diff --git a/frontend/src/lib/components/mobile-nav/mobile-nav.svelte b/frontend/src/lib/components/mobile-nav/mobile-nav.svelte
new file mode 100644
index 000000000..c00ee7182
--- /dev/null
+++ b/frontend/src/lib/components/mobile-nav/mobile-nav.svelte
@@ -0,0 +1,262 @@
+<script lang="ts">
+ import { page } from '$app/state';
+ import { untrack } from 'svelte';
+ import type { NavigationItem, MobileNavigationSettings } from '$lib/config/navigation-config';
+ import { getAvailableMobileNavItems } from '$lib/config/navigation-config';
+ import MobileNavItem from './mobile-nav-item.svelte';
+ import { cn } from '$lib/utils';
+ import { SwipeGestureDetector, type SwipeDirection } from '$lib/hooks/use-swipe-gesture.svelte';
+ import MobileNavSheet from './mobile-nav-sheet.svelte';
+ import { m } from '$lib/paraglide/messages';
+ import './styles.css';
+
+ let {
+ navigationSettings,
+ user = null,
+ versionInformation = null,
+ class: className = ''
+ }: {
+ navigationSettings: MobileNavigationSettings;
+ user?: any;
+ versionInformation?: any;
+ class?: string;
+ } = $props();
+
+ const pinnedItems = $derived.by(() => {
+ const availableItems = getAvailableMobileNavItems();
+ return navigationSettings.pinnedItems
+ .map((url) => availableItems.find((item) => item.url === url))
+ .filter((item) => item !== undefined);
+ });
+
+ const currentPath = $derived(page.url.pathname);
+ const showLabels = $derived(navigationSettings.showLabels);
+ const scrollToHideEnabled = $derived(navigationSettings.scrollToHide);
+ const mode = $derived(navigationSettings.mode);
+
+ let visible = $state(true);
+ let menuOpen = $state(false);
+ let lastScrollY = $state(0);
+ let navElement: HTMLElement;
+ let scrollTimeout: ReturnType<typeof setTimeout> | null = null;
+
+ // Touch gesture detection variables
+ let touchStartY: number | null = null;
+ let isInteractiveTouch = false;
+ const touchMoveThreshold = 6;
+
+ // Touch-based detection for immediate hide/show
+ $effect(() => {
+ if (typeof window === 'undefined') return;
+ if (!scrollToHideEnabled) return;
+
+ const handleTouchStart = (e: TouchEvent) => {
+ if (menuOpen) return;
+ const t = e.touches?.[0];
+ if (!t) return;
+ const target = e.target as HTMLElement | null;
+
+ if (target && target.closest && target.closest('button, a, input, select, textarea, [role="button"], [contenteditable]')) {
+ isInteractiveTouch = true;
+ touchStartY = null;
+ return;
+ }
+ isInteractiveTouch = false;
+ touchStartY = t.clientY;
+ };
+
+ const handleTouchMove = (e: TouchEvent) => {
+ if (menuOpen || isInteractiveTouch || touchStartY === null) return;
+ const t = e.touches?.[0];
+ if (!t) return;
+ const deltaY = t.clientY - touchStartY;
+ if (Math.abs(deltaY) < touchMoveThreshold) return;
+
+ if (deltaY < 0) {
+ visible = false;
+ } else {
+ visible = true;
+ }
+
+ touchStartY = t.clientY;
+ };
+
+ const handleTouchEnd = () => {
+ touchStartY = null;
+ isInteractiveTouch = false;
+ };
+
+ const options = { passive: true, capture: true };
+ window.addEventListener('touchstart', handleTouchStart, options);
+ window.addEventListener('touchmove', handleTouchMove, options);
+ window.addEventListener('touchend', handleTouchEnd, options);
+
+ return () => {
+ window.removeEventListener('touchstart', handleTouchStart, options);
+ window.removeEventListener('touchmove', handleTouchMove, options);
+ window.removeEventListener('touchend', handleTouchEnd, options);
+ };
+ });
+
+ // Swipe gesture detector for opening menu
+ const swipeDetector = new SwipeGestureDetector(
+ (direction: SwipeDirection) => {
+ if (direction === 'up') {
+ menuOpen = true;
+ }
+ },
+ {
+ threshold: 20,
+ velocity: 0.1,
+ timeLimit: 1000
+ }
+ );
+
+ // Improved scroll-to-hide using native scroll events with passive listeners
+ $effect(() => {
+ if (typeof window === 'undefined') return;
+ if (!scrollToHideEnabled || menuOpen) {
+ visible = true;
+ return;
+ }
+
+ const scrollThreshold = 10;
+ const minScrollDistance = 80;
+
+ const handleScroll = () => {
+ const currentScrollY = window.scrollY;
+ const prevScrollY = lastScrollY;
+ const scrollDiff = currentScrollY - prevScrollY;
+
+ if (scrollTimeout) {
+ clearTimeout(scrollTimeout);
+ scrollTimeout = null;
+ }
+
+ const scrollHeight = document.documentElement.scrollHeight;
+ const clientHeight = document.documentElement.clientHeight;
+ const atBottom = currentScrollY + clientHeight >= scrollHeight - 5;
+
+ if (scrollDiff < 0 && !atBottom) {
+ visible = true;
+ lastScrollY = currentScrollY;
+ } else if (scrollDiff > scrollThreshold && currentScrollY > minScrollDistance && !atBottom) {
+ visible = false;
+ lastScrollY = currentScrollY;
+ } else if (Math.abs(scrollDiff) > scrollThreshold) {
+ lastScrollY = currentScrollY;
+ }
+
+ if (!atBottom) {
+ scrollTimeout = setTimeout(() => {
+ if (window.scrollY < minScrollDistance) {
+ visible = true;
+ }
+ }, 150);
+ }
+ };
+
+ window.addEventListener('scroll', handleScroll, { passive: true });
+
+ return () => {
+ window.removeEventListener('scroll', handleScroll);
+ if (scrollTimeout) {
+ clearTimeout(scrollTimeout);
+ }
+ };
+ });
+
+ // Show nav when menu closes
+ $effect(() => {
+ if (!menuOpen) {
+ visible = true;
+ }
+ });
+
+ // Setup swipe gesture detection on nav element
+ $effect(() => {
+ if (navElement) {
+ swipeDetector.setElement(navElement);
+ return () => {
+ swipeDetector.setElement(null);
+ };
+ }
+ });
+
+ // Keep page padding in sync with nav height via CSS variables
+ $effect(() => {
+ if (!navElement || typeof document === 'undefined') return;
+
+ const root = document.documentElement;
+ const cssVarName = mode === 'floating' ? '--mobile-floating-nav-offset' : '--mobile-docked-nav-offset';
+
+ const applyOffset = () => {
+ if (mode === 'floating') {
+ const rect = navElement.getBoundingClientRect();
+ const computed = window.getComputedStyle(navElement);
+ const bottomGap = parseFloat(computed.bottom || '0') || 0;
+ const offset = rect.height + bottomGap;
+ root.style.setProperty(cssVarName, `${offset}px`);
+ } else {
+ root.style.setProperty(cssVarName, `${navElement.offsetHeight}px`);
+ }
+ };
+
+ applyOffset();
+
+ let observer: ResizeObserver | null = null;
+ if (typeof ResizeObserver !== 'undefined') {
+ observer = new ResizeObserver(() => applyOffset());
+ observer.observe(navElement);
+ }
+
+ const handleResize = mode === 'floating' ? () => applyOffset() : null;
+ if (handleResize && typeof window !== 'undefined') {
+ window.addEventListener('resize', handleResize);
+ window.visualViewport?.addEventListener('resize', handleResize);
+ }
+
+ return () => {
+ observer?.disconnect();
+ if (handleResize && typeof window !== 'undefined') {
+ window.removeEventListener('resize', handleResize);
+ window.visualViewport?.removeEventListener('resize', handleResize);
+ }
+ root.style.removeProperty(cssVarName);
+ };
+ });
+
+ // Mode-specific styles
+ const navClasses = $derived(
+ cn(
+ 'mobile-nav-base',
+ mode === 'floating' ? 'mobile-nav-floating' : 'mobile-nav-docked',
+ mode === 'floating' ? 'fixed left-1/2 z-50 -translate-x-1/2 transform' : 'fixed bottom-0 left-0 right-0 z-50 gap-2',
+ 'bg-background/60 border-border/30 backdrop-blur-xl',
+ 'shadow-sm select-none transition-all duration-300 ease-out',
+ 'flex items-center',
+ mode === 'floating'
+ ? cn('rounded-3xl border', showLabels ? 'gap-2 px-3 py-2' : 'gap-3 px-4 py-2.5')
+ : cn('border-t border-border/50 justify-around', showLabels ? 'px-3 py-2' : 'px-3 py-2.5'),
+ visible
+ ? mode === 'floating'
+ ? 'translate-y-0 scale-100 opacity-100'
+ : 'translate-y-0 opacity-100'
+ : mode === 'floating'
+ ? 'translate-y-full scale-95 opacity-0'
+ : 'translate-y-full opacity-0',
+ className
+ )
+ );
+
+ const ariaLabel = $derived(mode === 'docked' ? m.mobile_navigation() : 'Mobile navigation');
+ const testId = $derived(mode === 'floating' ? 'mobile-floating-nav' : 'mobile-docked-nav');
+</script>
+
+<nav bind:this={navElement} class={navClasses} data-testid={testId} aria-label={ariaLabel}>
+ {#each pinnedItems as item (item.url)}
+ <MobileNavItem {item} {showLabels} active={currentPath === item.url || currentPath.startsWith(item.url + '/')} />
+ {/each}
+</nav>
+
+<MobileNavSheet bind:open={menuOpen} {user} {versionInformation} navigationMode={mode} />
diff --git a/frontend/src/lib/components/mobile-nav/mobile-user-card.svelte b/frontend/src/lib/components/mobile-nav/mobile-user-card.svelte
index 61a5e7bf7..50d85e395 100644
--- a/frontend/src/lib/components/mobile-nav/mobile-user-card.svelte
+++ b/frontend/src/lib/components/mobile-nav/mobile-user-card.svelte
@@ -62,7 +62,7 @@
}
</script>
-<div class={`bg-muted/30 border-border/20 overflow-hidden rounded-3xl border ${className}`}>
+<div class={`bg-muted/30 border-border dark:border-border/20 overflow-hidden rounded-3xl border-2 ${className}`}>
<button
class="hover:bg-muted/40 flex w-full items-center gap-4 p-5 text-left transition-all duration-200"
onclick={() => (userCardExpanded = !userCardExpanded)}
diff --git a/frontend/src/lib/components/mobile-nav/styles.css b/frontend/src/lib/components/mobile-nav/styles.css
index ccfda07ef..680f5a7bf 100644
--- a/frontend/src/lib/components/mobile-nav/styles.css
+++ b/frontend/src/lib/components/mobile-nav/styles.css
@@ -3,11 +3,10 @@
/* Base navigation styles */
.mobile-nav-base {
pointer-events: auto;
- /* Prevent browser's default touch gestures but allow custom ones */
- touch-action: none;
- -webkit-overflow-scrolling: touch;
+ /* Capture vertical gestures so opening the sheet doesn't scroll the page while still allowing horizontal swipes and pinch zoom */
+ touch-action: pan-x pinch-zoom;
overscroll-behavior: contain;
- /* Isolate touch interactions similar to pointer device behavior */
+ /* Isolate touch interactions */
isolation: isolate;
/* Hardware acceleration for smooth animations */
will-change: transform, opacity;
@@ -16,6 +15,13 @@
/* Smooth subpixel rendering */
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
+ /* Ensure it stays fixed to viewport, not page content */
+ position: fixed;
+ /* Prevent the nav from being affected by virtual keyboard */
+ transform: translate3d(0, 0, 0);
+ backface-visibility: hidden;
+ /* Prevent body scroll leak */
+ contain: layout style paint;
}
/* Floating navigation specific positioning */
@@ -29,8 +35,8 @@
.mobile-nav-docked {
/* Safe area handling for devices with home indicators */
padding-bottom: env(safe-area-inset-bottom);
- /* Ensure minimum padding even without safe area */
- padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
+ /* Keep it anchored to bottom */
+ bottom: 0;
}
/* Shared button/link styles */
diff --git a/frontend/src/lib/components/sheets/create-container-sheet.svelte b/frontend/src/lib/components/sheets/create-container-sheet.svelte
index 857820adc..15f5fa0e8 100644
--- a/frontend/src/lib/components/sheets/create-container-sheet.svelte
+++ b/frontend/src/lib/components/sheets/create-container-sheet.svelte
@@ -502,7 +502,7 @@
{#each portMappings as mapping, index (index)}
<div class="flex items-center gap-3">
<div class="flex flex-1 items-center gap-2">
- <div class="text-muted-foreground min-w-12 whitespace-nowrap text-sm">{m.port_label_host()}</div>
+ <div class="text-muted-foreground min-w-12 text-sm whitespace-nowrap">{m.port_label_host()}</div>
<Input
type="text"
placeholder="8080"
@@ -513,7 +513,7 @@
</div>
<span class="text-muted-foreground">→</span>
<div class="flex flex-1 items-center gap-2">
- <div class="text-muted-foreground min-w-20 whitespace-nowrap text-sm">
+ <div class="text-muted-foreground min-w-20 text-sm whitespace-nowrap">
{m.port_label_container()}
</div>
<Input
diff --git a/frontend/src/lib/hooks/use-mobile-nav-interactions.ts b/frontend/src/lib/hooks/use-mobile-nav-interactions.ts
index add3e65b7..b9ee981f8 100644
--- a/frontend/src/lib/hooks/use-mobile-nav-interactions.ts
+++ b/frontend/src/lib/hooks/use-mobile-nav-interactions.ts
@@ -162,28 +162,22 @@ export class MobileNavInteractionManager {
// Store touch start target and check if it's interactive
this.touchStartTarget = e.target as HTMLElement;
- this.isInteractiveTouch = !!this.touchStartTarget.closest('button, a, [role="button"]');
+ this.isInteractiveTouch = !!this.touchStartTarget.closest('button, a, [role="button"], input, select, textarea');
- // Only prevent background scrolling for gesture interactions
- if (!this.isInteractiveTouch) {
- this.lockBodyScroll();
- e.stopPropagation();
- }
+ // Don't prevent default or lock scrolling - let native behavior work
+ // The CSS touch-action: pan-y will handle this properly
};
const handleTouchMove = (e: TouchEvent) => {
const shouldPreventTouch = this.callbacks.shouldPreventTouch?.(this.state.menuOpen);
if (shouldPreventTouch) return;
- // Always prevent default for touchmove to stop page scrolling
- e.preventDefault();
- e.stopPropagation();
-
- // If touch started on an interactive element, check if still on it
+ // Don't prevent default - let native scrolling work
+ // Only track if we moved off an interactive element
if (this.isInteractiveTouch) {
const touch = e.touches[0];
const target = document.elementFromPoint(touch.clientX, touch.clientY) as HTMLElement;
- const stillOnInteractive = target && target.closest('button, a, [role="button"]');
+ const stillOnInteractive = target && target.closest('button, a, [role="button"], input, select, textarea');
if (!stillOnInteractive) {
// Moved off interactive element, treat as gesture
@@ -193,21 +187,13 @@ export class MobileNavInteractionManager {
};
const handleTouchEnd = (e: TouchEvent) => {
- // Always restore scrolling after a brief delay
- setTimeout(() => {
- // Only restore if menu is still closed, or if menu just opened
- if (!this.state.menuOpen || Date.now() - this.lastGestureTime < 500) {
- this.unlockBodyScroll();
- }
- }, this.options.touchEndDelay);
-
// Reset touch state
this.touchStartTarget = null;
this.isInteractiveTouch = false;
};
- element.addEventListener('touchstart', handleTouchStart, { passive: false, capture: false });
- element.addEventListener('touchmove', handleTouchMove, { passive: false, capture: false });
+ element.addEventListener('touchstart', handleTouchStart, { passive: true, capture: false });
+ element.addEventListener('touchmove', handleTouchMove, { passive: true, capture: false });
element.addEventListener('touchend', handleTouchEnd, { passive: true, capture: false });
// Store cleanup functions
@@ -220,43 +206,22 @@ export class MobileNavInteractionManager {
private setupMouseHandlers(element: HTMLElement) {
const handleWheel = (e: WheelEvent) => {
- e.preventDefault();
- e.stopPropagation();
-
- // Only respond to downward gestures
+ // Don't prevent default - let page scroll naturally
+ // Only respond to downward gestures on the navbar itself to open menu
if (e.deltaY > this.options.wheelThreshold) {
this.callbacks.onMenuOpen();
}
};
- const handleDocumentWheel = (e: WheelEvent) => {
- // Only prevent scrolling if the event is NOT on the navbar
- if (!element.contains(e.target as Node)) {
- e.preventDefault();
- e.stopPropagation();
- }
- };
-
const handleMouseEnter = () => {
- // Prevent page scrolling except on navbar when hovering navbar
- document.addEventListener('wheel', handleDocumentWheel, { passive: false, capture: true });
- element.addEventListener('wheel', handleWheel, { passive: false });
-
- // Prevent page body scrolling and capture pointer
- this.lockBodyScroll();
- document.body.style.pointerEvents = 'none';
- element.style.pointerEvents = 'auto';
+ // Don't lock scrolling or manipulate pointer events
+ // Just listen for wheel events on the navbar
+ element.addEventListener('wheel', handleWheel, { passive: true });
};
const handleMouseLeave = () => {
- // Restore page scrolling when leaving navbar
- document.removeEventListener('wheel', handleDocumentWheel, true);
+ // Clean up wheel listener
element.removeEventListener('wheel', handleWheel);
-
- // Restore scrolling and interactions
- this.unlockBodyScroll();
- document.body.style.pointerEvents = '';
- element.style.pointerEvents = '';
};
element.addEventListener('mouseenter', handleMouseEnter);
@@ -267,7 +232,6 @@ export class MobileNavInteractionManager {
element.removeEventListener('mouseenter', handleMouseEnter);
element.removeEventListener('mouseleave', handleMouseLeave);
element.removeEventListener('wheel', handleWheel);
- document.removeEventListener('wheel', handleDocumentWheel, true);
});
}
@@ -303,23 +267,6 @@ export class MobileNavInteractionManager {
this.state.visible = true;
this.callbacks.onVisibilityChange(true);
}
-
- // If menu just opened, ensure touch scrolling is restored for the menu
- if (!previousMenuOpen && currentMenuOpen) {
- setTimeout(() => {
- this.unlockBodyScroll();
- }, this.options.menuOpenRestoreDelay);
- }
- }
-
- public lockBodyScroll() {
- document.body.style.overflow = 'hidden';
- document.documentElement.style.overflow = 'hidden';
- }
-
- public unlockBodyScroll() {
- document.body.style.overflow = '';
- document.documentElement.style.overflow = '';
}
public cleanup() {
@@ -327,21 +274,23 @@ export class MobileNavInteractionManager {
this.cleanupFunctions.forEach((fn) => fn());
this.cleanupFunctions = [];
+ // Cleanup scroll detector
+ this.scrollDetector.cleanup();
+
// Clear tap debounce timeout
if (this.tapDebounceTimeoutId) {
clearTimeout(this.tapDebounceTimeoutId);
this.tapDebounceTimeoutId = null;
}
- // Always ensure all mouse interactions are unlocked during cleanup
- this.unlockBodyScroll();
- document.body.style.pointerEvents = '';
+ // Clean up any remaining styles
+ if (document.body) {
+ document.body.style.pointerEvents = '';
+ }
if (this.navElement) {
this.navElement.style.pointerEvents = '';
}
-
- // Clean up any remaining overlay
}
// Getters for accessing detectors
diff --git a/frontend/src/lib/hooks/use-scroll-direction.svelte.ts b/frontend/src/lib/hooks/use-scroll-direction.svelte.ts
index 48990846c..2b7d16663 100644
--- a/frontend/src/lib/hooks/use-scroll-direction.svelte.ts
+++ b/frontend/src/lib/hooks/use-scroll-direction.svelte.ts
@@ -1,82 +1,81 @@
-import { onMount } from 'svelte';
+import { untrack } from 'svelte';
export type ScrollDirection = 'up' | 'down' | 'idle';
export class ScrollDirectionDetector {
- private lastScrollY = $state(0);
- private scrollDirection = $state<ScrollDirection>('idle');
- private isScrolling = $state(false);
- private scrollThreshold = 10; // Minimum pixels to trigger direction change
- private scrollTimeout: number | null = null;
+ private _lastScrollY = $state(0);
+ private _scrollDirection = $state<ScrollDirection>('idle');
+ private _isScrolling = $state(false);
+ private scrollThreshold = 10;
+ private scrollTimeout: ReturnType<typeof setTimeout> | null = null;
+ private cleanupFn: (() => void) | null = null;
+ private initialized = false;
constructor(threshold = 10) {
this.scrollThreshold = threshold;
+ }
+
+ private init() {
+ if (this.initialized || typeof window === 'undefined') return;
+ this.initialized = true;
- onMount(() => {
- this.lastScrollY = window.scrollY;
+ this._lastScrollY = window.scrollY;
- const handleScroll = this.throttle(() => {
- const currentScrollY = window.scrollY;
- const scrollDiff = currentScrollY - this.lastScrollY;
+ const handleScroll = () => {
+ const currentScrollY = window.scrollY;
+ const scrollDiff = currentScrollY - untrack(() => this._lastScrollY);
- // Only update direction if scroll difference exceeds threshold
- if (Math.abs(scrollDiff) > this.scrollThreshold) {
- const newDirection = scrollDiff > 0 ? 'down' : 'up';
+ if (Math.abs(scrollDiff) > this.scrollThreshold) {
+ const newDirection: ScrollDirection = scrollDiff > 0 ? 'down' : 'up';
- // Only update if direction actually changed to avoid unnecessary re-renders
- if (this.scrollDirection !== newDirection) {
- this.scrollDirection = newDirection;
- }
- this.lastScrollY = currentScrollY;
+ if (untrack(() => this._scrollDirection) !== newDirection) {
+ this._scrollDirection = newDirection;
}
+ this._lastScrollY = currentScrollY;
+ }
- this.isScrolling = true;
+ this._isScrolling = true;
- // Clear existing timeout
- if (this.scrollTimeout) {
- clearTimeout(this.scrollTimeout);
- }
+ if (this.scrollTimeout) {
+ clearTimeout(this.scrollTimeout);
+ }
- // Set idle state after scrolling stops
- this.scrollTimeout = window.setTimeout(() => {
- if (this.scrollDirection !== 'idle') {
- this.scrollDirection = 'idle';
- }
- this.isScrolling = false;
- }, 150);
- }, 16); // ~60fps throttling
-
- window.addEventListener('scroll', handleScroll, { passive: true });
-
- return () => {
- window.removeEventListener('scroll', handleScroll);
- if (this.scrollTimeout) {
- clearTimeout(this.scrollTimeout);
- }
- };
- });
+ this.scrollTimeout = setTimeout(() => {
+ this._scrollDirection = 'idle';
+ this._isScrolling = false;
+ }, 150);
+ };
+
+ window.addEventListener('scroll', handleScroll, { passive: true });
+
+ this.cleanupFn = () => {
+ window.removeEventListener('scroll', handleScroll);
+ if (this.scrollTimeout) {
+ clearTimeout(this.scrollTimeout);
+ }
+ };
+ }
+
+ cleanup() {
+ if (this.cleanupFn) {
+ this.cleanupFn();
+ this.cleanupFn = null;
+ }
+ this.initialized = false;
}
get direction() {
- return this.scrollDirection;
+ this.init();
+ return this._scrollDirection;
}
get scrolling() {
- return this.isScrolling;
+ this.init();
+ return this._isScrolling;
}
get scrollY() {
- return this.lastScrollY;
- }
-
- private throttle<T extends (...args: any[]) => void>(func: T, limit: number): T {
- let inThrottle: boolean;
- return ((...args: any[]) => {
- if (!inThrottle) {
- func.apply(this, args);
- inThrottle = true;
- setTimeout(() => (inThrottle = false), limit);
- }
- }) as T;
+ this.init();
+ return this._lastScrollY;
}
}
diff --git a/frontend/src/lib/hooks/use-swipe-gesture.svelte.ts b/frontend/src/lib/hooks/use-swipe-gesture.svelte.ts
index 089c42a2e..36661288b 100644
--- a/frontend/src/lib/hooks/use-swipe-gesture.svelte.ts
+++ b/frontend/src/lib/hooks/use-swipe-gesture.svelte.ts
@@ -21,9 +21,9 @@ export class SwipeGestureDetector {
constructor(onSwipe: (direction: SwipeDirection, details: SwipeDetails) => void, options: SwipeGestureOptions = {}) {
this.onSwipe = onSwipe;
this.options = {
- threshold: options.threshold ?? 30,
- velocity: options.velocity ?? 0.2,
- timeLimit: options.timeLimit ?? 1000
+ threshold: options.threshold ?? 50,
+ velocity: options.velocity ?? 0.3,
+ timeLimit: options.timeLimit ?? 500
};
onMount(() => {
@@ -74,36 +74,12 @@ export class SwipeGestureDetector {
const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY);
const velocity = distance / deltaTime;
- // Check if gesture meets distance OR velocity thresholds (more forgiving)
- // Lower both thresholds when user achieves one of them
+ // Check if gesture meets thresholds
+ // More lenient: meet either distance OR velocity threshold
const meetsDistanceThreshold = distance >= this.options.threshold;
const meetsVelocityThreshold = velocity >= this.options.velocity;
- // More responsive: allow smaller distance if velocity is good, or smaller velocity if distance is good
- const responsiveDistanceThreshold = meetsVelocityThreshold ? this.options.threshold * 0.6 : this.options.threshold;
- const responsiveVelocityThreshold = meetsDistanceThreshold ? this.options.velocity * 0.6 : this.options.velocity;
-
- const meetsAdjustedDistance = distance >= responsiveDistanceThreshold;
- const meetsAdjustedVelocity = velocity >= responsiveVelocityThreshold;
-
- if (!meetsAdjustedDistance && !meetsAdjustedVelocity) return;
-
- // If the gesture started on an interactive element, require more deliberate movement
- // to distinguish between taps and swipes
- if (this.isInteractiveTouch) {
- // For interactive elements, require either:
- // 1. Significant distance (at least 25px) OR
- // 2. Good velocity with some distance (at least 15px)
- const minDistanceForInteractive = 25;
- const minDistanceWithVelocity = 15;
-
- const hasSignificantDistance = distance >= minDistanceForInteractive;
- const hasGoodVelocityWithDistance = distance >= minDistanceWithVelocity && velocity >= this.options.velocity;
-
- if (!hasSignificantDistance && !hasGoodVelocityWithDistance) {
- return; // Likely a tap, not a swipe
- }
- }
+ if (!meetsDistanceThreshold && !meetsVelocityThreshold) return;
// Determine primary direction
const absDeltaX = Math.abs(deltaX);
@@ -124,52 +100,15 @@ export class SwipeGestureDetector {
duration: deltaTime
};
- // Stop momentum and prevent default for valid swipe gestures only if body isn't already locked
- const shouldLockScrolling = document.body.style.overflow !== 'hidden';
-
- if (shouldLockScrolling) {
- document.body.style.overflow = 'hidden';
- document.documentElement.style.overflow = 'hidden';
- }
-
this.onSwipe(direction, details);
-
- // Restore scrolling after gesture is processed, but only if we locked it
- if (shouldLockScrolling) {
- setTimeout(() => {
- document.body.style.overflow = '';
- document.documentElement.style.overflow = '';
- }, 100);
- }
-
- // For interactive elements, only prevent default if this was clearly a swipe gesture
- // This allows button clicks to still work for small movements
- if (this.isInteractiveTouch) {
- // Only prevent if the movement was significant enough to be a clear swipe
- if (distance >= 20) {
- e.preventDefault();
- e.stopPropagation();
- }
- } else {
- // Always prevent for non-interactive areas
- e.preventDefault();
- e.stopPropagation();
- }
};
- element.addEventListener('touchstart', handleTouchStart, { passive: false });
- element.addEventListener('touchend', handleTouchEnd, { passive: false });
+ element.addEventListener('touchstart', handleTouchStart, { passive: true });
+ element.addEventListener('touchend', handleTouchEnd, { passive: true });
this.cleanupFn = () => {
element.removeEventListener('touchstart', handleTouchStart);
element.removeEventListener('touchend', handleTouchEnd);
- // Only restore overflow if it was set to 'hidden' - don't override other styles
- if (document.body.style.overflow === 'hidden') {
- document.body.style.overflow = '';
- }
- if (document.documentElement.style.overflow === 'hidden') {
- document.documentElement.style.overflow = '';
- }
};
}
}
diff --git a/frontend/src/routes/+layout.svelte b/frontend/src/routes/+layout.svelte
index 6003b0b19..5e9cafea4 100644
--- a/frontend/src/routes/+layout.svelte
+++ b/frontend/src/routes/+layout.svelte
@@ -6,7 +6,7 @@
import ConfirmDialog from '$lib/components/confirm-dialog/confirm-dialog.svelte';
import * as Sidebar from '$lib/components/ui/sidebar/index.js';
import AppSidebar from '$lib/components/sidebar/sidebar.svelte';
- import { goto } from '$app/navigation';
+ import { goto, afterNavigate } from '$app/navigation';
import { getAuthRedirectPath } from '$lib/utils/redirect.util';
import LoadingIndicator from '$lib/components/loading-indicator.svelte';
import type { LayoutData } from './$types';
@@ -14,8 +14,8 @@
import Error from '$lib/components/error.svelte';
import { m } from '$lib/paraglide/messages';
import { IsMobile } from '$lib/hooks/is-mobile.svelte.js';
- import MobileFloatingNav from '$lib/components/mobile-nav/mobile-floating-nav.svelte';
- import MobileDockedNav from '$lib/components/mobile-nav/mobile-docked-nav.svelte';
+ import { IsTablet } from '$lib/hooks/is-tablet.svelte.js';
+ import MobileNav from '$lib/components/mobile-nav/mobile-nav.svelte';
import { getEffectiveNavigationSettings, navigationSettingsOverridesStore } from '$lib/utils/navigation.utils';
import { browser, dev } from '$app/environment';
import { onMount } from 'svelte';
@@ -37,6 +37,7 @@
const { versionInformation, user, settings } = data;
const isMobile = new IsMobile();
+ const isTablet = new IsTablet();
const isNavigating = $derived(navigating.type !== null);
const isOnboardingPage = $derived(String(page.url.pathname).startsWith('/onboarding'));
@@ -58,6 +59,18 @@
if (redirectPath) {
goto(redirectPath);
}
+
+ if (browser) {
+ afterNavigate((event) => {
+ if (!event.from) {
+ return;
+ }
+
+ if (isMobile.current || isTablet.current) {
+ window.scrollTo({ top: 0, left: 0, behavior: 'auto' });
+ }
+ });
+ }
</script>
<svelte:head><title>{m.layout_title()}</title></svelte:head>
@@ -69,17 +82,21 @@
{#if isMobile.current}
<main class="flex-1">
<section
- class={`px-2 py-5 sm:p-5 ${navigationMode === 'docked' ? 'pb-6' : 'pb-24'}`}
- style={navigationMode === 'docked' ? 'padding-bottom: max(1.5rem, calc(4rem + env(safe-area-inset-bottom)))' : ''}
+ class={navigationMode === 'docked'
+ ? navigationSettings.scrollToHide
+ ? 'px-2 pt-5 sm:px-5 sm:pt-5'
+ : 'px-2 pt-5 sm:p-5'
+ : 'px-2 py-5 sm:p-5'}
+ style={navigationMode === 'docked' && !navigationSettings.scrollToHide
+ ? 'padding-bottom: var(--mobile-docked-nav-offset, calc(3.5rem + env(safe-area-inset-bottom)));'
+ : navigationMode === 'floating' && !navigationSettings.scrollToHide
+ ? 'padding-bottom: var(--mobile-floating-nav-offset, 6rem);'
+ : ''}
>
{@render children()}
</section>
</main>
- {#if navigationMode === 'floating'}
- <MobileFloatingNav {navigationSettings} {user} {versionInformation} />
- {:else}
- <MobileDockedNav {navigationSettings} {user} {versionInformation} />
- {/if}
+ <MobileNav {navigationSettings} {user} {versionInformation} />
{:else}
<Sidebar.Provider>
<AppSidebar {versionInformation} {user} />
diff --git a/frontend/src/routes/customize/templates/[id]/+page.svelte b/frontend/src/routes/customize/templates/[id]/+page.svelte
index 80b22e6ed..cef135720 100644
--- a/frontend/src/routes/customize/templates/[id]/+page.svelte
+++ b/frontend/src/routes/customize/templates/[id]/+page.svelte
@@ -96,9 +96,9 @@
</Button>
<div>
- <h1 class="break-words text-xl font-bold sm:text-2xl">{template.name}</h1>
+ <h1 class="text-xl font-bold break-words sm:text-2xl">{template.name}</h1>
{#if template.description}
- <p class="text-muted-foreground mt-1.5 break-words text-sm sm:text-base">{template.description}</p>
+ <p class="text-muted-foreground mt-1.5 text-sm break-words sm:text-base">{template.description}</p>
{/if}
</div>
@@ -168,7 +168,7 @@
<BoxIcon class="size-6 text-blue-500" />
</div>
<div class="min-w-0 flex-1">
- <div class="text-muted-foreground text-xs font-semibold uppercase tracking-wide">{m.compose_services()}</div>
+ <div class="text-muted-foreground text-xs font-semibold tracking-wide uppercase">{m.compose_services()}</div>
<div class="mt-1">
<div class="text-2xl font-bold">{services.length}</div>
</div>
@@ -182,7 +182,7 @@
<FileTextIcon class="size-6 text-purple-500" />
</div>
<div class="min-w-0 flex-1">
- <div class="text-muted-foreground text-xs font-semibold uppercase tracking-wide">
+ <div class="text-muted-foreground text-xs font-semibold tracking-wide uppercase">
{m.common_environment_variables()}
</div>
<div class="mt-1 flex flex-wrap items-baseline gap-2">
@@ -207,7 +207,7 @@
</div>
</Card.Header>
<Card.Content class="min-h-[500px] flex-grow p-0 lg:h-full">
- <div class="h-full rounded-b-xl rounded-t-none [&_.cm-content]:text-xs sm:[&_.cm-content]:text-sm">
+ <div class="h-full rounded-t-none rounded-b-xl [&_.cm-content]:text-xs sm:[&_.cm-content]:text-sm">
<CodeEditor bind:value={compose} language="yaml" readOnly={true} />
</div>
</Card.Content>
@@ -253,9 +253,9 @@
{#each envVars as envVar}
<Card.Root variant="subtle" class="min-w-0">
<Card.Content class="flex min-w-0 flex-col gap-2 p-3">
- <div class="text-muted-foreground truncate text-xs font-semibold uppercase tracking-wide">{envVar.key}</div>
+ <div class="text-muted-foreground truncate text-xs font-semibold tracking-wide uppercase">{envVar.key}</div>
{#if envVar.value}
- <div class="text-foreground min-w-0 select-all break-words font-mono text-sm">{envVar.value}</div>
+ <div class="text-foreground min-w-0 font-mono text-sm break-words select-all">{envVar.value}</div>
{:else}
<div class="text-muted-foreground text-xs italic">{m.common_no_default_value()}</div>
{/if}
diff --git a/frontend/src/routes/customize/templates/components/RegistryManager.svelte b/frontend/src/routes/customize/templates/components/RegistryManager.svelte
index 5c9ecf6cc..9278a7d6c 100644
--- a/frontend/src/routes/customize/templates/components/RegistryManager.svelte
+++ b/frontend/src/routes/customize/templates/components/RegistryManager.svelte
@@ -75,7 +75,7 @@
{registry.enabled ? m.common_enabled() : m.common_disabled()}
</Badge>
</div>
- <p class="text-muted-foreground break-all text-sm">{registry.url}</p>
+ <p class="text-muted-foreground text-sm break-all">{registry.url}</p>
{#if registry.description}
<p class="text-muted-foreground mt-1 text-sm">{registry.description}</p>
{/if}
diff --git a/frontend/src/routes/customize/templates/template-table.svelte b/frontend/src/routes/customize/templates/template-table.svelte
index 776d8a785..c6bc67e31 100644
--- a/frontend/src/routes/customize/templates/template-table.svelte
+++ b/frontend/src/routes/customize/templates/template-table.svelte
@@ -256,7 +256,7 @@
<TagIcon class="size-3.5 text-purple-500" />
</div>
<div class="min-w-0 flex-1">
- <div class="text-muted-foreground text-[10px] font-medium uppercase tracking-wide">
+ <div class="text-muted-foreground text-[10px] font-medium tracking-wide uppercase">
{m.common_tags()}
</div>
<div class="mt-1 flex flex-wrap gap-1">
diff --git a/frontend/src/routes/images/[imageId]/+page.svelte b/frontend/src/routes/images/[imageId]/+page.svelte
index 9b9eb109e..e7d564f8a 100644
--- a/frontend/src/routes/images/[imageId]/+page.svelte
+++ b/frontend/src/routes/images/[imageId]/+page.svelte
@@ -157,9 +157,9 @@
<div class="flex size-10 shrink-0 items-center justify-center rounded-full bg-orange-500/10 p-2">
<CpuIcon class="size-5 text-orange-500" />
</div>
- <div class="min-w-0 flex-1">
- <p class="text-muted-foreground text-sm font-medium">{m.common_architecture()}</p>
- <p class="mt-1 cursor-pointer text-sm font-semibold select-all sm:text-base" title="Click to select">
+ <div class="min-w-0 flex-1">
+ <p class="text-muted-foreground text-sm font-medium">{m.common_architecture()}</p>
+ <p class="mt-1 cursor-pointer text-sm font-semibold select-all sm:text-base" title="Click to select">
{architecture()}
</p>
</div>