Skip to content

Modern Docker Management, Designed for Everyone

feat: mobile navigation (#537)

Chase Baucom49dc5073b9ee
diff --git a/backend/internal/dto/settings_dto.go b/backend/internal/dto/settings_dto.go
index 3f837f362..d8228f2ad 100644
--- a/backend/internal/dto/settings_dto.go
+++ b/backend/internal/dto/settings_dto.go
@@ -32,4 +32,10 @@ type UpdateSettingsDto struct {
// Onboarding settings
OnboardingCompleted *string `json:"onboardingCompleted,omitempty"`
OnboardingSteps *string `json:"onboardingSteps,omitempty"`
+
+ // Navigation settings
+ MobileNavigationMode *string `json:"mobileNavigationMode,omitempty"`
+ MobileNavigationShowLabels *string `json:"mobileNavigationShowLabels,omitempty"`
+ MobileNavigationScrollToHide *string `json:"mobileNavigationScrollToHide,omitempty"`
+ MobileNavigationTapToHide *string `json:"mobileNavigationTapToHide,omitempty"`
}
diff --git a/backend/internal/models/settings.go b/backend/internal/models/settings.go
index 6b4848616..54e6bb8e7 100644
--- a/backend/internal/models/settings.go
+++ b/backend/internal/models/settings.go
@@ -64,6 +64,12 @@ type Settings struct {
OnboardingCompleted SettingVariable `key:"onboardingCompleted,public"`
OnboardingSteps SettingVariable `key:"onboardingSteps"`
+ // Navigation
+ MobileNavigationMode SettingVariable `key:"mobileNavigationMode,public"`
+ MobileNavigationShowLabels SettingVariable `key:"mobileNavigationShowLabels,public"`
+ MobileNavigationScrollToHide SettingVariable `key:"mobileNavigationScrollToHide,public"`
+ MobileNavigationTapToHide SettingVariable `key:"mobileNavigationTapToHide,public"`
+
InstanceID SettingVariable `key:"instanceId,internal"`
}
diff --git a/backend/internal/services/settings_service.go b/backend/internal/services/settings_service.go
index 80c02655b..67decfaef 100644
--- a/backend/internal/services/settings_service.go
+++ b/backend/internal/services/settings_service.go
@@ -76,21 +76,25 @@ func (s *SettingsService) LoadDatabaseSettings(ctx context.Context) (err error)
func (s *SettingsService) getDefaultSettings() *models.Settings {
return &models.Settings{
- ProjectsDirectory: models.SettingVariable{Value: "data/projects"},
- AutoUpdate: models.SettingVariable{Value: "false"},
- AutoUpdateInterval: models.SettingVariable{Value: "1440"},
- PollingEnabled: models.SettingVariable{Value: "true"},
- PollingInterval: models.SettingVariable{Value: "60"},
- PruneMode: models.SettingVariable{Value: "dangling"},
- BaseServerURL: models.SettingVariable{Value: "http://localhost"},
- EnableGravatar: models.SettingVariable{Value: "true"},
- AuthLocalEnabled: models.SettingVariable{Value: "true"},
- AuthOidcEnabled: models.SettingVariable{Value: "false"},
- AuthSessionTimeout: models.SettingVariable{Value: "1440"},
- AuthPasswordPolicy: models.SettingVariable{Value: "strong"},
- AuthOidcConfig: models.SettingVariable{Value: "{}"},
- OnboardingCompleted: models.SettingVariable{Value: "false"},
- OnboardingSteps: models.SettingVariable{Value: "[]"},
+ ProjectsDirectory: models.SettingVariable{Value: "data/projects"},
+ AutoUpdate: models.SettingVariable{Value: "false"},
+ AutoUpdateInterval: models.SettingVariable{Value: "1440"},
+ PollingEnabled: models.SettingVariable{Value: "true"},
+ PollingInterval: models.SettingVariable{Value: "60"},
+ PruneMode: models.SettingVariable{Value: "dangling"},
+ BaseServerURL: models.SettingVariable{Value: "http://localhost"},
+ EnableGravatar: models.SettingVariable{Value: "true"},
+ AuthLocalEnabled: models.SettingVariable{Value: "true"},
+ AuthOidcEnabled: models.SettingVariable{Value: "false"},
+ AuthSessionTimeout: models.SettingVariable{Value: "1440"},
+ AuthPasswordPolicy: models.SettingVariable{Value: "strong"},
+ AuthOidcConfig: models.SettingVariable{Value: "{}"},
+ OnboardingCompleted: models.SettingVariable{Value: "false"},
+ OnboardingSteps: models.SettingVariable{Value: "[]"},
+ MobileNavigationMode: models.SettingVariable{Value: "floating"},
+ MobileNavigationShowLabels: models.SettingVariable{Value: "true"},
+ MobileNavigationScrollToHide: models.SettingVariable{Value: "true"},
+ MobileNavigationTapToHide: models.SettingVariable{Value: "false"},
InstanceID: models.SettingVariable{Value: ""},
}
diff --git a/frontend/messages/en.json b/frontend/messages/en.json
index bf5832be1..1be909887 100644
--- a/frontend/messages/en.json
+++ b/frontend/messages/en.json
@@ -318,7 +318,7 @@
"common_disabled": "Disabled",
"common_online": "Online",
"common_offline": "Offline",
- "environments_title": "Environment Management",
+ "environments_title": "Environments",
"environments_subtitle": "Manage and monitor your Arcane environments",
"environments_remove_selected_button": "Remove Selected",
"environments_add_button": "Add Environment",
@@ -1062,5 +1062,34 @@
"custom_polling_interval": "Custom Polling Interval (minutes)",
"build_cache": "Build Cache",
"ui_config_disabled_title": "UI configuration is disabled",
- "ui_config_disabled_description": "Settings must be managed via environment variables."
+ "ui_config_disabled_description": "Settings must be managed via environment variables.",
+ "navigation_title": "Navigation",
+ "navigation_description": "Customize navigation behavior and appearance",
+ "navigation_mobile_behavior_title": "Mobile Behavior",
+ "navigation_mobile_behavior_description": "Configure global defaults and personal overrides for mobile behavior",
+ "navigation_mobile_appearance_title": "Mobile Appearance",
+ "navigation_mobile_appearance_description": "Configure the visual style and presentation of mobile interface",
+ "navigation_mode_label": "Navigation Mode",
+ "navigation_mode_description": "Choose between floating navigation that overlays content or docked navigation that takes up screen space",
+ "navigation_mode_floating": "Floating",
+ "navigation_mode_docked": "Docked",
+ "navigation_show_labels_label": "Show Labels",
+ "navigation_show_labels_description": "Display text labels below navigation icons for better clarity and accessibility",
+ "navigation_scroll_to_hide_label": "Scroll to Hide",
+ "navigation_scroll_to_hide_description": "Automatically hide the navigation bar when scrolling down for a cleaner viewing experience",
+ "navigation_tap_to_hide_label": "Tap to Hide",
+ "navigation_tap_to_hide_description": "Allow users to tap outside the navigation area to quickly show or hide the navigation bar",
+ "navigation_settings_saved": "Navigation settings saved successfully",
+ "server_default": "Server Default",
+ "applies_to_all_users": "Applies to all users",
+ "this_device": "This Device",
+ "override": "Override",
+ "current_state": "Current State",
+ "local_override": "Local Override",
+ "clear_local_override": "Clear local override",
+ "overriding_server_default": "Overriding server default",
+ "using_server_default": "Using server default",
+ "mobile_navigation": "Mobile navigation",
+ "on": "On",
+ "off": "Off"
}
diff --git a/frontend/src/app.css b/frontend/src/app.css
index 4ce639e0a..6dde6ed63 100644
--- a/frontend/src/app.css
+++ b/frontend/src/app.css
@@ -169,4 +169,3 @@ main {
html {
scrollbar-gutter: stable;
}
-
diff --git a/frontend/src/app.html b/frontend/src/app.html
index 8b1552c99..2513d5b39 100644
--- a/frontend/src/app.html
+++ b/frontend/src/app.html
@@ -3,8 +3,10 @@
<head>
<meta charset="utf-8" />
<link rel="icon" href="%sveltekit.assets%/img/arcane.png" />
- <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
+ <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, viewport-fit=cover" />
<link rel="manifest" href="%sveltekit.assets%/app.webmanifest" />
+ <meta name="theme-color" content="oklch(1 0 0)" media="(prefers-color-scheme: light)" />
+ <meta name="theme-color" content="oklch(0.141 0.005 285.823)" media="(prefers-color-scheme: dark)" />
%sveltekit.head%
</head>
<body data-sveltekit-preload-data="hover">
diff --git a/frontend/src/lib/components/action-buttons.svelte b/frontend/src/lib/components/action-buttons.svelte
index 42872d20d..59f0fe0d9 100644
--- a/frontend/src/lib/components/action-buttons.svelte
+++ b/frontend/src/lib/components/action-buttons.svelte
@@ -7,6 +7,8 @@
import { ArcaneButton } from '$lib/components/arcane-button/index.js';
import ProgressPopover from '$lib/components/progress-popover.svelte';
import DownloadIcon from '@lucide/svelte/icons/download';
+ import EllipsisIcon from '@lucide/svelte/icons/ellipsis';
+ import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';
import { environmentStore, LOCAL_DOCKER_ENVIRONMENT_ID } from '$lib/stores/environment.store';
import { get } from 'svelte/store';
import { m } from '$lib/paraglide/messages';
@@ -414,59 +416,118 @@
}
</script>
-<div class="flex items-center gap-2">
- {#if !isRunning}
+<div>
+ <!-- Desktop / tablet buttons -->
+ <div class="hidden items-center gap-2 sm:flex">
+ {#if !isRunning}
+ {#if type === 'container'}
+ <ArcaneButton action="start" onclick={() => handleStart()} loading={uiLoading.start} />
+ {:else}
+ <ProgressPopover
+ bind:open={deployPullPopoverOpen}
+ bind:progress={pullProgress}
+ title={m.progress_pulling_images()}
+ statusText={pullStatusText}
+ error={pullError}
+ loading={deployPulling}
+ icon={DownloadIcon}
+ >
+ <ArcaneButton action="deploy" onclick={() => handleDeploy()} loading={uiLoading.start} />
+ </ProgressPopover>
+ {/if}
+ {/if}
+
+ {#if isRunning}
+ <ArcaneButton
+ action="stop"
+ customLabel={type === 'project' ? (m.action_down ? m.action_down() : 'Down') : undefined}
+ onclick={() => handleStop()}
+ loading={uiLoading.stop}
+ />
+ <ArcaneButton action="restart" onclick={() => handleRestart()} loading={uiLoading.restart} />
+ {/if}
+
{#if type === 'container'}
- <ArcaneButton action="start" onclick={() => handleStart()} loading={uiLoading.start} />
+ <ArcaneButton action="remove" onclick={() => confirmAction('remove')} loading={uiLoading.remove} />
{:else}
- <ProgressPopover
- bind:open={deployPullPopoverOpen}
- bind:progress={pullProgress}
- title={m.progress_pulling_images()}
- statusText={pullStatusText}
- error={pullError}
- loading={deployPulling}
- icon={DownloadIcon}
- >
- <ArcaneButton action="deploy" onclick={() => handleDeploy()} loading={uiLoading.start} />
- </ProgressPopover>
+ <ArcaneButton action="redeploy" onclick={() => confirmAction('redeploy')} loading={uiLoading.redeploy} />
+
+ {#if type === 'project'}
+ <ProgressPopover
+ bind:open={pullPopoverOpen}
+ bind:progress={pullProgress}
+ title={m.progress_pulling_images()}
+ statusText={pullStatusText}
+ error={pullError}
+ loading={projectPulling}
+ icon={DownloadIcon}
+ >
+ <ArcaneButton action="pull" onclick={() => handleProjectPull()} loading={projectPulling} />
+ </ProgressPopover>
+ {/if}
+
+ <ArcaneButton
+ customLabel={type === 'project' ? m.compose_destroy() : m.common_remove()}
+ action="remove"
+ onclick={() => confirmAction('remove')}
+ loading={uiLoading.remove}
+ />
{/if}
- {/if}
-
- {#if isRunning}
- <ArcaneButton
- action="stop"
- customLabel={type === 'project' ? (m.action_down ? m.action_down() : 'Down') : undefined}
- onclick={() => handleStop()}
- loading={uiLoading.stop}
- />
- <ArcaneButton action="restart" onclick={() => handleRestart()} loading={uiLoading.restart} />
- {/if}
-
- {#if type === 'container'}
- <ArcaneButton action="remove" onclick={() => confirmAction('remove')} loading={uiLoading.remove} />
- {:else}
- <ArcaneButton action="redeploy" onclick={() => confirmAction('redeploy')} loading={uiLoading.redeploy} />
-
- {#if type === 'project'}
- <ProgressPopover
- bind:open={pullPopoverOpen}
- bind:progress={pullProgress}
- title={m.progress_pulling_images()}
- statusText={pullStatusText}
- error={pullError}
- loading={projectPulling}
- icon={DownloadIcon}
+ </div>
+
+ <!-- Mobile: ellipsis dropdown -->
+ <div class="flex items-center sm:hidden">
+ <DropdownMenu.Root>
+ <DropdownMenu.Trigger class="bg-background/70 flex inline-flex size-9 items-center justify-center rounded-lg border">
+ <span class="sr-only">{m.common_open_menu()}</span>
+ <EllipsisIcon />
+ </DropdownMenu.Trigger>
+
+ <DropdownMenu.Content
+ align="end"
+ class="bg-card/80 supports-[backdrop-filter]:bg-card/60 z-50 min-w-[180px] rounded-md p-1 shadow-lg backdrop-blur-sm supports-[backdrop-filter]:backdrop-blur-sm"
>
- <ArcaneButton action="pull" onclick={() => handleProjectPull()} loading={projectPulling} />
- </ProgressPopover>
- {/if}
-
- <ArcaneButton
- customLabel={type === 'project' ? m.compose_destroy() : m.common_remove()}
- action="remove"
- onclick={() => confirmAction('remove')}
- loading={uiLoading.remove}
- />
- {/if}
+ <DropdownMenu.Group>
+ {#if !isRunning}
+ {#if type === 'container'}
+ <DropdownMenu.Item onclick={handleStart} disabled={uiLoading.start}>
+ {m.common_start()}
+ </DropdownMenu.Item>
+ {:else}
+ <DropdownMenu.Item onclick={handleDeploy} disabled={uiLoading.start}>
+ {m.action_up()}
+ </DropdownMenu.Item>
+ {/if}
+ {:else}
+ <DropdownMenu.Item onclick={handleStop} disabled={uiLoading.stop}>
+ {type === 'project' && m.action_down ? m.action_down() : m.common_stop()}
+ </DropdownMenu.Item>
+ <DropdownMenu.Item onclick={handleRestart} disabled={uiLoading.restart}>
+ {m.common_restart()}
+ </DropdownMenu.Item>
+ {/if}
+
+ {#if type === 'container'}
+ <DropdownMenu.Item onclick={() => confirmAction('remove')} disabled={uiLoading.remove}>
+ {m.common_remove()}
+ </DropdownMenu.Item>
+ {:else}
+ <DropdownMenu.Item onclick={() => confirmAction('redeploy')} disabled={uiLoading.redeploy}>
+ {m.action_redeploy()}
+ </DropdownMenu.Item>
+
+ {#if type === 'project'}
+ <DropdownMenu.Item onclick={handleProjectPull} disabled={projectPulling || uiLoading.pulling}>
+ {m.images_pull()}
+ </DropdownMenu.Item>
+ {/if}
+
+ <DropdownMenu.Item onclick={() => confirmAction('remove')} disabled={uiLoading.remove}>
+ {type === 'project' ? m.compose_destroy() : m.common_remove()}
+ </DropdownMenu.Item>
+ {/if}
+ </DropdownMenu.Group>
+ </DropdownMenu.Content>
+ </DropdownMenu.Root>
+ </div>
</div>
diff --git a/frontend/src/lib/components/dialogs/template-selection-dialog.svelte b/frontend/src/lib/components/dialogs/template-selection-dialog.svelte
index 9b1474b35..58e83e063 100644
--- a/frontend/src/lib/components/dialogs/template-selection-dialog.svelte
+++ b/frontend/src/lib/components/dialogs/template-selection-dialog.svelte
@@ -388,6 +388,7 @@
<style>
.line-clamp-2 {
display: -webkit-box;
+ line-clamp: 2;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
diff --git a/frontend/src/lib/components/locale-picker.svelte b/frontend/src/lib/components/locale-picker.svelte
new file mode 100644
index 000000000..54edb3b90
--- /dev/null
+++ b/frontend/src/lib/components/locale-picker.svelte
@@ -0,0 +1,95 @@
+<script lang="ts">
+ import * as Select from '$lib/components/ui/select/index.js';
+ import { getLocale, type Locale } from '$lib/paraglide/runtime';
+ import { m } from '$lib/paraglide/messages';
+ import userStore from '$lib/stores/user-store';
+ import { setLocale } from '$lib/utils/locale.util';
+ import { Label } from '$lib/components/ui/label/index.js';
+ import { userService } from '$lib/services/user-service';
+
+ let {
+ inline = false,
+ id = 'localePicker',
+ class: className = '',
+ onOpenChange
+ }: {
+ inline?: boolean;
+ id?: string;
+ class?: string;
+ onOpenChange?: (open: boolean) => void;
+ } = $props();
+
+ const currentLocale = $state(getLocale());
+ let isOpen = $state(false);
+
+ const locales: Record<string, string> = {
+ en: 'English',
+ eo: 'Esperanto',
+ es: 'Español',
+ fr: 'Français',
+ nl: 'Nederlands',
+ zh: 'Chinese'
+ };
+
+ async function updateLocale(locale: Locale) {
+ try {
+ if ($userStore) {
+ await userService.update($userStore.id, { ...$userStore, locale });
+ }
+ await setLocale(locale);
+ } catch (err) {
+ console.error('Failed to update locale', err);
+ }
+ }
+</script>
+
+<div class={`locale-picker ${className}`}>
+ {#if inline}
+ <Select.Root
+ type="single"
+ value={currentLocale}
+ onValueChange={(v) => updateLocale(v as Locale)}
+ open={isOpen}
+ onOpenChange={(open) => {
+ isOpen = open;
+ onOpenChange?.(open);
+ }}
+ >
+ <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="max-w-[280px] min-w-[160px]">
+ {#each Object.entries(locales) as [value, label]}
+ <Select.Item class="text-sm" {value}>{label}</Select.Item>
+ {/each}
+ </Select.Content>
+ </Select.Root>
+ {:else}
+ <div class="px-3 py-2">
+ <div class="grid gap-2">
+ <Label for={id} class="text-sm leading-none font-medium">
+ {m.language()}
+ </Label>
+ <Select.Root
+ type="single"
+ value={currentLocale}
+ onValueChange={(v) => updateLocale(v as Locale)}
+ open={isOpen}
+ onOpenChange={(open) => {
+ isOpen = open;
+ onOpenChange?.(open);
+ }}
+ >
+ <Select.Trigger {id} class="h-9 w-full justify-between" aria-label={m.common_select_locale()}>
+ <span class="truncate">{locales[currentLocale]}</span>
+ </Select.Trigger>
+ <Select.Content>
+ {#each Object.entries(locales) as [value, label]}
+ <Select.Item {value}>{label}</Select.Item>
+ {/each}
+ </Select.Content>
+ </Select.Root>
+ </div>
+ </div>
+ {/if}
+</div>
diff --git a/frontend/src/lib/components/meter-metric.svelte b/frontend/src/lib/components/meter-metric.svelte
index ddacdd403..647b974e0 100644
--- a/frontend/src/lib/components/meter-metric.svelte
+++ b/frontend/src/lib/components/meter-metric.svelte
@@ -34,19 +34,20 @@
<div
class="bg-card/80 supports-[backdrop-filter]:bg-card/60 ring-border/40 group relative
- isolate overflow-hidden rounded-xl border
- shadow-sm ring-1 ring-inset
- backdrop-blur-sm transition-all duration-300 hover:shadow-md dark:shadow-none"
+ isolate flex aspect-square flex-col
+ overflow-hidden rounded-xl border
+ shadow-sm ring-1 ring-inset backdrop-blur-sm transition-all
+ duration-300 hover:shadow-md sm:aspect-auto dark:shadow-none"
>
- <div class="bg-gradient-to-br from-gray-50 to-slate-50/30 p-4 dark:from-gray-900/20 dark:to-slate-900/10">
+ <div class="flex-none bg-gradient-to-br from-gray-50 to-slate-50/30 p-3 sm:p-4 dark:from-gray-900/20 dark:to-slate-900/10">
<div class="flex items-center gap-3">
<div
- class="from-primary to-primary/80 shadow-primary/25 flex h-10 w-10 items-center justify-center rounded-full bg-gradient-to-br shadow-lg"
+ class="from-primary to-primary/80 shadow-primary/25 flex h-8 w-8 items-center justify-center rounded-full bg-gradient-to-br shadow-lg sm:h-10 sm:w-10"
>
{#if loading}
- <LoaderCircleIcon class="size-5 animate-spin text-white" />
+ <LoaderCircleIcon class="size-4 animate-spin text-white sm:size-5" />
{:else}
- <Icon class="size-5 text-white" />
+ <Icon class="size-4 text-white sm:size-5" />
{/if}
</div>
<div class="min-w-0 flex-1">
@@ -58,20 +59,20 @@
</div>
</div>
- <div class="bg-card/90 p-4">
- <div class="space-y-3">
+ <div class="bg-card/90 flex flex-1 flex-col justify-center p-3 sm:p-4">
+ <div class="w-full space-y-2 sm:space-y-3">
<div class="text-center">
{#if loading}
<div class="bg-muted mx-auto h-8 w-16 animate-pulse rounded"></div>
{:else}
- <div class="text-foreground text-2xl font-bold">
+ <div class="text-foreground text-xl font-bold sm:text-2xl">
{currentValue !== undefined ? formatValue(currentValue) : m.common_na()}
</div>
{/if}
</div>
<div class="flex justify-center">
- <div class="w-full max-w-[120px]">
+ <div class="w-full max-w-full sm:max-w-[120px]">
{#if loading}
<div class="bg-muted h-2 w-full animate-pulse rounded"></div>
{:else}
@@ -80,12 +81,12 @@
</div>
</div>
- <div class="bg-primary/10 dark:bg-primary/20 rounded-lg p-3">
+ <div class="bg-primary/10 dark:bg-primary/20 mt-auto flex min-h-[44px] items-center justify-center rounded-lg p-3 sm:p-4">
{#if loading}
<div class="bg-muted mx-auto h-3 w-20 animate-pulse rounded"></div>
{:else}
- <div class="text-primary dark:text-primary text-center text-xs font-medium leading-relaxed">
- {footerText ?? m.meter_footer_usage({ percent: percentage.toFixed(1) })}
+ <div class="text-primary dark:text-primary text-center text-xs font-medium leading-tight sm:text-sm">
+ {footerText ?? m.meter_footer_usage({ percent: Number(percentage).toFixed(1) })}
</div>
{/if}
</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
new file mode 100644
index 000000000..66ac49270
--- /dev/null
+++ b/frontend/src/lib/components/mobile-nav/mobile-docked-nav.svelte
@@ -0,0 +1,151 @@
+<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 bottom-0 left-0 right-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
new file mode 100644
index 000000000..b56fcea74
--- /dev/null
+++ b/frontend/src/lib/components/mobile-nav/mobile-floating-nav.svelte
@@ -0,0 +1,145 @@
+<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-item.svelte b/frontend/src/lib/components/mobile-nav/mobile-nav-item.svelte
new file mode 100644
index 000000000..8a9ce2d57
--- /dev/null
+++ b/frontend/src/lib/components/mobile-nav/mobile-nav-item.svelte
@@ -0,0 +1,46 @@
+<script lang="ts">
+ import type { NavigationItem } from '$lib/config/navigation-config';
+ import { cn } from '$lib/utils';
+ import * as Button from '$lib/components/ui/button/index.js';
+
+ let {
+ item,
+ active = false,
+ showLabels = false,
+ class: className = ''
+ }: {
+ item: NavigationItem;
+ active?: boolean;
+ showLabels?: boolean;
+ class?: string;
+ } = $props();
+</script>
+
+<Button.Root
+ variant="ghost"
+ size={showLabels ? "sm" : "icon"}
+ href={item.url}
+ aria-label={`${item.title}${active ? ' (current page)' : ''}`}
+ aria-current={active ? 'page' : undefined}
+ class={cn(
+ 'flex-1 transition-all duration-200 ease-out',
+ 'hover:bg-muted/50 hover:text-foreground hover:scale-[1.02]',
+ 'focus-visible:ring-1 focus-visible:ring-muted-foreground/50 focus-visible:ring-offset-1',
+ 'focus-visible:ring-offset-transparent focus-visible:scale-[1.02]',
+ 'active:scale-[0.98]',
+ showLabels
+ ? 'h-12 px-3 py-1.5 rounded-2xl flex-col gap-0.5 min-w-[60px]'
+ : 'h-11 w-11 rounded-2xl',
+ active && 'bg-muted text-foreground hover:bg-muted/70 shadow-sm',
+ className
+ )}
+ data-testid="mobile-nav-item"
+>
+ {@const IconComponent = item.icon}
+ <IconComponent size={showLabels ? 20 : 24} aria-hidden="true" />
+ {#if showLabels}
+ <span class="text-[10px] font-normal leading-none text-muted-foreground">{item.title}</span>
+ {:else}
+ <span class="sr-only">{item.title}</span>
+ {/if}
+</Button.Root>
diff --git a/frontend/src/lib/components/mobile-nav/mobile-nav-sheet.svelte b/frontend/src/lib/components/mobile-nav/mobile-nav-sheet.svelte
new file mode 100644
index 000000000..05876dc0f
--- /dev/null
+++ b/frontend/src/lib/components/mobile-nav/mobile-nav-sheet.svelte
@@ -0,0 +1,677 @@
+<script lang="ts">
+ import { navigationItems } from '$lib/config/navigation-config';
+ import type { NavigationItem } from '$lib/config/navigation-config';
+ import { cn } from '$lib/utils';
+ import { SwipeGestureDetector, type SwipeDirection } from '$lib/hooks/use-swipe-gesture.svelte';
+ import { page } from '$app/state';
+ import userStore from '$lib/stores/user-store';
+ import { m } from '$lib/paraglide/messages';
+ import { onMount } from 'svelte';
+ import MobileUserCard from './mobile-user-card.svelte';
+
+ let {
+ open = $bindable(false),
+ user = null,
+ versionInformation = null
+ }: {
+ open: boolean;
+ user?: any;
+ versionInformation?: any;
+ } = $props();
+
+ let menuElement: HTMLElement;
+ let storeUser: any = $state(null);
+
+ // Interaction state
+ interface InteractionState {
+ isDragging: boolean;
+ dragDistance: number;
+ startY: number;
+ currentY: number;
+ inputType: 'touch' | 'wheel' | 'none';
+ isAtScrollTop: boolean;
+ isAtScrollBottom: boolean;
+ canDragToClose: boolean;
+ dragStartedFromHandle: boolean;
+ }
+
+ let interaction = $state<InteractionState>({
+ isDragging: false,
+ dragDistance: 0,
+ startY: 0,
+ currentY: 0,
+ inputType: 'none',
+ isAtScrollTop: true,
+ isAtScrollBottom: false,
+ canDragToClose: false,
+ dragStartedFromHandle: false
+ });
+
+ let maxSheetHeight = $state(0);
+ let resetTimeout: ReturnType<typeof setTimeout> | null = null;
+ let isClosing = $state(false);
+
+ // Physics configuration
+ const PHYSICS = {
+ closeThreshold: 0.3, // 30% of sheet height
+ resistanceFactor: 0.8, // Resistance when dragging
+ velocityThreshold: 0.5, // Minimum velocity for quick close
+ snapAnimationDuration: 200, // ms
+ wheelSensitivity: 2.0, // Wheel scroll sensitivity (higher for trackpads)
+ resetDelay: 150 // ms before resetting wheel state
+ } as const;
+
+ $effect(() => {
+ const unsub = userStore.subscribe((u) => (storeUser = u));
+ return unsub;
+ });
+
+ // Use memoized values defined later for better performance
+ const currentPath = $derived(page.url.pathname);
+
+ // Physics functions
+ function updateScrollPosition() {
+ if (!menuElement) return;
+
+ const scrollTop = menuElement.scrollTop;
+ const scrollHeight = menuElement.scrollHeight;
+ const clientHeight = menuElement.clientHeight;
+
+ interaction.isAtScrollTop = scrollTop === 0;
+ interaction.isAtScrollBottom = Math.abs(scrollHeight - clientHeight - scrollTop) <= 2;
+
+ // Calculate max sheet height (85vh as per CSS)
+ maxSheetHeight = Math.min(window.innerHeight * 0.85, clientHeight);
+ }
+
+ function calculateDragDistance(currentY: number): number {
+ const deltaY = currentY - interaction.startY;
+ if (deltaY <= 0) return 0;
+
+ // Apply consistent resistance curve for all input types
+ const rawDistance = deltaY * PHYSICS.resistanceFactor;
+ return Math.min(rawDistance, maxSheetHeight * 0.8);
+ }
+
+ function shouldCloseSheet(distance: number, velocity: number = 0): boolean {
+ const thresholdDistance = maxSheetHeight * PHYSICS.closeThreshold;
+ return distance > thresholdDistance || velocity > PHYSICS.velocityThreshold;
+ }
+
+ function resetInteractionState() {
+ interaction.isDragging = false;
+ interaction.dragDistance = 0;
+ interaction.startY = 0;
+ interaction.currentY = 0;
+ interaction.inputType = 'none';
+ interaction.canDragToClose = false;
+ interaction.dragStartedFromHandle = false;
+
+ if (resetTimeout) {
+ clearTimeout(resetTimeout);
+ resetTimeout = null;
+ }
+ }
+
+ function provideFeedback(type: 'grab' | 'close' | 'reset' | 'tap' = 'tap') {
+ if (!('vibrate' in navigator)) return;
+
+ const patterns = {
+ grab: 5,
+ close: 20,
+ reset: 10,
+ tap: 10
+ };
+
+ navigator.vibrate(patterns[type]);
+ }
+
+ // Touch handling
+ function handleTouchStart(e: TouchEvent) {
+ if (!open || !menuElement || isClosing) return;
+
+ const touch = e.touches[0];
+ const target = e.target as HTMLElement;
+ 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
+ interaction.startY = touch.clientY;
+ 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)
+ interaction.canDragToClose = !!isOnHandle || isAtScrollTop;
+
+ if (interaction.canDragToClose) {
+ interaction.isDragging = true;
+ provideFeedback('grab');
+ }
+ }
+
+ function handleTouchMove(e: TouchEvent) {
+ if (!open || isClosing || !interaction.isDragging) return;
+
+ const touch = e.touches[0];
+ interaction.currentY = touch.clientY;
+
+ // For handle-based drags, always allow
+ // For content-based drags, ensure we're still at scroll top
+ let canContinueDrag = interaction.dragStartedFromHandle;
+
+ if (!interaction.dragStartedFromHandle) {
+ const currentScrollTop = menuElement.scrollTop;
+ const isAtScrollTop = currentScrollTop === 0;
+ canContinueDrag = isAtScrollTop;
+ }
+
+ // Calculate drag distance using unified physics
+ const newDistance = calculateDragDistance(interaction.currentY);
+
+ // Only update if dragging downward and we can continue the drag
+ if (newDistance > 0 && canContinueDrag) {
+ interaction.dragDistance = newDistance;
+ e.preventDefault();
+ } else if (interaction.currentY < interaction.startY || !canContinueDrag) {
+ // Reset if dragging upward or conditions no longer allow dragging
+ resetInteractionState();
+ }
+ }
+
+ function handleTouchEnd(e: TouchEvent) {
+ if (!interaction.isDragging || interaction.inputType !== 'touch') return;
+
+ const deltaY = interaction.currentY - interaction.startY;
+ const dragVelocity = Math.abs(deltaY) / (performance.now() - (e.timeStamp || Date.now()));
+
+ // Use unified physics to determine if sheet should close
+ if (shouldCloseSheet(interaction.dragDistance, dragVelocity)) {
+ closeSheet();
+ } else {
+ // Provide reset feedback if significant drag occurred
+ if (interaction.dragDistance > 30) {
+ provideFeedback('reset');
+ }
+ resetInteractionState();
+ }
+ }
+
+ // Unified wheel handling
+ function handleWheel(e: WheelEvent) {
+ if (!open || !menuElement || isClosing) return;
+
+ // Check current scroll position in real-time
+ const currentScrollTop = menuElement.scrollTop;
+ const isAtScrollTop = currentScrollTop === 0;
+ const isScrollingUp = e.deltaY < 0;
+
+ // Only handle wheel drag when exactly at scroll top AND scrolling up
+ if (isAtScrollTop && isScrollingUp) {
+ // Initialize wheel interaction if not already active
+ if (interaction.inputType === 'none') {
+ interaction.inputType = 'wheel';
+ interaction.startY = 0; // Virtual start position for wheel
+ interaction.canDragToClose = true;
+ interaction.isDragging = true;
+ interaction.dragDistance = 0; // Reset accumulated distance
+ }
+
+ // Only accumulate if we're still at the top and in wheel mode
+ if (interaction.inputType === 'wheel' && isAtScrollTop) {
+ const wheelDistance = Math.abs(e.deltaY) * PHYSICS.wheelSensitivity;
+
+ // For wheel events, we accumulate raw distance and apply resistance directly
+ const rawDistance = interaction.dragDistance + wheelDistance;
+ const resistedDistance = rawDistance * PHYSICS.resistanceFactor;
+ interaction.dragDistance = Math.min(resistedDistance, maxSheetHeight * 0.8);
+
+ e.preventDefault();
+
+ // Check if should close using unified physics
+ if (shouldCloseSheet(interaction.dragDistance)) {
+ closeSheet();
+ return;
+ }
+
+ // Schedule reset after wheel stops
+ scheduleReset();
+ }
+ } else {
+ // Reset when conditions change (not at top or not scrolling up)
+ if (interaction.inputType === 'wheel') {
+ resetInteractionState();
+ }
+ }
+ }
+
+ function scheduleReset() {
+ if (resetTimeout) {
+ clearTimeout(resetTimeout);
+ }
+ resetTimeout = setTimeout(() => {
+ if (interaction.inputType === 'wheel') {
+ resetInteractionState();
+ }
+ }, PHYSICS.resetDelay);
+ }
+
+ function closeSheet() {
+ isClosing = true;
+ provideFeedback('close');
+
+ // Reset all interaction states immediately
+ resetInteractionState();
+
+ // Close immediately - let CSS transitions handle the smooth animation
+ open = false;
+ isClosing = false;
+ }
+
+ // Swipe gesture to close menu (keep existing horizontal swipes)
+ const swipeDetector = new SwipeGestureDetector(
+ (direction: SwipeDirection) => {
+ if ((direction === 'left' || direction === 'right') && open) {
+ open = false;
+ }
+ },
+ { threshold: 60, velocity: 0.4 }
+ );
+
+ $effect(() => {
+ if (menuElement) {
+ swipeDetector.setElement(menuElement);
+
+ // Add scroll listener
+ menuElement.addEventListener('scroll', updateScrollPosition, { passive: true });
+
+ // Add touch listeners for drag-to-close with optimized passive settings
+ menuElement.addEventListener('touchstart', handleTouchStart, { passive: true });
+ menuElement.addEventListener('touchmove', handleTouchMove, { passive: false }); // Needs to prevent default
+ menuElement.addEventListener('touchend', handleTouchEnd, { passive: true });
+
+ // Add wheel listener for trackpad/mouse wheel support
+ menuElement.addEventListener('wheel', handleWheel, { passive: false });
+
+ // Initial scroll position check
+ updateScrollPosition();
+
+ return () => {
+ menuElement.removeEventListener('scroll', updateScrollPosition);
+ menuElement.removeEventListener('touchstart', handleTouchStart);
+ menuElement.removeEventListener('touchmove', handleTouchMove);
+ menuElement.removeEventListener('touchend', handleTouchEnd);
+ menuElement.removeEventListener('wheel', handleWheel);
+ };
+ }
+ });
+
+ // Handle keyboard navigation
+ onMount(() => {
+ const handleKeyDown = (e: KeyboardEvent) => {
+ if (!open) return;
+
+ if (e.key === 'Escape') {
+ e.preventDefault();
+ provideFeedback('close');
+ open = false;
+ }
+ };
+
+ window.addEventListener('keydown', handleKeyDown);
+
+ return () => {
+ window.removeEventListener('keydown', handleKeyDown);
+ };
+ });
+
+ // Focus management and body scroll prevention for accessibility
+ $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;
+ 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
+ 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
+
+ // Focus the menu container itself for accessibility without highlighting specific elements
+ requestAnimationFrame(() => {
+ 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
+ if (menuElement) {
+ menuElement.style.overflowY = '';
+ (menuElement.style as any).webkitOverflowScrolling = '';
+ menuElement.style.touchAction = '';
+ }
+ };
+ }
+ });
+
+ // Memoize the effective user computation
+ const memoizedUser = $derived.by(() => user ?? storeUser);
+ const memoizedIsAdmin = $derived.by(() => !!memoizedUser?.roles?.includes('admin'));
+
+ function handleItemClick(item: NavigationItem) {
+ provideFeedback('tap');
+ open = false;
+ }
+
+ function isActiveItem(item: NavigationItem): boolean {
+ return currentPath === item.url || currentPath.startsWith(item.url + '/');
+ }
+</script>
+
+<!-- Backdrop -->
+{#if open}
+ <div
+ class={cn(
+ 'bg-background/20 fixed inset-0 z-40 backdrop-blur-md',
+ interaction.isDragging && !isClosing ? 'transition-none' : 'transition-opacity duration-200'
+ )}
+ style={`
+ ${interaction.isDragging && !isClosing ? `opacity: ${Math.max(0.1, 1 - interaction.dragDistance / 400)};` : ''}
+ touch-action: manipulation;
+ `}
+ onclick={() => {
+ provideFeedback('close');
+ open = false;
+ }}
+ onkeydown={(e) => {
+ if (e.key === 'Escape') {
+ provideFeedback('close');
+ 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)'};
+ transition: transform 150ms cubic-bezier(0.34, 1.56, 0.64, 1), background-color 150ms ease;`}
+ ></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}
+
+ <!-- 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}
+ {/if}
+ </div>
+
+ <!-- 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>
+ {/if}
+ </div>
+ </div>
+ {/if}
+ </div>
+</div>
+
+<style>
+ /* Ensure smooth scrolling and prevent overscroll issues */
+ @supports (overscroll-behavior: contain) {
+ div[data-testid='mobile-nav-sheet'] {
+ overscroll-behavior: contain;
+ }
+ }
+
+ /* 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-user-card.svelte b/frontend/src/lib/components/mobile-nav/mobile-user-card.svelte
new file mode 100644
index 000000000..3971fa803
--- /dev/null
+++ b/frontend/src/lib/components/mobile-nav/mobile-user-card.svelte
@@ -0,0 +1,186 @@
+<script lang="ts">
+ import * as Button from '$lib/components/ui/button/index.js';
+ import * as Select from '$lib/components/ui/select/index.js';
+ import { cn } from '$lib/utils';
+ import LogOutIcon from '@lucide/svelte/icons/log-out';
+ import GlobeIcon from '@lucide/svelte/icons/globe';
+ import ServerIcon from '@lucide/svelte/icons/server';
+ import LanguagesIcon from '@lucide/svelte/icons/languages';
+ import Sun from '@lucide/svelte/icons/sun';
+ import Moon from '@lucide/svelte/icons/moon';
+ import { environmentStore } from '$lib/stores/environment.store';
+ import type { Environment } from '$lib/types/environment.type';
+ import { mode, toggleMode } from 'mode-watcher';
+ import { toast } from 'svelte-sonner';
+ import { m } from '$lib/paraglide/messages';
+ import type { User } from '$lib/types/user.type';
+ import LocalePicker from '$lib/components/locale-picker.svelte';
+ import ChevronDownIcon from '@lucide/svelte/icons/chevron-down';
+
+ type Props = {
+ user: User;
+ class?: string;
+ };
+
+ let { user, class: className = '' }: Props = $props();
+
+ let userCardExpanded = $state(false);
+ let currentSelectedEnvironment = $state<Environment | null>(null);
+ let availableEnvironments = $state<Environment[]>([]);
+
+ const isDarkMode = $derived(mode.current === 'dark');
+
+ $effect(() => {
+ const unsubscribeSelected = environmentStore.selected.subscribe((value) => {
+ currentSelectedEnvironment = value;
+ });
+ const unsubscribeAvailable = environmentStore.available.subscribe((value) => {
+ availableEnvironments = value;
+ });
+ return () => {
+ unsubscribeSelected();
+ unsubscribeAvailable();
+ };
+ });
+
+ const effectiveUser = $derived(user);
+ const isAdmin = $derived(!!effectiveUser.roles?.includes('admin'));
+ const selectedValue = $derived(currentSelectedEnvironment?.id || '');
+
+ async function handleEnvSelect(envId: string) {
+ const env = availableEnvironments.find((e) => e.id === envId);
+ if (!env) return;
+
+ try {
+ await environmentStore.setEnvironment(env);
+ } catch (error) {
+ console.error('Failed to set environment:', error);
+ toast.error('Failed to Connect to Environment');
+ }
+ }
+
+ function getEnvLabel(env: Environment): string {
+ if (env.isLocal) {
+ return 'Local Docker';
+ } else {
+ return env.name;
+ }
+ }
+</script>
+
+<div class={`bg-muted/30 border-border/20 overflow-hidden rounded-3xl border ${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)}
+ >
+ <div class="bg-muted/50 flex h-14 w-14 items-center justify-center rounded-2xl">
+ <span class="text-foreground text-xl font-semibold">
+ {effectiveUser.username?.charAt(0).toUpperCase() || 'U'}
+ </span>
+ </div>
+ <div class="flex-1">
+ <h3 class="text-foreground text-lg font-semibold">{effectiveUser.username}</h3>
+ <p class="text-muted-foreground/80 text-sm">
+ {effectiveUser.roles?.join(', ')}
+ </p>
+ </div>
+ <div class="flex items-center gap-2">
+ <div
+ role="button"
+ aria-label="Expand user card"
+ class={cn('text-muted-foreground/60 transition-transform duration-200', userCardExpanded && 'rotate-180 transform')}
+ >
+ <ChevronDownIcon class="size-4" />
+ </div>
+ <form action="/auth/logout" method="POST">
+ <Button.Root
+ variant="ghost"
+ size="icon"
+ type="submit"
+ title={m.common_logout()}
+ class="text-muted-foreground hover:text-destructive hover:bg-destructive/10 h-10 w-10 rounded-xl transition-all duration-200 hover:scale-105"
+ onclick={(e) => e.stopPropagation()}
+ >
+ <LogOutIcon size={16} />
+ </Button.Root>
+ </form>
+ </div>
+ </button>
+
+ {#if userCardExpanded}
+ <div class="border-border/20 bg-muted/10 space-y-4 border-t p-4">
+ {#if isAdmin}
+ <div class="bg-background/50 border-border/20 rounded-2xl border p-4">
+ <div class="flex items-center gap-3">
+ <div class="bg-primary/10 text-primary flex aspect-square size-8 items-center justify-center rounded-lg">
+ {#if currentSelectedEnvironment?.isLocal}
+ <ServerIcon class="size-4" />
+ {:else}
+ <GlobeIcon class="size-4" />
+ {/if}
+ </div>
+ <div class="min-w-0 flex-1">
+ <div class="text-muted-foreground/70 text-xs font-medium uppercase tracking-widest">
+ {m.sidebar_environment_label()}
+ </div>
+ <div class="text-foreground text-sm font-medium">
+ {currentSelectedEnvironment ? getEnvLabel(currentSelectedEnvironment) : m.sidebar_no_environment()}
+ </div>
+ </div>
+ {#if availableEnvironments.length > 1}
+ <Select.Root type="single" value={selectedValue} onValueChange={handleEnvSelect}>
+ <Select.Trigger class="bg-background/50 border-border/30 text-foreground h-9 w-32 text-sm font-medium">
+ <span class="truncate">Switch</span>
+ </Select.Trigger>
+ <Select.Content class="min-w-[160px] max-w-[280px]">
+ {#each availableEnvironments as env (env.id)}
+ <Select.Item value={env.id} class="text-sm">
+ {getEnvLabel(env)}
+ </Select.Item>
+ {/each}
+ </Select.Content>
+ </Select.Root>
+ {/if}
+ </div>
+ </div>
+ {/if}
+
+ <div class="grid grid-cols-1 gap-3 sm:grid-cols-2">
+ <div class="bg-background/50 border-border/20 rounded-2xl border p-4">
+ <div class="flex h-full items-center gap-3">
+ <div class="bg-primary/10 text-primary flex aspect-square size-8 items-center justify-center rounded-lg">
+ <LanguagesIcon class="size-4" />
+ </div>
+ <div class="min-w-0 flex-1">
+ <div class="text-muted-foreground/70 mb-1 text-xs font-medium uppercase tracking-widest">Language</div>
+ <div class="text-foreground text-sm font-medium"></div>
+ </div>
+ <LocalePicker
+ inline={true}
+ id="mobileLocalePicker"
+ class="bg-background/50 border-border/30 text-foreground h-9 w-32 text-sm font-medium"
+ />
+ </div>
+ </div>
+
+ <div class="bg-background/50 border-border/20 rounded-2xl border p-4">
+ <button class="flex h-full w-full items-center gap-3 text-left" onclick={toggleMode}>
+ <div class="bg-primary/10 text-primary flex aspect-square size-8 items-center justify-center rounded-lg">
+ {#if isDarkMode}
+ <Sun class="size-4" />
+ {:else}
+ <Moon class="size-4" />
+ {/if}
+ </div>
+ <div class="flex min-w-0 flex-1 flex-col justify-center">
+ <div class="text-muted-foreground/70 mb-1 text-xs font-medium uppercase tracking-widest">Theme</div>
+ <div class="text-foreground text-sm font-medium">
+ {isDarkMode ? 'Dark' : 'Light'}
+ </div>
+ </div>
+ </button>
+ </div>
+ </div>
+ </div>
+ {/if}
+</div>
diff --git a/frontend/src/lib/components/mobile-nav/styles.css b/frontend/src/lib/components/mobile-nav/styles.css
new file mode 100644
index 000000000..ce8c029ff
--- /dev/null
+++ b/frontend/src/lib/components/mobile-nav/styles.css
@@ -0,0 +1,79 @@
+/* Shared navigation styles for both floating and docked navigation */
+
+/* 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;
+ overscroll-behavior: contain;
+ /* Isolate touch interactions similar to pointer device behavior */
+ isolation: isolate;
+ /* Hardware acceleration for smooth animations */
+ will-change: transform, opacity;
+ /* Prevent layout shifts during animation */
+ transform-origin: center bottom;
+ /* Smooth subpixel rendering */
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+/* Floating navigation specific positioning */
+.mobile-nav-floating {
+ /* Safe area handling for floating navigation */
+ /* Use safe area inset if it's greater than 1.5rem, otherwise use 1.5rem */
+ bottom: max(1.5rem, env(safe-area-inset-bottom));
+}
+
+/* Docked navigation specific positioning */
+.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));
+}
+
+/* Shared button/link styles */
+.mobile-nav-base :global(button),
+.mobile-nav-base :global(a) {
+ pointer-events: auto;
+ touch-action: manipulation; /* Allow taps and prevent interfering gestures */
+ position: relative;
+ z-index: 1; /* Ensure buttons are above gesture detection */
+ /* Isolate button touches from parent's touch handling */
+ isolation: isolate;
+}
+
+/* Cursor device visual hints */
+@media (hover: hover) and (pointer: fine) {
+ .mobile-nav-floating:hover {
+ /* Subtle visual hint that scrolling up will open menu without moving the bar */
+ box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
+ backdrop-filter: blur(24px);
+ border-color: var(--muted);
+ }
+
+ .mobile-nav-base :global(button),
+ .mobile-nav-base :global(a) {
+ cursor: pointer;
+ }
+}
+
+/* Reduced motion support */
+@media (prefers-reduced-motion: reduce) {
+ .mobile-nav-base {
+ transition: none;
+ }
+
+ /* Disable scale and complex animations for reduced motion */
+ .mobile-nav-base :global(button) {
+ transition: none;
+ transform: none !important;
+ }
+
+ .mobile-nav-base :global(button:hover),
+ .mobile-nav-base :global(button:focus-visible),
+ .mobile-nav-base :global(button:active) {
+ transform: none !important;
+ }
+}
diff --git a/frontend/src/lib/components/navigation-mode-setting-control.svelte b/frontend/src/lib/components/navigation-mode-setting-control.svelte
new file mode 100644
index 000000000..6e7754a3d
--- /dev/null
+++ b/frontend/src/lib/components/navigation-mode-setting-control.svelte
@@ -0,0 +1,194 @@
+<script lang="ts">
+ import { Button } from '$lib/components/ui/button';
+ import ServerIcon from '@lucide/svelte/icons/server';
+ import SmartphoneIcon from '@lucide/svelte/icons/smartphone';
+ import XIcon from '@lucide/svelte/icons/x';
+ import MonitorSpeakerIcon from '@lucide/svelte/icons/monitor-speaker';
+ import DockIcon from '@lucide/svelte/icons/dock';
+ import { m } from '$lib/paraglide/messages';
+
+ let {
+ id,
+ label,
+ description,
+ icon: Icon,
+ serverValue,
+ localOverride,
+ onServerChange,
+ onLocalOverride,
+ onClearOverride,
+ serverDisabled = false
+ }: {
+ id: string;
+ label: string;
+ description: string;
+ icon: any;
+ serverValue: 'floating' | 'docked';
+ localOverride?: 'floating' | 'docked';
+ onServerChange: (value: 'floating' | 'docked') => void;
+ onLocalOverride: (value: 'floating' | 'docked') => void;
+ onClearOverride: () => void;
+ serverDisabled?: boolean;
+ } = $props();
+
+ const effectiveValue = $derived(localOverride !== undefined ? localOverride : serverValue);
+ const hasOverride = $derived(localOverride !== undefined);
+</script>
+
+<div
+ class={`flex h-full flex-col rounded-lg border p-3 sm:p-4 ${hasOverride ? 'border-orange-200 bg-orange-50/50 dark:border-orange-800 dark:bg-orange-950/20' : 'border-border'}`}
+>
+ <div class="flex h-full flex-col space-y-3">
+ <div class="flex items-start gap-3">
+ <div
+ class={`flex size-7 flex-shrink-0 items-center justify-center rounded-lg ring-1 sm:size-8 ${hasOverride ? 'bg-orange-500/10 text-orange-600 ring-orange-500/20 dark:text-orange-400' : 'bg-primary/10 text-primary ring-primary/20'}`}
+ >
+ <Icon class="size-3 sm:size-4" />
+ </div>
+
+ <div class="min-w-0 flex-1">
+ <div class="mb-1 flex items-start justify-between gap-2">
+ <div class="min-w-0 flex-1">
+ <h4 class="text-sm font-medium leading-tight">{label}</h4>
+ </div>
+
+ {#if hasOverride}
+ <Button
+ variant="ghost"
+ size="sm"
+ onclick={onClearOverride}
+ class="h-6 w-6 flex-shrink-0 p-0 text-orange-600 hover:text-orange-700 dark:text-orange-400 dark:hover:text-orange-300"
+ title={m.clear_local_override()}
+ >
+ <XIcon class="size-3" />
+ </Button>
+ {/if}
+ </div>
+ <p class="text-muted-foreground text-xs leading-relaxed">{description}</p>
+ </div>
+ </div>
+
+ <div class="flex flex-1 flex-col justify-end space-y-2 sm:space-y-3">
+ <div class="bg-background/50 rounded-md border">
+ <div class="flex items-center justify-between p-2 sm:p-3">
+ <div class="flex min-w-0 flex-1 items-center gap-2">
+ <ServerIcon class="text-muted-foreground size-3 flex-shrink-0 sm:size-4" />
+ <div class="min-w-0 flex-1">
+ <p class="text-xs font-medium leading-tight">{m.server_default()}</p>
+ <p class="text-muted-foreground hidden text-xs leading-tight sm:block">{m.applies_to_all_users()}</p>
+ </div>
+ </div>
+
+ <div class="flex flex-shrink-0 gap-1">
+ <Button
+ variant={serverValue === 'floating' ? 'default' : 'outline'}
+ size="sm"
+ onclick={() => !serverDisabled && onServerChange('floating')}
+ disabled={serverDisabled}
+ class="flex h-7 min-w-[2.5rem] items-center gap-1 px-2 text-xs sm:h-8 sm:px-3"
+ >
+ <MonitorSpeakerIcon class="size-3" />
+ <span class="hidden sm:inline">{m.navigation_mode_floating()}</span>
+ </Button>
+ <Button
+ variant={serverValue === 'docked' ? 'default' : 'outline'}
+ size="sm"
+ onclick={() => !serverDisabled && onServerChange('docked')}
+ disabled={serverDisabled}
+ class="flex h-7 min-w-[2.5rem] items-center gap-1 px-2 text-xs sm:h-8 sm:px-3"
+ >
+ <DockIcon class="size-3" />
+ <span class="hidden sm:inline">{m.navigation_mode_docked()}</span>
+ </Button>
+ </div>
+ </div>
+ </div>
+
+ <div
+ class={`rounded-md border ${hasOverride ? 'border-orange-200 bg-orange-50 dark:border-orange-800 dark:bg-orange-950/30' : 'bg-muted/30 border-border'}`}
+ >
+ <div class="flex items-center justify-between p-2 sm:p-3">
+ <div class="flex min-w-0 flex-1 items-center gap-2">
+ <SmartphoneIcon class="text-muted-foreground size-3 flex-shrink-0 sm:size-4" />
+ <div class="min-w-0 flex-1">
+ <div class="flex flex-col sm:flex-row sm:items-center sm:gap-1">
+ <p class="text-xs font-medium leading-tight">{m.this_device()}</p>
+ {#if hasOverride}
+ <span class="text-xs leading-tight text-orange-600 dark:text-orange-400">({m.override()})</span>
+ {/if}
+ </div>
+ <p class="text-muted-foreground hidden text-xs leading-tight sm:block">
+ {hasOverride ? m.overriding_server_default() : m.using_server_default()}
+ </p>
+ </div>
+ </div>
+
+ {#if hasOverride}
+ <div class="flex flex-shrink-0 gap-1">
+ <Button
+ variant={localOverride === 'floating' ? 'default' : 'outline'}
+ size="sm"
+ onclick={() => onLocalOverride('floating')}
+ class="flex h-7 min-w-[2.5rem] items-center gap-1 px-2 text-xs sm:h-8 sm:px-3"
+ >
+ <MonitorSpeakerIcon class="size-3" />
+ <span class="hidden sm:inline">{m.navigation_mode_floating()}</span>
+ </Button>
+ <Button
+ variant={localOverride === 'docked' ? 'default' : 'outline'}
+ size="sm"
+ onclick={() => onLocalOverride('docked')}
+ class="flex h-7 min-w-[2.5rem] items-center gap-1 px-2 text-xs sm:h-8 sm:px-3"
+ >
+ <DockIcon class="size-3" />
+ <span class="hidden sm:inline">{m.navigation_mode_docked()}</span>
+ </Button>
+ </div>
+ {:else}
+ <div class="flex flex-shrink-0 items-center gap-2">
+ <span class="text-muted-foreground hidden items-center gap-1 text-xs font-medium sm:flex">
+ {#if effectiveValue === 'floating'}
+ <MonitorSpeakerIcon class="size-3" />
+ {m.navigation_mode_floating()}
+ {:else}
+ <DockIcon class="size-3" />
+ {m.navigation_mode_docked()}
+ {/if}
+ </span>
+ <Button
+ variant="outline"
+ size="sm"
+ onclick={() => onLocalOverride(effectiveValue === 'floating' ? 'docked' : 'floating')}
+ class="h-6 px-2 text-xs sm:h-7"
+ >
+ {m.override()}
+ </Button>
+ </div>
+ {/if}
+ </div>
+ </div>
+ </div>
+
+ <div class="bg-muted/30 rounded-md border p-2">
+ <div class="flex items-center justify-between gap-2">
+ <span class="text-muted-foreground text-xs font-medium">{m.current_state()}:</span>
+ <div class="flex flex-wrap items-center justify-end gap-1">
+ <span
+ class={`flex items-center gap-1 text-xs font-medium ${effectiveValue === 'floating' ? 'text-blue-600 dark:text-blue-400' : 'text-purple-600 dark:text-purple-400'}`}
+ >
+ {#if effectiveValue === 'floating'}
+ <MonitorSpeakerIcon class="size-3" />
+ {m.navigation_mode_floating()}
+ {:else}
+ <DockIcon class="size-3" />
+ {m.navigation_mode_docked()}
+ {/if}
+ </span>
+ <span class="text-muted-foreground text-xs">
+ ({hasOverride ? m.local_override() : m.server_default()})
+ </span>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
diff --git a/frontend/src/lib/components/navigation-setting-control.svelte b/frontend/src/lib/components/navigation-setting-control.svelte
new file mode 100644
index 000000000..51c2a0e2f
--- /dev/null
+++ b/frontend/src/lib/components/navigation-setting-control.svelte
@@ -0,0 +1,154 @@
+<script lang="ts">
+ import { Button } from '$lib/components/ui/button';
+ import { Switch } from '$lib/components/ui/switch/index.js';
+ import { m } from '$lib/paraglide/messages';
+ import ServerIcon from '@lucide/svelte/icons/server';
+ import SmartphoneIcon from '@lucide/svelte/icons/smartphone';
+ import XIcon from '@lucide/svelte/icons/x';
+
+ let {
+ id,
+ label,
+ description,
+ icon: Icon,
+ serverValue,
+ localOverride,
+ onServerChange,
+ onLocalOverride,
+ onClearOverride,
+ serverDisabled = false
+ }: {
+ id: string;
+ label: string;
+ description: string;
+ icon: any;
+ serverValue: boolean;
+ localOverride?: boolean;
+ onServerChange: (value: boolean) => void;
+ onLocalOverride: (value: boolean) => void;
+ onClearOverride: () => void;
+ serverDisabled?: boolean;
+ } = $props();
+
+ const effectiveValue = $derived(localOverride !== undefined ? localOverride : serverValue);
+ const hasOverride = $derived(localOverride !== undefined);
+</script>
+
+<div
+ class={`flex h-full flex-col rounded-lg border p-3 sm:p-4 ${hasOverride ? 'border-orange-200 bg-orange-50/50 dark:border-orange-800 dark:bg-orange-950/20' : 'border-border'}`}
+>
+ <div class="flex h-full flex-col space-y-3">
+ <div class="flex items-start gap-3">
+ <div
+ class={`flex size-7 flex-shrink-0 items-center justify-center rounded-lg ring-1 sm:size-8 ${hasOverride ? 'bg-orange-500/10 text-orange-600 ring-orange-500/20 dark:text-orange-400' : 'bg-primary/10 text-primary ring-primary/20'}`}
+ >
+ <Icon class="size-3 sm:size-4" />
+ </div>
+
+ <div class="min-w-0 flex-1">
+ <div class="mb-1 flex items-start justify-between gap-2">
+ <div class="min-w-0 flex-1">
+ <h4 class="text-sm font-medium leading-tight">{label}</h4>
+ </div>
+
+ {#if hasOverride}
+ <Button
+ variant="ghost"
+ size="sm"
+ onclick={onClearOverride}
+ class="h-6 w-6 flex-shrink-0 p-0 text-orange-600 hover:text-orange-700 dark:text-orange-400 dark:hover:text-orange-300"
+ title={m.clear_local_override()}
+ >
+ <XIcon class="size-3" />
+ </Button>
+ {/if}
+ </div>
+ <p class="text-muted-foreground text-xs leading-relaxed">{description}</p>
+ </div>
+ </div>
+
+ <div class="flex flex-1 flex-col justify-end space-y-2 sm:space-y-3">
+ <div class="bg-background/50 rounded-md border">
+ <div class="flex items-center justify-between p-2 sm:p-3">
+ <div class="flex min-w-0 flex-1 items-center gap-2">
+ <ServerIcon class="text-muted-foreground size-3 flex-shrink-0 sm:size-4" />
+ <div class="min-w-0 flex-1">
+ <p class="text-xs font-medium leading-tight">{m.server_default()}</p>
+ <p class="text-muted-foreground hidden text-xs leading-tight sm:block">{m.applies_to_all_users()}</p>
+ </div>
+ </div>
+
+ <div class="flex flex-shrink-0 gap-1">
+ <div class="flex items-center">
+ <Switch
+ id={`server-${id}`}
+ bind:checked={serverValue}
+ disabled={serverDisabled}
+ onCheckedChange={(v) => !serverDisabled && onServerChange(!!v)}
+ />
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <div
+ class={`rounded-md border ${hasOverride ? 'border-orange-200 bg-orange-50 dark:border-orange-800 dark:bg-orange-950/30' : 'bg-muted/30 border-border'}`}
+ >
+ <div class="flex items-center justify-between p-2 sm:p-3">
+ <div class="flex min-w-0 flex-1 items-center gap-2">
+ <SmartphoneIcon class="text-muted-foreground size-3 flex-shrink-0 sm:size-4" />
+ <div class="min-w-0 flex-1">
+ <div class="flex flex-col sm:flex-row sm:items-center sm:gap-1">
+ <p class="text-xs font-medium leading-tight">{m.this_device()}</p>
+ {#if hasOverride}
+ <span class="text-xs leading-tight text-orange-600 dark:text-orange-400">({m.override()})</span>
+ {/if}
+ </div>
+ <p class="text-muted-foreground hidden text-xs leading-tight sm:block">
+ {hasOverride ? m.overriding_server_default() : m.server_default()}
+ </p>
+ </div>
+ </div>
+
+ {#if hasOverride}
+ <div class="flex flex-shrink-0 gap-1">
+ <div class="flex items-center">
+ <Switch id={`local-${id}`} bind:checked={localOverride} onCheckedChange={(v) => onLocalOverride(!!v)} />
+ </div>
+ </div>
+ {:else}
+ <div class="flex flex-shrink-0 items-center gap-2">
+ <span class="text-muted-foreground hidden text-xs font-medium sm:inline">
+ {effectiveValue ? m.on() : m.off()}
+ </span>
+ <Button
+ variant="outline"
+ size="sm"
+ onclick={() => onLocalOverride(!effectiveValue)}
+ class="h-6 px-2 text-xs sm:h-7"
+ >
+ {m.override()}
+ </Button>
+ </div>
+ {/if}
+ </div>
+ </div>
+ </div>
+
+ <div class="bg-muted/30 rounded-md border p-2">
+ <div class="flex items-center justify-between gap-2">
+ <span class="text-muted-foreground text-xs font-medium">{m.current_state()}:</span>
+ <div class="flex flex-wrap items-center justify-end gap-1">
+ <span
+ class={`text-xs font-medium ${effectiveValue ? 'text-green-600 dark:text-green-400' : 'text-gray-600 dark:text-gray-400'}`}
+ >
+ {effectiveValue ? m.on() : m.off()}
+ </span>
+ <span class="text-muted-foreground text-xs">
+ ({hasOverride ? m.local_override() : m.server_default()})
+ </span>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
diff --git a/frontend/src/lib/components/quick-actions.svelte b/frontend/src/lib/components/quick-actions.svelte
index e10e967fd..c5b58c01a 100644
--- a/frontend/src/lib/components/quick-actions.svelte
+++ b/frontend/src/lib/components/quick-actions.svelte
@@ -4,6 +4,8 @@
import CircleStopIcon from '@lucide/svelte/icons/circle-stop';
import Trash2Icon from '@lucide/svelte/icons/trash-2';
import RefreshCwIcon from '@lucide/svelte/icons/refresh-cw';
+ import EllipsisIcon from '@lucide/svelte/icons/ellipsis';
+ import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';
import { m } from '$lib/paraglide/messages';
type IsLoadingFlags = {
@@ -52,7 +54,7 @@
{/each}
</div>
{:else}
- <div class="flex flex-wrap items-center gap-2">
+ <div class="hidden flex-wrap items-center gap-2 sm:flex">
<button
class="ring-offset-background focus-visible:ring-ring bg-background/70 group inline-flex h-9 items-center gap-2 rounded-lg border border-emerald-500/20 px-3 py-1.5 text-xs shadow-sm transition-colors transition-shadow hover:border-emerald-500/40 hover:bg-emerald-500/10 hover:shadow-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-60"
disabled={!dockerInfo || stoppedContainers === 0 || isLoading.starting || isLoading.stopping || isLoading.pruning}
@@ -119,6 +121,54 @@
<span class="font-medium">{m.common_refresh()}</span>
</button>
</div>
+
+ <DropdownMenu.Root>
+ <DropdownMenu.Trigger
+ class="bg-background/70 flex inline-flex size-9 items-center justify-center rounded-lg border sm:hidden"
+ >
+ <span class="sr-only">{m.common_open_menu()}</span>
+ <EllipsisIcon />
+ </DropdownMenu.Trigger>
+
+ <DropdownMenu.Content
+ align="end"
+ class="bg-card/80 supports-[backdrop-filter]:bg-card/60 z-50 min-w-[160px] rounded-md p-1 shadow-lg backdrop-blur-sm supports-[backdrop-filter]:backdrop-blur-sm"
+ >
+ <DropdownMenu.Group>
+ <DropdownMenu.Item
+ onclick={onStartAll}
+ disabled={!dockerInfo || stoppedContainers === 0 || isLoading.starting || isLoading.stopping || isLoading.pruning}
+ >
+ {m.quick_actions_start_all()}
+ </DropdownMenu.Item>
+
+ <DropdownMenu.Item
+ onclick={onStopAll}
+ disabled={!dockerInfo ||
+ (dockerInfo?.containersRunning ?? 0) === 0 ||
+ isLoading.starting ||
+ isLoading.stopping ||
+ isLoading.pruning}
+ >
+ {m.quick_actions_stop_all()}
+ </DropdownMenu.Item>
+
+ <DropdownMenu.Item
+ onclick={onOpenPruneDialog}
+ disabled={!dockerInfo || isLoading.starting || isLoading.stopping || isLoading.pruning}
+ >
+ {m.quick_actions_prune_system()}
+ </DropdownMenu.Item>
+
+ <DropdownMenu.Item
+ onclick={onRefresh}
+ disabled={isLoading.starting || isLoading.stopping || isLoading.pruning || refreshing}
+ >
+ {m.common_refresh()}
+ </DropdownMenu.Item>
+ </DropdownMenu.Group>
+ </DropdownMenu.Content>
+ </DropdownMenu.Root>
{/if}
{:else}
<h2 class="mb-3 text-lg font-semibold tracking-tight">{m.quick_actions_title()}</h2>
diff --git a/frontend/src/lib/components/sidebar/sidebar-env-switcher.svelte b/frontend/src/lib/components/sidebar/sidebar-env-switcher.svelte
index a4cbec165..685ca99b7 100644
--- a/frontend/src/lib/components/sidebar/sidebar-env-switcher.svelte
+++ b/frontend/src/lib/components/sidebar/sidebar-env-switcher.svelte
@@ -115,7 +115,7 @@
<DropdownMenu.Content
class="w-[var(--bits-dropdown-menu-anchor-width)] min-w-56 rounded-lg"
align="start"
- side={sidebar.isMobile ? 'bottom' : 'right'}
+ side="right"
sideOffset={4}
>
<div
diff --git a/frontend/src/lib/components/sidebar/sidebar-locale-picker.svelte b/frontend/src/lib/components/sidebar/sidebar-locale-picker.svelte
deleted file mode 100644
index ea21ce4b5..000000000
--- a/frontend/src/lib/components/sidebar/sidebar-locale-picker.svelte
+++ /dev/null
@@ -1,46 +0,0 @@
-<script lang="ts">
- import * as Select from '$lib/components/ui/select/index.js';
- import { getLocale, type Locale } from '$lib/paraglide/runtime';
- import { m } from '$lib/paraglide/messages';
- import userStore from '$lib/stores/user-store';
- import { setLocale } from '$lib/utils/locale.util';
- import { Label } from '$lib/components/ui/label/index.js';
- import { userService } from '$lib/services/user-service';
-
- const currentLocale = getLocale();
- const controlId = 'localePicker';
-
- const locales: Record<string, string> = {
- en: 'English',
- eo: 'Esperanto',
- es: 'Español',
- fr: 'Français',
- nl: 'Nederlands',
- zh: 'Chinese'
- };
-
- async function updateLocale(locale: Locale) {
- if ($userStore) {
- await userService.update($userStore.id, { ...$userStore, locale });
- }
- await setLocale(locale);
- }
-</script>
-
-<div class="px-3 py-2">
- <div class="grid gap-2">
- <Label for={controlId} class="text-sm font-medium leading-none">
- {m.language()}
- </Label>
- <Select.Root type="single" value={currentLocale} onValueChange={(v) => updateLocale(v as Locale)}>
- <Select.Trigger id={controlId} class="h-9 w-full justify-between" aria-label={m.common_select_locale()}>
- <span class="truncate">{locales[currentLocale]}</span>
- </Select.Trigger>
- <Select.Content>
- {#each Object.entries(locales) as [value, label]}
- <Select.Item {value}>{label}</Select.Item>
- {/each}
- </Select.Content>
- </Select.Root>
- </div>
-</div>
diff --git a/frontend/src/lib/components/sidebar/sidebar-updatebanner.svelte b/frontend/src/lib/components/sidebar/sidebar-updatebanner.svelte
index b4d12473e..3f0e310d6 100644
--- a/frontend/src/lib/components/sidebar/sidebar-updatebanner.svelte
+++ b/frontend/src/lib/components/sidebar/sidebar-updatebanner.svelte
@@ -67,7 +67,7 @@
</div>
{/snippet}
</Tooltip.Trigger>
- <Tooltip.Content side="right" align="center" hidden={sidebar.state !== 'collapsed' || sidebar.isMobile || sidebar.isHovered}>
+ <Tooltip.Content side="right" align="center" hidden={sidebar.state !== 'collapsed' || sidebar.isHovered}>
{m.sidebar_update_available_tooltip({ version: versionInformation?.newestVersion ?? m.common_unknown() })}
</Tooltip.Content>
</Tooltip.Root>
diff --git a/frontend/src/lib/components/sidebar/sidebar-user.svelte b/frontend/src/lib/components/sidebar/sidebar-user.svelte
index 39c6fe88f..cf70fbca0 100644
--- a/frontend/src/lib/components/sidebar/sidebar-user.svelte
+++ b/frontend/src/lib/components/sidebar/sidebar-user.svelte
@@ -11,12 +11,13 @@
import { cn } from '$lib/utils';
import settingsStore from '$lib/stores/config-store';
import { m } from '$lib/paraglide/messages';
- import SidebarLocalePicker from './sidebar-locale-picker.svelte';
+ import LocalePicker from '$lib/components/locale-picker.svelte';
let { user, isCollapsed }: { user: User; isCollapsed: boolean } = $props();
const sidebar = useSidebar();
let dropdownOpen = $state(false);
+ let localePickerOpen = $state(false);
$effect(() => {
if (sidebar.state === 'collapsed' && !sidebar.isHovered && dropdownOpen) {
@@ -76,12 +77,7 @@
</Sidebar.MenuButton>
{/snippet}
</DropdownMenu.Trigger>
- <DropdownMenu.Content
- class="min-w-56 rounded-lg p-0"
- side={sidebar.isMobile ? 'bottom' : 'right'}
- align="end"
- sideOffset={12}
- >
+ <DropdownMenu.Content class="min-w-56 rounded-lg p-0" side="right" align="end" sideOffset={12}>
<div
role="group"
tabindex="-1"
@@ -91,7 +87,9 @@
}
}}
onmouseleave={() => {
- sidebar.setHovered(false, 150);
+ if (!localePickerOpen) {
+ sidebar.setHovered(false, 150);
+ }
}}
>
<DropdownMenu.Label class="px-3 pb-2 pt-2 font-normal">
@@ -122,7 +120,15 @@
</DropdownMenu.Label>
<DropdownMenu.Separator />
- <SidebarLocalePicker />
+ <LocalePicker
+ inline={false}
+ onOpenChange={(open: boolean) => {
+ localePickerOpen = open;
+ if (!open && sidebar.state === 'collapsed') {
+ sidebar.setHovered(false, 150);
+ }
+ }}
+ />
<DropdownMenu.Group class="px-3 pb-2">
<Button.Root
diff --git a/frontend/src/lib/components/sidebar/sidebar.svelte b/frontend/src/lib/components/sidebar/sidebar.svelte
index e96dad64f..d9dc614ba 100644
--- a/frontend/src/lib/components/sidebar/sidebar.svelte
+++ b/frontend/src/lib/components/sidebar/sidebar.svelte
@@ -1,5 +1,5 @@
<script lang="ts" module>
- import { sidebarItems } from '$lib/config/sidebar-config';
+ import { navigationItems } from '$lib/config/navigation-config';
</script>
<script lang="ts">
@@ -48,7 +48,6 @@
<Sidebar.Header>
<div class="relative">
<SidebarLogo {isCollapsed} {versionInformation} />
- <!-- Pin button positioned in top right, only visible when not collapsed or on hover -->
{#if !isCollapsed || sidebar.isHovered}
<div class="absolute top-0 right-0 -mt-1 -mr-1">
<SidebarPinButton />
@@ -58,11 +57,11 @@
<SidebarEnvSwitcher {isAdmin} />
</Sidebar.Header>
<Sidebar.Content>
- <SidebarItemGroup label={m.sidebar_management()} items={sidebarItems.managementItems} />
- <SidebarItemGroup label={m.sidebar_customization()} items={sidebarItems.customizationItems} />
+ <SidebarItemGroup label={m.sidebar_management()} items={navigationItems.managementItems} />
+ <SidebarItemGroup label={m.sidebar_customization()} items={navigationItems.customizationItems} />
{#if isAdmin}
- <SidebarItemGroup label={m.sidebar_environments()} items={sidebarItems.environmentItems} />
- <SidebarItemGroup label={m.sidebar_administration()} items={sidebarItems.settingsItems} />
+ <SidebarItemGroup label={m.sidebar_environments()} items={navigationItems.environmentItems} />
+ <SidebarItemGroup label={m.sidebar_administration()} items={navigationItems.settingsItems} />
{/if}
</Sidebar.Content>
<Sidebar.Footer>
diff --git a/frontend/src/lib/components/ui-config-disabled-tag.svelte b/frontend/src/lib/components/ui-config-disabled-tag.svelte
index c6e952e5a..25f1d0f69 100644
--- a/frontend/src/lib/components/ui-config-disabled-tag.svelte
+++ b/frontend/src/lib/components/ui-config-disabled-tag.svelte
@@ -8,20 +8,22 @@
</script>
{#if active}
+<Tooltip.Provider>
<Tooltip.Root>
- <Tooltip.Trigger>
- <span
- class="inline-flex items-center gap-1.5 rounded-full bg-amber-100 px-2.5 py-1 text-xs font-medium text-amber-800 ring-1 ring-amber-200 dark:bg-amber-900/50 dark:text-amber-200 dark:ring-amber-800"
- >
- <LockIcon class="size-3" />
- Read-only
- </span>
- </Tooltip.Trigger>
- <Tooltip.Content side="bottom" class="max-w-xs">
- <div class="space-y-1">
- <p class="font-medium">{m.ui_config_disabled_title()}</p>
- <p class="text-xs opacity-90">{m.ui_config_disabled_description()}</p>
- </div>
- </Tooltip.Content>
- </Tooltip.Root>
+ <Tooltip.Trigger>
+ <span
+ class="inline-flex items-center gap-1.5 rounded-full bg-amber-100 px-2.5 py-1 text-xs font-medium text-amber-800 ring-1 ring-amber-200 dark:bg-amber-900/50 dark:text-amber-200 dark:ring-amber-800"
+ >
+ <LockIcon class="size-3" />
+ Read-only
+ </span>
+ </Tooltip.Trigger>
+ <Tooltip.Content side="bottom" class="max-w-xs">
+ <div class="space-y-1">
+ <p class="font-medium">{m.ui_config_disabled_title()}</p>
+ <p class="text-xs opacity-90">{m.ui_config_disabled_description()}</p>
+ </div>
+ </Tooltip.Content>
+ </Tooltip.Root>
+ </Tooltip.Provider>
{/if}
diff --git a/frontend/src/lib/components/ui/sidebar/context.svelte.ts b/frontend/src/lib/components/ui/sidebar/context.svelte.ts
index af2e28998..6cd3b2aa2 100644
--- a/frontend/src/lib/components/ui/sidebar/context.svelte.ts
+++ b/frontend/src/lib/components/ui/sidebar/context.svelte.ts
@@ -1,4 +1,3 @@
-import { IsMobile } from '$lib/hooks/is-mobile.svelte.js';
import { IsTablet } from '$lib/hooks/is-tablet.svelte.js';
import { getContext, setContext } from 'svelte';
import { PersistedState } from 'runed';
@@ -25,9 +24,7 @@ export type SidebarStateProps = {
class SidebarState {
readonly props: SidebarStateProps;
open = $derived.by(() => this.props.open());
- openMobile = $state(false);
setOpen: SidebarStateProps['setOpen'];
- #isMobile: IsMobile;
#isTablet: IsTablet;
#isPinnedState = new PersistedState('sidebar-pinned', true);
#isHovered = $state(false);
@@ -36,14 +33,13 @@ class SidebarState {
constructor(props: SidebarStateProps) {
this.setOpen = props.setOpen;
- this.#isMobile = new IsMobile();
this.#isTablet = new IsTablet();
this.props = props;
// Sync the open state based on pinning preference and screen size
$effect(() => {
- // On tablet and mobile, always collapse regardless of pinning preference
- if (this.#isTablet.current || this.#isMobile.current) {
+ // On tablet, always collapse regardless of pinning preference
+ if (this.#isTablet.current) {
if (this.open) {
this.setOpen(false);
}
@@ -56,12 +52,6 @@ class SidebarState {
});
}
- // Convenience getter for checking if the sidebar is mobile
- // without this, we would need to use `sidebar.isMobile.current` everywhere
- get isMobile() {
- return this.#isMobile.current;
- }
-
// Convenience getter for checking if the screen is tablet size
get isTablet() {
return this.#isTablet.current;
@@ -121,17 +111,10 @@ class SidebarState {
}
};
- setOpenMobile = (value: boolean) => {
- this.openMobile = value;
- };
+
toggle = () => {
- if (this.#isMobile.current) {
- return this.openMobile = !this.openMobile;
- } else if (this.#isTablet.current) {
- // In tablet mode, sidebar should stay collapsed - no toggle allowed
- return;
- } else {
+ if (!this.#isTablet.current) {
// On desktop, toggle the pinning preference
this.#isPinnedState.current = !this.#isPinnedState.current;
return this.setOpen(this.#isPinnedState.current);
diff --git a/frontend/src/lib/components/ui/sidebar/sidebar-menu-button.svelte b/frontend/src/lib/components/ui/sidebar/sidebar-menu-button.svelte
index dada96789..8dde125fc 100644
--- a/frontend/src/lib/components/ui/sidebar/sidebar-menu-button.svelte
+++ b/frontend/src/lib/components/ui/sidebar/sidebar-menu-button.svelte
@@ -88,7 +88,7 @@
<Tooltip.Content
side="right"
align="center"
- hidden={sidebar.state !== 'collapsed' || sidebar.isMobile || sidebar.isHovered}
+ hidden={sidebar.state !== 'collapsed' || sidebar.isHovered}
{...tooltipContentProps}
>
{#if typeof tooltipContent === 'string'}
diff --git a/frontend/src/lib/components/ui/sidebar/sidebar.svelte b/frontend/src/lib/components/ui/sidebar/sidebar.svelte
index fd3ec3405..edb2048dc 100644
--- a/frontend/src/lib/components/ui/sidebar/sidebar.svelte
+++ b/frontend/src/lib/components/ui/sidebar/sidebar.svelte
@@ -30,25 +30,6 @@
>
{@render children?.()}
</div>
-{:else if sidebar.isMobile}
- <Sheet.Root bind:open={sidebar.openMobile} onOpenChange={sidebar.setOpenMobile} {...restProps}>
- <Sheet.Content
- data-sidebar="sidebar"
- data-slot="sidebar"
- data-mobile="true"
- class="bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden"
- style="--sidebar-width: {SIDEBAR_WIDTH_MOBILE};"
- {side}
- >
- <Sheet.Header class="sr-only">
- <Sheet.Title>Sidebar</Sheet.Title>
- <Sheet.Description>Displays the mobile sidebar.</Sheet.Description>
- </Sheet.Header>
- <div class="flex h-full w-full flex-col">
- {@render children?.()}
- </div>
- </Sheet.Content>
- </Sheet.Root>
{:else}
<div
bind:this={ref}
diff --git a/frontend/src/lib/config/sidebar-config.ts b/frontend/src/lib/config/navigation-config.ts
similarity index 61%
rename from frontend/src/lib/config/sidebar-config.ts
rename to frontend/src/lib/config/navigation-config.ts
index 9f1ca3bbc..c9beab9b4 100644
--- a/frontend/src/lib/config/sidebar-config.ts
+++ b/frontend/src/lib/config/navigation-config.ts
@@ -13,16 +13,17 @@ import ShieldIcon from '@lucide/svelte/icons/shield';
import ComputerIcon from '@lucide/svelte/icons/computer';
import LockKeyholeIcon from '@lucide/svelte/icons/lock-keyhole';
import AlarmClockIcon from '@lucide/svelte/icons/alarm-clock';
+import NavigationIcon from '@lucide/svelte/icons/navigation';
import { m } from '$lib/paraglide/messages';
-export type SidebarItem = {
+export type NavigationItem = {
title: string;
url: string;
icon: typeof IconType;
- items?: SidebarItem[];
+ items?: NavigationItem[];
};
-export const sidebarItems: Record<string, SidebarItem[]> = {
+export const navigationItems: Record<string, NavigationItem[]> = {
managementItems: [
{ title: m.dashboard_title(), url: '/dashboard', icon: HouseIcon },
{ title: m.containers_title(), url: '/containers', icon: ContainerIcon },
@@ -63,9 +64,50 @@ export const sidebarItems: Record<string, SidebarItem[]> = {
items: [
{ title: m.general_title(), url: '/settings/general', icon: SettingsIcon },
{ title: m.docker_title(), url: '/settings/docker', icon: DatabaseIcon },
- { title: m.users_title(), url: '/settings/users', icon: UserIcon },
- { title: m.security_title(), url: '/settings/security', icon: ShieldIcon }
+ { title: m.security_title(), url: '/settings/security', icon: ShieldIcon },
+ { title: m.navigation_title(), url: '/settings/navigation', icon: NavigationIcon },
+ { title: m.users_title(), url: '/settings/users', icon: UserIcon }
]
}
]
};
+
+export const defaultMobilePinnedItems: NavigationItem[] = [
+ navigationItems.managementItems[0],
+ navigationItems.managementItems[1],
+ navigationItems.managementItems[3],
+ navigationItems.managementItems[5]
+];
+
+export type MobileNavigationSettings = {
+ pinnedItems: string[];
+ mode: 'floating' | 'docked';
+ showLabels: boolean;
+ scrollToHide: boolean;
+ tapToHide: boolean;
+};
+
+export function getAvailableMobileNavItems(): NavigationItem[] {
+ const flatItems: NavigationItem[] = [];
+
+ flatItems.push(...navigationItems.managementItems);
+ flatItems.push(...navigationItems.customizationItems);
+
+ if (navigationItems.environmentItems) {
+ flatItems.push(...navigationItems.environmentItems);
+ }
+ if (navigationItems.settingsItems) {
+ const settingsTopLevel = navigationItems.settingsItems.filter((item) => !item.items);
+ flatItems.push(...settingsTopLevel);
+ }
+
+ return flatItems;
+}
+
+export const defaultMobileNavigationSettings: MobileNavigationSettings = {
+ pinnedItems: defaultMobilePinnedItems.map((item) => item.url),
+ mode: 'floating',
+ showLabels: true,
+ scrollToHide: true,
+ tapToHide: false
+};
diff --git a/frontend/src/lib/hooks/use-mobile-nav-interactions.ts b/frontend/src/lib/hooks/use-mobile-nav-interactions.ts
new file mode 100644
index 000000000..add3e65b7
--- /dev/null
+++ b/frontend/src/lib/hooks/use-mobile-nav-interactions.ts
@@ -0,0 +1,360 @@
+import { ScrollDirectionDetector } from './use-scroll-direction.svelte';
+import { TapOutsideDetector } from './use-tap-outside.svelte';
+import { SwipeGestureDetector, type SwipeDirection } from './use-swipe-gesture.svelte';
+
+export interface MobileNavInteractionOptions {
+ // Scroll detection options
+ scrollThreshold?: number;
+ scrollMinDistance?: number;
+ scrollTopThreshold?: number;
+ scrollChangeThreshold?: number;
+
+ // Tap detection options
+ tapDebounceTimeout?: number;
+
+ // Swipe detection options
+ swipeThreshold?: number;
+ swipeVelocity?: number;
+ swipeTimeLimit?: number;
+
+ // Touch handling options
+ touchEndDelay?: number;
+ menuOpenRestoreDelay?: number;
+ overlayFadeOutDelay?: number;
+ wheelThreshold?: number;
+}
+
+export interface MobileNavInteractionCallbacks {
+ onVisibilityChange: (visible: boolean) => void;
+ onMenuOpen: () => void;
+ onScrollDirectionChange?: (direction: string, scrollY: number) => void;
+ shouldPreventTouch?: (menuOpen: boolean) => boolean;
+}
+
+export interface MobileNavInteractionState {
+ menuOpen: boolean;
+ scrollToHideEnabled: boolean;
+ tapToHideEnabled: boolean;
+ visible: boolean;
+}
+
+export class MobileNavInteractionManager {
+ private readonly scrollDetector: ScrollDirectionDetector;
+ private readonly tapDetector: TapOutsideDetector;
+ private readonly swipeDetector: SwipeGestureDetector;
+
+ private readonly options: Required<MobileNavInteractionOptions>;
+ private readonly callbacks: MobileNavInteractionCallbacks;
+ private state: MobileNavInteractionState;
+
+ private navElement: HTMLElement | null = null;
+ private tapDebounceTimeoutId: ReturnType<typeof setTimeout> | null = null;
+ private lastGestureTime = 0;
+ private lastScrollDirection: string | null = null;
+ private lastScrollY = 0;
+
+ // Touch handling state
+ private touchStartTarget: HTMLElement | null = null;
+ private isInteractiveTouch = false;
+
+ // Cleanup functions
+ private cleanupFunctions: (() => void)[] = [];
+
+ constructor(callbacks: MobileNavInteractionCallbacks, options: MobileNavInteractionOptions = {}) {
+ this.callbacks = callbacks;
+ this.options = {
+ scrollThreshold: options.scrollThreshold ?? 15,
+ scrollMinDistance: options.scrollMinDistance ?? 100,
+ scrollTopThreshold: options.scrollTopThreshold ?? 100,
+ scrollChangeThreshold: options.scrollChangeThreshold ?? 50,
+ tapDebounceTimeout: options.tapDebounceTimeout ?? 300,
+ swipeThreshold: options.swipeThreshold ?? 20,
+ swipeVelocity: options.swipeVelocity ?? 0.1,
+ swipeTimeLimit: options.swipeTimeLimit ?? 1000,
+ touchEndDelay: options.touchEndDelay ?? 150,
+ menuOpenRestoreDelay: options.menuOpenRestoreDelay ?? 50,
+ overlayFadeOutDelay: options.overlayFadeOutDelay ?? 200,
+ wheelThreshold: options.wheelThreshold ?? 10
+ };
+
+ this.state = {
+ menuOpen: false,
+ scrollToHideEnabled: false,
+ tapToHideEnabled: false,
+ visible: true
+ };
+
+ // Initialize detectors directly in constructor
+ this.scrollDetector = new ScrollDirectionDetector(this.options.scrollThreshold);
+
+ this.tapDetector = new TapOutsideDetector(() => {
+ if (!this.state.tapToHideEnabled) return;
+
+ // Debounce rapid taps to prevent bouncing animation
+ if (this.tapDebounceTimeoutId) {
+ clearTimeout(this.tapDebounceTimeoutId);
+ this.tapDebounceTimeoutId = null;
+ return;
+ }
+
+ // Toggle visibility - if visible, hide it; if hidden, show it
+ const newVisibility = !this.state.visible;
+ this.state.visible = newVisibility;
+ this.callbacks.onVisibilityChange(newVisibility);
+
+ // Set debounce timeout
+ this.tapDebounceTimeoutId = setTimeout(() => {
+ this.tapDebounceTimeoutId = null;
+ }, this.options.tapDebounceTimeout);
+ });
+
+ this.swipeDetector = new SwipeGestureDetector(
+ (direction: SwipeDirection) => {
+ if (direction === 'up') {
+ this.lastGestureTime = Date.now();
+ this.callbacks.onMenuOpen();
+ }
+ },
+ {
+ threshold: this.options.swipeThreshold,
+ velocity: this.options.swipeVelocity,
+ timeLimit: this.options.swipeTimeLimit
+ }
+ );
+ }
+
+ public updateState(newState: Partial<MobileNavInteractionState>) {
+ this.state = { ...this.state, ...newState };
+ }
+
+ public resetVisibility() {
+ this.state.visible = true;
+ this.callbacks.onVisibilityChange(true);
+ }
+
+ public setupElement(element: HTMLElement | null) {
+ // Cleanup previous setup
+ this.cleanup();
+
+ this.navElement = element;
+
+ if (!element) return;
+
+ // Setup tap detection target
+ if (this.state.tapToHideEnabled) {
+ this.tapDetector.setTargetElement(element);
+ }
+
+ // Setup swipe detection target
+ this.swipeDetector.setElement(element);
+
+ // Setup touch event handlers
+ this.setupTouchHandlers(element);
+
+ // Setup mouse event handlers for desktop/pointer devices
+ this.setupMouseHandlers(element);
+ }
+
+ private setupTouchHandlers(element: HTMLElement) {
+ const handleTouchStart = (e: TouchEvent) => {
+ const shouldPreventTouch = this.callbacks.shouldPreventTouch?.(this.state.menuOpen);
+ if (shouldPreventTouch) return;
+
+ // 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"]');
+
+ // Only prevent background scrolling for gesture interactions
+ if (!this.isInteractiveTouch) {
+ this.lockBodyScroll();
+ e.stopPropagation();
+ }
+ };
+
+ 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
+ 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"]');
+
+ if (!stillOnInteractive) {
+ // Moved off interactive element, treat as gesture
+ this.isInteractiveTouch = false;
+ }
+ }
+ };
+
+ 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('touchend', handleTouchEnd, { passive: true, capture: false });
+
+ // Store cleanup functions
+ this.cleanupFunctions.push(() => {
+ element.removeEventListener('touchstart', handleTouchStart);
+ element.removeEventListener('touchmove', handleTouchMove);
+ element.removeEventListener('touchend', handleTouchEnd);
+ });
+ }
+
+ private setupMouseHandlers(element: HTMLElement) {
+ const handleWheel = (e: WheelEvent) => {
+ e.preventDefault();
+ e.stopPropagation();
+
+ // Only respond to downward gestures
+ 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';
+ };
+
+ const handleMouseLeave = () => {
+ // Restore page scrolling when leaving navbar
+ document.removeEventListener('wheel', handleDocumentWheel, true);
+ element.removeEventListener('wheel', handleWheel);
+
+ // Restore scrolling and interactions
+ this.unlockBodyScroll();
+ document.body.style.pointerEvents = '';
+ element.style.pointerEvents = '';
+ };
+
+ element.addEventListener('mouseenter', handleMouseEnter);
+ element.addEventListener('mouseleave', handleMouseLeave);
+
+ // Store cleanup functions
+ this.cleanupFunctions.push(() => {
+ element.removeEventListener('mouseenter', handleMouseEnter);
+ element.removeEventListener('mouseleave', handleMouseLeave);
+ element.removeEventListener('wheel', handleWheel);
+ document.removeEventListener('wheel', handleDocumentWheel, true);
+ });
+ }
+
+ public handleScrollEffect(direction: string, scrollY: number) {
+ // Only update when scroll direction or position changes significantly
+ if (
+ (direction !== this.lastScrollDirection || Math.abs(scrollY - this.lastScrollY) > this.options.scrollChangeThreshold) &&
+ this.state.scrollToHideEnabled
+ ) {
+ this.lastScrollDirection = direction;
+ this.lastScrollY = scrollY;
+
+ // Call optional callback
+ this.callbacks.onScrollDirectionChange?.(direction, scrollY);
+
+ // Update visibility state based on scroll behavior
+ if (direction === 'down' && scrollY > this.options.scrollMinDistance) {
+ this.state.visible = false;
+ this.callbacks.onVisibilityChange(false);
+ } else if (direction === 'up') {
+ this.state.visible = true;
+ this.callbacks.onVisibilityChange(true);
+ } else if (direction === 'idle' && scrollY <= this.options.scrollTopThreshold) {
+ this.state.visible = true;
+ this.callbacks.onVisibilityChange(true);
+ }
+ }
+ }
+
+ public handleMenuStateChange(previousMenuOpen: boolean, currentMenuOpen: boolean) {
+ // If menu was open and is now closed, make navigation bar visible
+ if (previousMenuOpen && !currentMenuOpen) {
+ 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() {
+ // Cleanup all event listeners
+ this.cleanupFunctions.forEach((fn) => fn());
+ this.cleanupFunctions = [];
+
+ // 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 = '';
+
+ if (this.navElement) {
+ this.navElement.style.pointerEvents = '';
+ }
+
+ // Clean up any remaining overlay
+ }
+
+ // Getters for accessing detectors
+ public get scrollDirection() {
+ return this.scrollDetector.direction;
+ }
+
+ public get scrollY() {
+ return this.scrollDetector.scrollY;
+ }
+}
+
+// Convenience function for Svelte components
+export function createMobileNavInteractions(callbacks: MobileNavInteractionCallbacks, options: MobileNavInteractionOptions = {}) {
+ return new MobileNavInteractionManager(callbacks, options);
+}
diff --git a/frontend/src/lib/hooks/use-scroll-direction.svelte.ts b/frontend/src/lib/hooks/use-scroll-direction.svelte.ts
new file mode 100644
index 000000000..3d2a80df7
--- /dev/null
+++ b/frontend/src/lib/hooks/use-scroll-direction.svelte.ts
@@ -0,0 +1,82 @@
+import { onMount } 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;
+
+ constructor(threshold = 10) {
+ this.scrollThreshold = threshold;
+
+ onMount(() => {
+ this.lastScrollY = window.scrollY;
+
+ const handleScroll = this.throttle(() => {
+ const currentScrollY = window.scrollY;
+ const scrollDiff = currentScrollY - this.lastScrollY;
+
+ // Only update direction if scroll difference exceeds threshold
+ if (Math.abs(scrollDiff) > this.scrollThreshold) {
+ const newDirection = 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;
+ }
+
+ this.isScrolling = true;
+
+ // Clear existing timeout
+ 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);
+ }
+ };
+ });
+ }
+
+ get direction() {
+ return this.scrollDirection;
+ }
+
+ get scrolling() {
+ 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;
+ }
+}
diff --git a/frontend/src/lib/hooks/use-swipe-gesture.svelte.ts b/frontend/src/lib/hooks/use-swipe-gesture.svelte.ts
new file mode 100644
index 000000000..62f78ebcc
--- /dev/null
+++ b/frontend/src/lib/hooks/use-swipe-gesture.svelte.ts
@@ -0,0 +1,186 @@
+import { onMount } from 'svelte';
+
+export type SwipeDirection = 'up' | 'down' | 'left' | 'right';
+
+export interface SwipeGestureOptions {
+ threshold?: number; // Minimum distance in pixels
+ velocity?: number; // Minimum velocity in pixels/ms
+ timeLimit?: number; // Maximum time for swipe in ms
+}
+
+export class SwipeGestureDetector {
+ private startX = 0;
+ private startY = 0;
+ private startTime = 0;
+ private element = $state<HTMLElement | null>(null);
+ private onSwipe: (direction: SwipeDirection, details: SwipeDetails) => void;
+ private options: Required<SwipeGestureOptions>;
+ private cleanupFn: (() => void) | null = null;
+ private isInteractiveTouch = false;
+
+ 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
+ };
+
+ onMount(() => {
+ return () => {
+ if (this.cleanupFn) {
+ this.cleanupFn();
+ }
+ };
+ });
+ }
+
+ setElement(element: HTMLElement | null) {
+ // Clean up previous listeners
+ if (this.cleanupFn) {
+ this.cleanupFn();
+ this.cleanupFn = null;
+ }
+
+ this.element = element;
+
+ if (!element) return;
+
+ const handleTouchStart = (e: TouchEvent) => {
+ const touch = e.touches[0];
+ this.startX = touch.clientX;
+ this.startY = touch.clientY;
+ this.startTime = Date.now();
+
+ // Store if this started on an interactive element
+ const target = e.target as HTMLElement;
+ const isInteractive = target.closest('button, a, [role="button"], input, textarea, select');
+ this.isInteractiveTouch = !!isInteractive;
+ };
+
+ const handleTouchEnd = (e: TouchEvent) => {
+ const touch = e.changedTouches[0];
+ const endX = touch.clientX;
+ const endY = touch.clientY;
+ const endTime = Date.now();
+
+ const deltaX = endX - this.startX;
+ const deltaY = endY - this.startY;
+ const deltaTime = endTime - this.startTime;
+
+ // Check if gesture meets time limit
+ if (deltaTime > this.options.timeLimit) return;
+
+ 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
+ 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
+ }
+ }
+
+ // Determine primary direction
+ const absDeltaX = Math.abs(deltaX);
+ const absDeltaY = Math.abs(deltaY);
+
+ let direction: SwipeDirection;
+ if (absDeltaX > absDeltaY) {
+ direction = deltaX > 0 ? 'right' : 'left';
+ } else {
+ direction = deltaY > 0 ? 'down' : 'up';
+ }
+
+ const details: SwipeDetails = {
+ deltaX,
+ deltaY,
+ distance,
+ velocity,
+ 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 });
+
+ 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 = '';
+ }
+ };
+ }
+}
+
+export interface SwipeDetails {
+ deltaX: number;
+ deltaY: number;
+ distance: number;
+ velocity: number;
+ duration: number;
+}
diff --git a/frontend/src/lib/hooks/use-tap-outside.svelte.ts b/frontend/src/lib/hooks/use-tap-outside.svelte.ts
new file mode 100644
index 000000000..c3433fc42
--- /dev/null
+++ b/frontend/src/lib/hooks/use-tap-outside.svelte.ts
@@ -0,0 +1,125 @@
+import { onMount } from 'svelte';
+
+export class TapOutsideDetector {
+ private callback: () => void;
+ private targetElement = $state<HTMLElement | null>(null);
+ private touchStartTime = 0;
+ private touchStartPosition = { x: 0, y: 0 };
+
+ constructor(callback: () => void) {
+ this.callback = callback;
+
+ onMount(() => {
+ const handleInteraction = (event: MouseEvent | TouchEvent) => {
+ // Only trigger on non-interactive elements
+ const target = event.target as HTMLElement;
+
+ // Check if the interaction is on an interactive element
+ const isInteractive = this.isInteractiveElement(target);
+
+ // If no target element has been set yet, don't treat interactions
+ // as taps outside — short-circuit to avoid spurious closes.
+ if (!this.targetElement) return;
+
+ // Compute styles once for the target element and check visibility.
+ const navStyle = window.getComputedStyle(this.targetElement);
+ const isVisibleNavElement =
+ this.targetElement.contains(target) &&
+ navStyle.visibility !== 'hidden' &&
+ navStyle.opacity !== '0' &&
+ navStyle.display !== 'none' &&
+ navStyle.pointerEvents !== 'none';
+
+ // Interaction is outside only when the nav exists and the event target
+ // is not within the visible nav element.
+ const isOutsideNav = !isVisibleNavElement;
+
+ // Only call the callback when the element exists, the interaction is
+ // outside the visible nav, and the target is not an interactive element.
+ if (!isInteractive && isOutsideNav && this.targetElement) {
+ this.callback();
+ }
+ };
+
+ const handleTouchStart = (event: TouchEvent) => {
+ const touch = event.touches[0];
+ this.touchStartTime = Date.now();
+ this.touchStartPosition = { x: touch.clientX, y: touch.clientY };
+ };
+
+ const handleTouchEnd = (event: TouchEvent) => {
+ const touch = event.changedTouches[0];
+ const endTime = Date.now();
+ const endPosition = { x: touch.clientX, y: touch.clientY };
+
+ // Calculate distance moved and time elapsed
+ const distance = Math.sqrt(
+ Math.pow(endPosition.x - this.touchStartPosition.x, 2) + Math.pow(endPosition.y - this.touchStartPosition.y, 2)
+ );
+ const duration = endTime - this.touchStartTime;
+
+ // Only trigger if it's a tap (short duration, minimal movement)
+ // This prevents triggering on swipes, scrolls, or long presses
+ if (duration < 300 && distance < 10) {
+ const target = document.elementFromPoint(touch.clientX, touch.clientY) as HTMLElement;
+
+ if (target) {
+ // Create a synthetic event for consistency
+ const syntheticEvent = { target } as unknown as TouchEvent;
+ handleInteraction(syntheticEvent);
+ }
+ }
+ };
+
+ // Use capture phase to catch events before they reach other elements
+ // But use bubble phase for touchend to avoid conflicts with navigation bar
+ document.addEventListener('click', handleInteraction, true);
+ document.addEventListener('touchstart', handleTouchStart, true);
+ document.addEventListener('touchend', handleTouchEnd, false);
+
+ return () => {
+ document.removeEventListener('click', handleInteraction, true);
+ document.removeEventListener('touchstart', handleTouchStart, true);
+ document.removeEventListener('touchend', handleTouchEnd, false);
+ };
+ });
+ }
+
+ setTargetElement(element: HTMLElement | null) {
+ this.targetElement = element;
+ }
+
+ private isInteractiveElement(element: HTMLElement): boolean {
+ // Check if element or any parent is interactive
+ let current: HTMLElement | null = element;
+
+ while (current) {
+ const tagName = current.tagName.toLowerCase();
+ const role = current.getAttribute('role');
+
+ // Interactive elements
+ if (['a', 'button', 'input', 'select', 'textarea'].includes(tagName)) {
+ return true;
+ }
+
+ // Elements with interactive roles
+ if (role && ['button', 'link', 'menuitem', 'option', 'tab'].includes(role)) {
+ return true;
+ }
+
+ // Elements with click handlers (heuristic)
+ if (current.onclick || current.style.cursor === 'pointer') {
+ return true;
+ }
+
+ // Elements with data attributes suggesting interactivity
+ if (current.hasAttribute('data-testid') && current.getAttribute('data-testid')?.includes('button')) {
+ return true;
+ }
+
+ current = current.parentElement;
+ }
+
+ return false;
+ }
+}
diff --git a/frontend/src/lib/types/settings.type.ts b/frontend/src/lib/types/settings.type.ts
index e0dc61787..47cfadcb4 100644
--- a/frontend/src/lib/types/settings.type.ts
+++ b/frontend/src/lib/types/settings.type.ts
@@ -33,6 +33,11 @@ export type Settings = {
settings?: boolean;
};
+ mobileNavigationMode: 'floating' | 'docked';
+ mobileNavigationShowLabels: boolean;
+ mobileNavigationScrollToHide: boolean;
+ mobileNavigationTapToHide: boolean;
+
registryCredentials: RegistryCredential[];
templateRegistries: TemplateRegistryConfig[];
};
diff --git a/frontend/src/lib/utils/navigation.utils.ts b/frontend/src/lib/utils/navigation.utils.ts
new file mode 100644
index 000000000..dc57dce70
--- /dev/null
+++ b/frontend/src/lib/utils/navigation.utils.ts
@@ -0,0 +1,64 @@
+import { PersistedState } from 'runed';
+import { defaultMobileNavigationSettings, type MobileNavigationSettings } from '$lib/config/navigation-config';
+import settingsStore from '$lib/stores/config-store';
+import { get } from 'svelte/store';
+import type { MobileNavInteractionManager } from '$lib/hooks/use-mobile-nav-interactions';
+
+export const pinnedItemsStore = new PersistedState('mobile-nav-settings', defaultMobileNavigationSettings);
+
+export const navigationSettingsOverridesStore = new PersistedState<Partial<MobileNavigationSettings>>(
+ 'navigation-settings-overrides',
+ {}
+);
+
+let mobileNavManager: MobileNavInteractionManager | null = null;
+
+export function registerNavigationManager(manager: MobileNavInteractionManager) {
+ mobileNavManager = manager;
+}
+
+export function resetNavigationVisibility() {
+ if (mobileNavManager) {
+ mobileNavManager.resetVisibility();
+ }
+}
+
+export function getEffectiveNavigationSettings(): MobileNavigationSettings {
+ const serverSettings = get(settingsStore);
+ const overrides = navigationSettingsOverridesStore.current;
+ const currentPinnedItems = pinnedItemsStore.current;
+
+ // Helper function to get effective value (override > server > default)
+ const getEffectiveValue = <T>(serverValue: T | undefined, overrideValue: T | undefined, defaultValue: T): T => {
+ return overrideValue !== undefined ? overrideValue : (serverValue ?? defaultValue);
+ };
+
+ return {
+ pinnedItems: overrides.pinnedItems ?? currentPinnedItems.pinnedItems,
+ mode: getEffectiveValue(serverSettings?.mobileNavigationMode, overrides.mode, defaultMobileNavigationSettings.mode),
+ showLabels: getEffectiveValue(
+ serverSettings?.mobileNavigationShowLabels,
+ overrides.showLabels,
+ defaultMobileNavigationSettings.showLabels
+ ),
+ scrollToHide: getEffectiveValue(
+ serverSettings?.mobileNavigationScrollToHide,
+ overrides.scrollToHide,
+ defaultMobileNavigationSettings.scrollToHide
+ ),
+ tapToHide: getEffectiveValue(
+ serverSettings?.mobileNavigationTapToHide,
+ overrides.tapToHide,
+ defaultMobileNavigationSettings.tapToHide
+ )
+ };
+}
+
+export function updateNavigationOverrides(overrides: Partial<MobileNavigationSettings>) {
+ const currentOverrides = navigationSettingsOverridesStore.current;
+ navigationSettingsOverridesStore.current = { ...currentOverrides, ...overrides };
+}
+
+export function clearNavigationOverrides() {
+ navigationSettingsOverridesStore.current = {};
+}
diff --git a/frontend/src/routes/+layout.svelte b/frontend/src/routes/+layout.svelte
index 5136d08b1..6d752bb34 100644
--- a/frontend/src/routes/+layout.svelte
+++ b/frontend/src/routes/+layout.svelte
@@ -13,6 +13,10 @@
import type { Snippet } from 'svelte';
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 { getEffectiveNavigationSettings, navigationSettingsOverridesStore } from '$lib/utils/navigation.utils';
let {
data,
@@ -24,8 +28,16 @@
const { versionInformation, user, settings } = data;
+ const isMobile = new IsMobile();
const isNavigating = $derived(navigating.type !== null);
const isOnboardingPage = $derived(String(page.url.pathname).startsWith('/onboarding'));
+
+ const navigationSettings = $derived.by(() => {
+ settings;
+ navigationSettingsOverridesStore.current;
+ return getEffectiveNavigationSettings();
+ });
+ const navigationMode = $derived(navigationSettings.mode);
const isLoginPage = $derived(
String(page.url.pathname) === '/login' ||
String(page.url.pathname).startsWith('/auth/login') ||
@@ -46,14 +58,30 @@
{#if !settings}
<Error message={m.error_occurred()} showButton={true} />
{:else if !isOnboardingPage && !isLoginPage}
- <Sidebar.Provider>
- <AppSidebar {versionInformation} {user} />
+ {#if isMobile.current}
<main class="flex-1">
- <section class="p-5">
+ <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)))' : ''}
+ >
{@render children()}
</section>
</main>
- </Sidebar.Provider>
+ {#if navigationMode === 'floating'}
+ <MobileFloatingNav {navigationSettings} {user} {versionInformation} />
+ {:else}
+ <MobileDockedNav {navigationSettings} {user} {versionInformation} />
+ {/if}
+ {:else}
+ <Sidebar.Provider>
+ <AppSidebar {versionInformation} {user} />
+ <main class="flex-1">
+ <section class="p-5">
+ {@render children()}
+ </section>
+ </main>
+ </Sidebar.Provider>
+ {/if}
{:else}
<main class="flex-1">
{@render children()}
diff --git a/frontend/src/routes/auth/login/+page.svelte b/frontend/src/routes/auth/login/+page.svelte
index 9a62bc743..e596328ac 100644
--- a/frontend/src/routes/auth/login/+page.svelte
+++ b/frontend/src/routes/auth/login/+page.svelte
@@ -63,7 +63,7 @@
const showDivider = $derived(showOidcLoginButton && showLocalLoginForm);
</script>
-<div class="bg-muted flex min-h-svh flex-col items-center justify-center p-6 md:p-10">
+<div class="bg-muted flex min-h-screen flex-col items-center justify-center p-6 md:p-10">
<div class="w-full max-w-sm md:max-w-3xl">
<div class="flex flex-col gap-6">
<Card.Root class="overflow-hidden p-0">
diff --git a/frontend/src/routes/containers/+page.svelte b/frontend/src/routes/containers/+page.svelte
index a84202fc4..02d84bf7e 100644
--- a/frontend/src/routes/containers/+page.svelte
+++ b/frontend/src/routes/containers/+page.svelte
@@ -10,6 +10,8 @@
import { ArcaneButton } from '$lib/components/arcane-button/index.js';
import { m } from '$lib/paraglide/messages';
import { imageService } from '$lib/services/image-service';
+ import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';
+ import EllipsisIcon from '@lucide/svelte/icons/ellipsis';
let { data } = $props();
@@ -56,12 +58,13 @@
</script>
<div class="space-y-6">
- <div class="flex flex-col justify-between gap-4 sm:flex-row sm:items-center">
+ <div class="relative flex flex-col justify-between gap-4 sm:flex-row sm:items-center">
<div>
<h1 class="text-3xl font-bold tracking-tight">{m.containers_title()}</h1>
<p class="text-muted-foreground mt-1 text-sm">{m.containers_subtitle()}</p>
</div>
- <div class="flex items-center gap-2">
+ <!-- Desktop buttons -->
+ <div class="hidden items-center gap-2 sm:flex">
<ArcaneButton
action="create"
customLabel={m.containers_create_button()}
@@ -84,6 +87,33 @@
disabled={isLoading.refreshing}
/>
</div>
+
+ <!-- Mobile / tablet: dropdown menu (positioned top-right on small screens) -->
+ <div class="absolute right-4 top-4 flex items-center sm:static sm:hidden">
+ <DropdownMenu.Root>
+ <DropdownMenu.Trigger class="bg-background/70 flex inline-flex size-9 items-center justify-center rounded-lg border">
+ <span class="sr-only">{m.common_open_menu()}</span>
+ <EllipsisIcon />
+ </DropdownMenu.Trigger>
+
+ <DropdownMenu.Content
+ align="end"
+ class="bg-card/80 supports-[backdrop-filter]:bg-card/60 z-50 min-w-[160px] rounded-md p-1 shadow-lg backdrop-blur-sm supports-[backdrop-filter]:backdrop-blur-sm"
+ >
+ <DropdownMenu.Group>
+ <DropdownMenu.Item onclick={() => (isCreateDialogOpen = true)} disabled={isLoading.create}>
+ {m.containers_create_button()}
+ </DropdownMenu.Item>
+ <DropdownMenu.Item onclick={handleCheckForUpdates} disabled={isLoading.checking}>
+ {m.containers_check_updates()}
+ </DropdownMenu.Item>
+ <DropdownMenu.Item onclick={refreshContainers} disabled={isLoading.refreshing}>
+ {m.common_refresh()}
+ </DropdownMenu.Item>
+ </DropdownMenu.Group>
+ </DropdownMenu.Content>
+ </DropdownMenu.Root>
+ </div>
</div>
<div class="grid grid-cols-1 gap-4 sm:grid-cols-3">
diff --git a/frontend/src/routes/customize/registries/+page.svelte b/frontend/src/routes/customize/registries/+page.svelte
index a96736b8c..f6f2f58ee 100644
--- a/frontend/src/routes/customize/registries/+page.svelte
+++ b/frontend/src/routes/customize/registries/+page.svelte
@@ -7,6 +7,8 @@
import ContainerRegistryFormSheet from '$lib/components/sheets/container-registry-sheet.svelte';
import RegistryTable from './registry-table.svelte';
import { ArcaneButton } from '$lib/components/arcane-button/index.js';
+ import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';
+ import EllipsisIcon from '@lucide/svelte/icons/ellipsis';
import { handleApiResultWithCallbacks } from '$lib/utils/api.util';
import { tryCatch } from '$lib/utils/try-catch';
import { m } from '$lib/paraglide/messages';
@@ -78,14 +80,14 @@
</script>
<div class="space-y-6">
- <div class="flex flex-col justify-between gap-4 sm:flex-row sm:items-center">
+ <div class="relative flex flex-col justify-between gap-4 sm:flex-row sm:items-center">
<div>
<h1 class="text-3xl font-bold tracking-tight">{m.registries_title()}</h1>
<p class="text-muted-foreground mt-1 text-sm">
{m.registries_subtitle()}
</p>
</div>
- <div class="flex items-center gap-2">
+ <div class="hidden items-center gap-2 sm:flex">
<ArcaneButton action="create" onclick={openCreateRegistryDialog} customLabel={m.registries_add_button()} />
<ArcaneButton
action="restart"
@@ -95,6 +97,29 @@
disabled={isLoading.refresh}
/>
</div>
+
+ <div class="absolute right-4 top-4 flex items-center sm:hidden">
+ <DropdownMenu.Root>
+ <DropdownMenu.Trigger class="bg-background/70 flex inline-flex size-9 items-center justify-center rounded-lg border">
+ <span class="sr-only">{m.common_open_menu()}</span>
+ <EllipsisIcon />
+ </DropdownMenu.Trigger>
+
+ <DropdownMenu.Content
+ align="end"
+ class="bg-card/80 supports-[backdrop-filter]:bg-card/60 z-50 min-w-[160px] rounded-md p-1 shadow-lg backdrop-blur-sm supports-[backdrop-filter]:backdrop-blur-sm"
+ >
+ <DropdownMenu.Group>
+ <DropdownMenu.Item onclick={openCreateRegistryDialog}>
+ {m.registries_add_button()}
+ </DropdownMenu.Item>
+ <DropdownMenu.Item onclick={refreshRegistries} disabled={isLoading.refresh}>
+ {m.common_refresh()}
+ </DropdownMenu.Item>
+ </DropdownMenu.Group>
+ </DropdownMenu.Content>
+ </DropdownMenu.Root>
+ </div>
</div>
<Card.Root class="border shadow-sm">
diff --git a/frontend/src/routes/customize/templates/+page.svelte b/frontend/src/routes/customize/templates/+page.svelte
index 40b355019..24e5ee842 100644
--- a/frontend/src/routes/customize/templates/+page.svelte
+++ b/frontend/src/routes/customize/templates/+page.svelte
@@ -15,6 +15,8 @@
import FolderOpenIcon from '@lucide/svelte/icons/folder-open';
import UsersIcon from '@lucide/svelte/icons/users';
import { toast } from 'svelte-sonner';
+ import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';
+ import EllipsisIcon from '@lucide/svelte/icons/ellipsis';
import AddTemplateRegistrySheet from '$lib/components/sheets/add-template-registry-sheet.svelte';
import StatCard from '$lib/components/stat-card.svelte';
import { m } from '$lib/paraglide/messages';
@@ -117,7 +119,7 @@
</script>
<div class="space-y-6">
- <div class="flex flex-col justify-between gap-4 sm:flex-row sm:items-center">
+ <div class="relative flex flex-col justify-between gap-4 sm:flex-row sm:items-center">
<div>
<h1 class="text-3xl font-bold tracking-tight">{m.templates_title()}</h1>
<p class="text-muted-foreground mt-1 text-sm">
@@ -126,10 +128,32 @@
</p>
</div>
- <Button onclick={refreshTemplates} class="h-10" variant="outline">
- <RefreshCwIcon class="mr-2 size-4" />
- {m.templates_refresh()}
- </Button>
+ <div class="hidden sm:flex">
+ <Button onclick={refreshTemplates} class="h-10" variant="outline">
+ <RefreshCwIcon class="mr-2 size-4" />
+ {m.templates_refresh()}
+ </Button>
+ </div>
+
+ <div class="absolute right-4 top-4 flex items-center sm:hidden">
+ <DropdownMenu.Root>
+ <DropdownMenu.Trigger class="bg-background/70 flex inline-flex size-9 items-center justify-center rounded-lg border">
+ <span class="sr-only">{m.common_open_menu()}</span>
+ <EllipsisIcon />
+ </DropdownMenu.Trigger>
+
+ <DropdownMenu.Content
+ align="end"
+ class="bg-card/80 supports-[backdrop-filter]:bg-card/60 z-50 min-w-[160px] rounded-md p-1 shadow-lg backdrop-blur-sm supports-[backdrop-filter]:backdrop-blur-sm"
+ >
+ <DropdownMenu.Group>
+ <DropdownMenu.Item onclick={refreshTemplates}>
+ {m.templates_refresh()}
+ </DropdownMenu.Item>
+ </DropdownMenu.Group>
+ </DropdownMenu.Content>
+ </DropdownMenu.Root>
+ </div>
</div>
<div class="grid grid-cols-1 gap-4 md:grid-cols-3">
diff --git a/frontend/src/routes/dashboard/+page.svelte b/frontend/src/routes/dashboard/+page.svelte
index 469fb89e1..cc4ad8ecc 100644
--- a/frontend/src/routes/dashboard/+page.svelte
+++ b/frontend/src/routes/dashboard/+page.svelte
@@ -106,39 +106,9 @@
}
}
- let imageRequestOptions = $state(data.imageRequestOptions);
-
async function refreshData() {
isLoading.refreshing = true;
- // const [dockerInfoResult, settingsResult, imagesResult, statusCountsResult] = await Promise.allSettled([
- // tryCatch(environmentAPI.getDockerInfo()),
- // tryCatch(settingsAPI.getSettings()),
- // tryCatch(environmentAPI.getImages(imageRequestOptions)),
- // tryCatch(environmentAPI.getContainerStatusCounts())
- // ]);
-
- // if (dockerInfoResult.status === 'fulfilled' && !dockerInfoResult.value.error) {
- // dashboardStates.dockerInfo = dockerInfoResult.value.data;
- // dockerInfo = dockerInfoResult.value.data;
- // }
- // isLoading.loadingDockerInfo = false;
-
- // if (settingsResult.status === 'fulfilled' && !settingsResult.value.error) {
- // dashboardStates.settings = settingsResult.value.data;
- // }
-
- // if (imagesResult.status === 'fulfilled') {
- // if (!imagesResult.value.error) {
- // images = imagesResult.value.data;
- // }
- // }
- // isLoading.loadingImages = false;
-
- // if (statusCountsResult.status === 'fulfilled' && !statusCountsResult.value.error) {
- // containerStatusCounts = statusCountsResult.value.data;
- // }
-
await invalidateAll();
isLoading.refreshing = false;
}
@@ -271,7 +241,7 @@
images: m.prune_unused_images(),
networks: m.prune_unused_networks(),
volumes: m.prune_unused_volumes(),
- buildCache: 'Build cache'
+ buildCache: m.build_cache()
};
const typesString = selectedTypes.map((t) => typeLabels[t]).join(', ');
@@ -293,7 +263,7 @@
</script>
<div class="space-y-8">
- <div class="flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between">
+ <div class="relative flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between">
<div class="space-y-1">
<h1 class="text-3xl font-bold tracking-tight">{m.dashboard_title()}</h1>
<p class="text-muted-foreground max-w-2xl text-sm">{m.dashboard_subtitle()}</p>
@@ -301,7 +271,7 @@
<div class="flex flex-wrap items-center justify-end gap-2">
<QuickActions
- class="flex flex-wrap items-center gap-2"
+ class="absolute right-4 top-4 flex-wrap items-center gap-2 sm:static sm:flex"
compact
dockerInfo={dashboardStates.dockerInfo}
{stoppedContainers}
@@ -319,11 +289,10 @@
<section>
<h2 class="mb-4 text-lg font-semibold tracking-tight">{m.dashboard_system_overview()}</h2>
- <div class="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4">
+ <div class="grid grid-cols-2 gap-3 sm:grid-cols-2 lg:grid-cols-4">
<MeterMetric
title={m.dashboard_meter_running()}
icon={ContainerIcon}
- description={m.dashboard_meter_running_desc()}
currentValue={isLoading.loadingStats ? undefined : runningContainers}
formatValue={(v) => v.toString()}
maxValue={Math.max(totalContainers, 1)}
diff --git a/frontend/src/routes/environments/+page.svelte b/frontend/src/routes/environments/+page.svelte
index 16b69aed5..73a48e86a 100644
--- a/frontend/src/routes/environments/+page.svelte
+++ b/frontend/src/routes/environments/+page.svelte
@@ -1,6 +1,8 @@
<script lang="ts">
import ServerIcon from '@lucide/svelte/icons/server';
import { toast } from 'svelte-sonner';
+ import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';
+ import EllipsisIcon from '@lucide/svelte/icons/ellipsis';
import { ArcaneButton } from '$lib/components/arcane-button/index.js';
import NewEnvironmentSheet from '$lib/components/sheets/new-environment-sheet.svelte';
import EnvironmentTable from './environment-table.svelte';
@@ -95,17 +97,14 @@
</script>
<div class="space-y-6">
- <div class="flex flex-col justify-between gap-4 sm:flex-row sm:items-center">
+ <div class="relative flex flex-col justify-between gap-4 sm:flex-row sm:items-center">
<div class="flex items-center gap-2">
- <div class="rounded-full bg-blue-500/10 p-2">
- <ServerIcon class="size-5 text-blue-500" />
- </div>
<div>
<h1 class="text-3xl font-bold tracking-tight">{m.environments_title()}</h1>
<p class="text-muted-foreground mt-1 text-sm">{m.environments_subtitle()}</p>
</div>
</div>
- <div class="flex items-center gap-2">
+ <div class="hidden items-center gap-2 sm:flex">
{#if selectedIds.length > 0}
<ArcaneButton
action="remove"
@@ -124,6 +123,32 @@
disabled={isLoading.refresh}
/>
</div>
+
+ <div class="absolute right-4 top-4 flex items-center sm:hidden">
+ <DropdownMenu.Root>
+ <DropdownMenu.Trigger class="bg-background/70 flex inline-flex size-9 items-center justify-center rounded-lg border">
+ <span class="sr-only">{m.common_open_menu()}</span>
+ <EllipsisIcon />
+ </DropdownMenu.Trigger>
+
+ <DropdownMenu.Content
+ align="end"
+ class="bg-card/80 supports-[backdrop-filter]:bg-card/60 z-50 min-w-[160px] rounded-md p-1 shadow-lg backdrop-blur-sm supports-[backdrop-filter]:backdrop-blur-sm"
+ >
+ <DropdownMenu.Group>
+ {#if selectedIds.length > 0}
+ <DropdownMenu.Item onclick={handleBulkDelete} disabled={isLoading.deleting}>
+ {m.environments_remove_selected_button()}
+ </DropdownMenu.Item>
+ {/if}
+ <DropdownMenu.Item onclick={() => (showEnvironmentSheet = true)}>{m.environments_add_button()}</DropdownMenu.Item>
+ <DropdownMenu.Item onclick={refresh} disabled={isLoading.refresh}>
+ {m.common_refresh()}
+ </DropdownMenu.Item>
+ </DropdownMenu.Group>
+ </DropdownMenu.Content>
+ </DropdownMenu.Root>
+ </div>
</div>
<EnvironmentTable bind:environments bind:selectedIds bind:requestOptions />
diff --git a/frontend/src/routes/events/+page.svelte b/frontend/src/routes/events/+page.svelte
index ea9069fa2..fd2beea46 100644
--- a/frontend/src/routes/events/+page.svelte
+++ b/frontend/src/routes/events/+page.svelte
@@ -8,6 +8,8 @@
import type { Event } from '$lib/types/event.type';
import EventTable from './event-table.svelte';
import { ArcaneButton } from '$lib/components/arcane-button/index.js';
+ import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';
+ import EllipsisIcon from '@lucide/svelte/icons/ellipsis';
import { openConfirmDialog } from '$lib/components/confirm-dialog';
import { m } from '$lib/paraglide/messages';
import { eventService } from '$lib/services/event-service';
@@ -90,12 +92,12 @@
</script>
<div class="flex h-full flex-col space-y-6">
- <div class="flex items-center justify-between">
+ <div class="relative flex items-center justify-between">
<div class="space-y-1">
<h2 class="text-2xl font-semibold tracking-tight">{m.events_title()}</h2>
<p class="text-muted-foreground text-sm">{m.events_subtitle()}</p>
</div>
- <div class="flex items-center gap-2">
+ <div class="hidden items-center gap-2 sm:flex">
{#if selectedIds.length > 0}
<ArcaneButton
action="remove"
@@ -113,6 +115,31 @@
disabled={isLoading.refreshing}
/>
</div>
+
+ <div class="absolute right-4 top-4 flex items-center sm:hidden">
+ <DropdownMenu.Root>
+ <DropdownMenu.Trigger class="bg-background/70 flex inline-flex size-9 items-center justify-center rounded-lg border">
+ <span class="sr-only">{m.common_open_menu()}</span>
+ <EllipsisIcon />
+ </DropdownMenu.Trigger>
+
+ <DropdownMenu.Content
+ align="end"
+ class="bg-card/80 supports-[backdrop-filter]:bg-card/60 z-50 min-w-[180px] rounded-md p-1 shadow-lg backdrop-blur-sm supports-[backdrop-filter]:backdrop-blur-sm"
+ >
+ <DropdownMenu.Group>
+ {#if selectedIds.length > 0}
+ <DropdownMenu.Item onclick={handleDeleteSelected} disabled={isLoading.deleting}>
+ {m.events_remove_selected()}
+ </DropdownMenu.Item>
+ {/if}
+ <DropdownMenu.Item onclick={refreshEvents} disabled={isLoading.refreshing}>
+ {m.common_refresh()}
+ </DropdownMenu.Item>
+ </DropdownMenu.Group>
+ </DropdownMenu.Content>
+ </DropdownMenu.Root>
+ </div>
</div>
<div class="grid gap-4 md:grid-cols-5">
diff --git a/frontend/src/routes/images/+page.svelte b/frontend/src/routes/images/+page.svelte
index 91f22778e..7869790ba 100644
--- a/frontend/src/routes/images/+page.svelte
+++ b/frontend/src/routes/images/+page.svelte
@@ -10,6 +10,8 @@
import { handleApiResultWithCallbacks } from '$lib/utils/api.util';
import { tryCatch } from '$lib/utils/try-catch';
import { ArcaneButton } from '$lib/components/arcane-button/index.js';
+ import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';
+ import EllipsisIcon from '@lucide/svelte/icons/ellipsis';
import StatCard from '$lib/components/stat-card.svelte';
import ImageTable from './image-table.svelte';
import { m } from '$lib/paraglide/messages';
@@ -73,12 +75,12 @@
</script>
<div class="space-y-6">
- <div class="flex flex-col justify-between gap-4 sm:flex-row sm:items-center">
+ <div class="relative flex flex-col justify-between gap-4 sm:flex-row sm:items-center">
<div>
<h1 class="text-2xl font-bold">{m.images_title()}</h1>
<p class="text-muted-foreground mt-1 text-sm">{m.images_subtitle()}</p>
</div>
- <div class="flex items-center gap-2">
+ <div class="hidden items-center gap-2 sm:flex">
<ArcaneButton action="pull" customLabel={m.images_pull_image()} onclick={() => (isPullDialogOpen = true)} />
<ArcaneButton
action="inspect"
@@ -104,6 +106,33 @@
disabled={isLoading.refreshing}
/>
</div>
+
+ <div class="absolute right-4 top-4 flex items-center sm:hidden">
+ <DropdownMenu.Root>
+ <DropdownMenu.Trigger class="bg-background/70 flex inline-flex size-9 items-center justify-center rounded-lg border">
+ <span class="sr-only">{m.common_open_menu()}</span>
+ <EllipsisIcon />
+ </DropdownMenu.Trigger>
+
+ <DropdownMenu.Content
+ align="end"
+ class="bg-card/80 supports-[backdrop-filter]:bg-card/60 z-50 min-w-[180px] rounded-md p-1 shadow-lg backdrop-blur-sm supports-[backdrop-filter]:backdrop-blur-sm"
+ >
+ <DropdownMenu.Group>
+ <DropdownMenu.Item onclick={() => (isPullDialogOpen = true)}>{m.images_pull_image()}</DropdownMenu.Item>
+ <DropdownMenu.Item onclick={handleTriggerBulkUpdateCheck} disabled={isLoading.checking}>
+ {m.images_check_updates()}
+ </DropdownMenu.Item>
+ <DropdownMenu.Item onclick={() => (isConfirmPruneDialogOpen = true)} disabled={isLoading.pruning}>
+ {m.images_prune_unused()}
+ </DropdownMenu.Item>
+ <DropdownMenu.Item onclick={refreshImages} disabled={isLoading.refreshing}>
+ {m.common_refresh()}
+ </DropdownMenu.Item>
+ </DropdownMenu.Group>
+ </DropdownMenu.Content>
+ </DropdownMenu.Root>
+ </div>
</div>
<div class="grid grid-cols-1 gap-4 sm:grid-cols-2">
diff --git a/frontend/src/routes/networks/+page.svelte b/frontend/src/routes/networks/+page.svelte
index 7373a1a74..bd19dd98b 100644
--- a/frontend/src/routes/networks/+page.svelte
+++ b/frontend/src/routes/networks/+page.svelte
@@ -6,6 +6,8 @@
import { handleApiResultWithCallbacks } from '$lib/utils/api.util';
import { tryCatch } from '$lib/utils/try-catch';
import CreateNetworkSheet from '$lib/components/sheets/create-network-sheet.svelte';
+ import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';
+ import EllipsisIcon from '@lucide/svelte/icons/ellipsis';
import { ArcaneButton } from '$lib/components/arcane-button/index.js';
import StatCard from '$lib/components/stat-card.svelte';
import NetworkTable from './network-table.svelte';
@@ -55,12 +57,12 @@
</script>
<div class="space-y-6">
- <div class="flex flex-col justify-between gap-4 sm:flex-row sm:items-center">
+ <div class="relative flex flex-col justify-between gap-4 sm:flex-row sm:items-center">
<div>
<h1 class="text-3xl font-bold tracking-tight">{m.networks_title()}</h1>
<p class="text-muted-foreground mt-1 text-sm">{m.networks_subtitle()}</p>
</div>
- <div class="flex items-center gap-2">
+ <div class="hidden items-center gap-2 sm:flex">
<ArcaneButton action="create" customLabel={m.networks_create_button()} onclick={() => (isCreateDialogOpen = true)} />
<ArcaneButton
action="restart"
@@ -70,6 +72,27 @@
disabled={isLoading.refresh}
/>
</div>
+
+ <div class="absolute right-4 top-4 flex items-center sm:hidden">
+ <DropdownMenu.Root>
+ <DropdownMenu.Trigger class="bg-background/70 flex inline-flex size-9 items-center justify-center rounded-lg border">
+ <span class="sr-only">{m.common_open_menu()}</span>
+ <EllipsisIcon />
+ </DropdownMenu.Trigger>
+
+ <DropdownMenu.Content
+ align="end"
+ class="bg-card/80 supports-[backdrop-filter]:bg-card/60 z-50 min-w-[160px] rounded-md p-1 shadow-lg backdrop-blur-sm supports-[backdrop-filter]:backdrop-blur-sm"
+ >
+ <DropdownMenu.Group>
+ <DropdownMenu.Item onclick={() => (isCreateDialogOpen = true)} disabled={isLoading.create}
+ >{m.networks_create_button()}</DropdownMenu.Item
+ >
+ <DropdownMenu.Item onclick={refreshNetworks} disabled={isLoading.refresh}>{m.common_refresh()}</DropdownMenu.Item>
+ </DropdownMenu.Group>
+ </DropdownMenu.Content>
+ </DropdownMenu.Root>
+ </div>
</div>
<div class="grid grid-cols-1 gap-4 sm:grid-cols-2">
diff --git a/frontend/src/routes/projects/+page.svelte b/frontend/src/routes/projects/+page.svelte
index 13c60f0b6..23738a4dd 100644
--- a/frontend/src/routes/projects/+page.svelte
+++ b/frontend/src/routes/projects/+page.svelte
@@ -6,6 +6,8 @@
import { handleApiResultWithCallbacks } from '$lib/utils/api.util';
import { tryCatch } from '$lib/utils/try-catch';
import { ArcaneButton } from '$lib/components/arcane-button/index.js';
+ import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';
+ import EllipsisIcon from '@lucide/svelte/icons/ellipsis';
import StatCard from '$lib/components/stat-card.svelte';
import ProjectsTable from './projects-table.svelte';
import { goto } from '$app/navigation';
@@ -54,12 +56,12 @@
</script>
<div class="space-y-6">
- <div class="flex flex-col justify-between gap-4 sm:flex-row sm:items-center">
+ <div class="relative flex flex-col justify-between gap-4 sm:flex-row sm:items-center">
<div>
<h1 class="text-3xl font-bold tracking-tight">{m.projects_title()}</h1>
<p class="text-muted-foreground mt-1 text-sm">{m.compose_subtitle()}</p>
</div>
- <div class="flex items-center gap-2">
+ <div class="hidden items-center gap-2 sm:flex">
<ArcaneButton
action="inspect"
customLabel={m.compose_update_projects()}
@@ -76,6 +78,30 @@
disabled={isLoading.refreshing}
/>
</div>
+
+ <div class="absolute right-4 top-4 flex items-center sm:hidden">
+ <DropdownMenu.Root>
+ <DropdownMenu.Trigger class="bg-background/70 flex inline-flex size-9 items-center justify-center rounded-lg border">
+ <span class="sr-only">{m.common_open_menu()}</span>
+ <EllipsisIcon />
+ </DropdownMenu.Trigger>
+
+ <DropdownMenu.Content
+ align="end"
+ class="bg-card/80 supports-[backdrop-filter]:bg-card/60 z-50 min-w-[180px] rounded-md p-1 shadow-lg backdrop-blur-sm supports-[backdrop-filter]:backdrop-blur-sm"
+ >
+ <DropdownMenu.Group>
+ <DropdownMenu.Item onclick={handleCheckForUpdates} disabled={isLoading.updating}>
+ {m.compose_update_projects()}
+ </DropdownMenu.Item>
+ <DropdownMenu.Item onclick={() => goto(`/projects/new`)}>{m.compose_create_project()}</DropdownMenu.Item>
+ <DropdownMenu.Item onclick={refreshCompose} disabled={isLoading.refreshing}>
+ {m.common_refresh()}
+ </DropdownMenu.Item>
+ </DropdownMenu.Group>
+ </DropdownMenu.Content>
+ </DropdownMenu.Root>
+ </div>
</div>
<div class="grid grid-cols-1 gap-4 sm:grid-cols-3">
diff --git a/frontend/src/routes/settings/+layout.svelte b/frontend/src/routes/settings/+layout.svelte
index bca0026d4..fc7c9ef50 100644
--- a/frontend/src/routes/settings/+layout.svelte
+++ b/frontend/src/routes/settings/+layout.svelte
@@ -11,6 +11,7 @@
import { useSidebar } from '$lib/components/ui/sidebar/context.svelte.js';
import { m } from '$lib/paraglide/messages';
import settingsStore from '$lib/stores/config-store';
+ import { IsMobile } from '$lib/hooks/is-mobile.svelte.js';
interface Props {
children: import('svelte').Snippet;
@@ -23,6 +24,7 @@
let currentPageName = $derived(page.url.pathname.split('/').pop() || 'settings');
const sidebar = useSidebar();
+ const isMobile = new IsMobile();
const isReadOnly = $derived.by(() => $settingsStore.uiConfigDisabled);
// Calculate left position based on sidebar state to match sidebar spacing system
@@ -30,8 +32,8 @@
const leftPosition = $derived(() => {
const margin = '1rem'; // Standard spacing-4 equivalent
- if (sidebar.isMobile) {
- // Mobile sidebar is overlay - uses standard margin
+ // On mobile, use standard margin without sidebar offset
+ if (isMobile.current) {
return margin;
}
@@ -56,6 +58,8 @@
return m.security_title();
case 'users':
return m.users_title();
+ case 'navigation':
+ return m.navigation_title();
default:
return m.sidebar_settings();
}
@@ -133,7 +137,8 @@
disabled={formState.isLoading}
class="gap-2"
>
- {m.common_reset()}
+ <RotateCcwIcon class="size-4" />
+ <span class="hidden sm:inline">{m.common_reset()}</span>
</Button>
{/if}
@@ -145,12 +150,12 @@
>
{#if formState.isLoading}
<div class="border-background size-4 animate-spin rounded-full border-2 border-t-transparent"></div>
- {m.common_saving()}
+ <span class="hidden sm:inline">{m.common_saving()}</span>
{:else}
<SaveIcon class="size-4" />
- {m.common_save()}
- {/if}
- </Button>
+ <span class="hidden sm:inline">{m.common_save()}</span>
+ {/if}
+ </Button>
{/if}
</div>
</div>
@@ -166,7 +171,7 @@
<!-- Mobile Floating Action Buttons -->
{#if isSubPage && !isReadOnly}
- <div class="fixed bottom-4 right-4 z-50 flex flex-col gap-3 sm:hidden">
+ <div class="fixed right-4 bottom-4 z-50 flex flex-col gap-3 sm:hidden">
{#if formState.hasChanges && formState.resetFunction}
<Button
variant="outline"
@@ -194,7 +199,7 @@
<!-- Status indicator for mobile -->
{#if formState.hasChanges}
- <div class="absolute -left-2 -top-2 size-3 animate-pulse rounded-full bg-orange-500"></div>
+ <div class="absolute -top-2 -left-2 size-3 animate-pulse rounded-full bg-orange-500"></div>
{/if}
</div>
{/if}
diff --git a/frontend/src/routes/settings/+page.svelte b/frontend/src/routes/settings/+page.svelte
index 5e01a2f40..1e523833a 100644
--- a/frontend/src/routes/settings/+page.svelte
+++ b/frontend/src/routes/settings/+page.svelte
@@ -5,6 +5,7 @@
import DatabaseIcon from '@lucide/svelte/icons/database';
import UserIcon from '@lucide/svelte/icons/user';
import ShieldIcon from '@lucide/svelte/icons/shield';
+ import NavigationIcon from '@lucide/svelte/icons/navigation';
import ChevronRightIcon from '@lucide/svelte/icons/chevron-right';
import { Button } from '$lib/components/ui/button';
import { Card } from '$lib/components/ui/card';
@@ -152,6 +153,71 @@
}
]
},
+ {
+ id: 'navigation',
+ title: m.navigation_title(),
+ description: m.navigation_description(),
+ icon: NavigationIcon,
+ url: '/settings/navigation',
+ keywords: [
+ 'navigation',
+ 'nav',
+ 'menu',
+ 'bar',
+ 'floating',
+ 'docked',
+ 'behavior',
+ 'mobile',
+ 'desktop',
+ 'ui',
+ 'interface',
+ 'layout',
+ 'appearance',
+ 'customize'
+ ],
+ settings: [
+ {
+ key: 'mobileNavigationMode',
+ label: m.navigation_mode_label(),
+ type: 'select',
+ description: m.navigation_mode_description(),
+ keywords: ['mode', 'style', 'type', 'floating', 'docked', 'position', 'layout', 'design', 'appearance', 'bottom']
+ },
+ {
+ key: 'mobileNavigationShowLabels',
+ label: m.navigation_show_labels_label(),
+ type: 'boolean',
+ description: m.navigation_show_labels_description(),
+ keywords: ['labels', 'text', 'icons', 'display', 'show', 'hide', 'names', 'captions', 'titles', 'visible', 'toggle']
+ },
+ {
+ key: 'mobileNavigationScrollToHide',
+ label: m.navigation_scroll_to_hide_label(),
+ type: 'boolean',
+ description: m.navigation_scroll_to_hide_description(),
+ keywords: [
+ 'scroll',
+ 'hide',
+ 'auto-hide',
+ 'behavior',
+ 'down',
+ 'up',
+ 'automatic',
+ 'disappear',
+ 'vanish',
+ 'minimize',
+ 'collapse'
+ ]
+ },
+ {
+ key: 'mobileNavigationTapToHide',
+ label: m.navigation_tap_to_hide_label(),
+ type: 'boolean',
+ description: m.navigation_tap_to_hide_description(),
+ keywords: ['tap', 'touch', 'hide', 'show', 'toggle', 'gesture', 'click', 'outside', 'dismiss', 'interact', 'control']
+ }
+ ]
+ },
{
id: 'users',
title: m.users_title(),
@@ -242,8 +308,7 @@
}
</script>
-<div class="px-4 py-4 sm:px-6 sm:py-6 lg:px-8">
- <!-- Header -->
+<div class="px-2 py-4 sm:px-6 sm:py-6 lg:px-8">
<div class="mb-6 sm:mb-8">
<div
class="from-background/60 via-background/40 to-background/60 relative overflow-hidden rounded-xl border bg-gradient-to-br p-4 shadow-sm sm:p-6"
@@ -270,7 +335,6 @@
</div>
</div>
- <!-- Search Bar -->
<div class="relative mt-4 w-full sm:mt-6 sm:max-w-md">
<SearchIcon class="text-muted-foreground absolute left-3 top-1/2 z-10 size-4 -translate-y-1/2" />
<input
diff --git a/frontend/src/routes/settings/forms/navigation-settings-form.svelte b/frontend/src/routes/settings/forms/navigation-settings-form.svelte
new file mode 100644
index 000000000..abe48ab44
--- /dev/null
+++ b/frontend/src/routes/settings/forms/navigation-settings-form.svelte
@@ -0,0 +1,226 @@
+<script lang="ts">
+ import { z } from 'zod/v4';
+ import { getContext, onMount } from 'svelte';
+ import { createForm } from '$lib/utils/form.utils';
+ import * as Card from '$lib/components/ui/card';
+ import type { Settings } from '$lib/types/settings.type';
+ import { toast } from 'svelte-sonner';
+ import EyeIcon from '@lucide/svelte/icons/eye';
+ import MousePointerClickIcon from '@lucide/svelte/icons/mouse-pointer-click';
+ import ScrollTextIcon from '@lucide/svelte/icons/scroll-text';
+ import NavigationIcon from '@lucide/svelte/icons/navigation';
+ import NavigationSettingControl from '$lib/components/navigation-setting-control.svelte';
+ import NavigationModeSettingControl from '$lib/components/navigation-mode-setting-control.svelte';
+ import settingsStore from '$lib/stores/config-store';
+ import { m } from '$lib/paraglide/messages';
+ import { navigationSettingsOverridesStore, resetNavigationVisibility } from '$lib/utils/navigation.utils';
+
+ let {
+ settings,
+ callback,
+ hasChanges = $bindable(),
+ isLoading = $bindable(false)
+ }: {
+ settings: Settings;
+ callback: (appConfig: Partial<Settings>) => Promise<void>;
+ hasChanges: boolean;
+ isLoading: boolean;
+ } = $props();
+
+ const uiConfigDisabled = $state($settingsStore.uiConfigDisabled);
+
+ // Track local override state using the shared store
+ let persistedState = $state(navigationSettingsOverridesStore.current);
+
+ const formSchema = z.object({
+ mobileNavigationMode: z.enum(['floating', 'docked']),
+ mobileNavigationShowLabels: z.boolean(),
+ mobileNavigationScrollToHide: z.boolean(),
+ mobileNavigationTapToHide: z.boolean()
+ });
+
+ let { inputs: formInputs, ...form } = $derived(createForm<typeof formSchema>(formSchema, settings));
+
+ const formHasChanges = $derived.by(
+ () =>
+ $formInputs.mobileNavigationMode.value !== settings.mobileNavigationMode ||
+ $formInputs.mobileNavigationShowLabels.value !== settings.mobileNavigationShowLabels ||
+ $formInputs.mobileNavigationScrollToHide.value !== settings.mobileNavigationScrollToHide ||
+ $formInputs.mobileNavigationTapToHide.value !== settings.mobileNavigationTapToHide
+ );
+
+ $effect(() => {
+ hasChanges = formHasChanges;
+ });
+
+ function setLocalOverride(key: 'mode' | 'showLabels' | 'scrollToHide' | 'tapToHide', value: any) {
+ const currentOverrides = navigationSettingsOverridesStore.current;
+ navigationSettingsOverridesStore.current = {
+ ...currentOverrides,
+ [key]: value
+ };
+ persistedState = navigationSettingsOverridesStore.current;
+
+ // Reset navigation bar visibility when behavior settings change
+ if (key === 'scrollToHide' || key === 'tapToHide') {
+ resetNavigationVisibility();
+ }
+ }
+
+ function clearLocalOverride(key: 'mode' | 'showLabels' | 'scrollToHide' | 'tapToHide') {
+ const currentOverrides = navigationSettingsOverridesStore.current;
+ const newOverrides = { ...currentOverrides };
+ delete newOverrides[key];
+ navigationSettingsOverridesStore.current = newOverrides;
+ persistedState = navigationSettingsOverridesStore.current;
+
+ // Reset navigation bar visibility when behavior settings change
+ if (key === 'scrollToHide' || key === 'tapToHide') {
+ resetNavigationVisibility();
+ }
+
+ toast.success(`Local override cleared for ${key.replace(/([A-Z])/g, ' $1').toLowerCase()}`);
+ }
+
+ async function onSubmit() {
+ const data = form.validate();
+ if (!data) {
+ toast.error('Please check the form for errors');
+ return;
+ }
+ isLoading = true;
+
+ // Check if behavior settings changed
+ const behaviorChanged =
+ data.mobileNavigationScrollToHide !== settings.mobileNavigationScrollToHide ||
+ data.mobileNavigationTapToHide !== settings.mobileNavigationTapToHide;
+
+ await callback(data)
+ .then(() => {
+ toast.success(m.navigation_settings_saved());
+
+ // Reset navigation bar visibility if behavior settings changed
+ if (behaviorChanged) {
+ resetNavigationVisibility();
+ }
+ })
+ .catch((error) => {
+ console.error('Failed to save navigation settings:', error);
+ toast.error('Failed to save navigation settings. Please try again.');
+ })
+ .finally(() => (isLoading = false));
+ }
+
+ function resetForm() {
+ $formInputs.mobileNavigationMode.value = settings.mobileNavigationMode;
+ $formInputs.mobileNavigationShowLabels.value = settings.mobileNavigationShowLabels;
+ $formInputs.mobileNavigationScrollToHide.value = settings.mobileNavigationScrollToHide;
+ $formInputs.mobileNavigationTapToHide.value = settings.mobileNavigationTapToHide;
+ }
+
+ onMount(() => {
+ const formState = getContext('settingsFormState') as any;
+ if (formState) {
+ formState.saveFunction = onSubmit;
+ formState.resetFunction = resetForm;
+ }
+ });
+</script>
+
+<div class="space-y-4 sm:space-y-6">
+ <!-- Mobile Navigation Appearance Card -->
+ <Card.Root class="overflow-hidden pt-0">
+ <Card.Header class="bg-muted/20 border-b !py-4">
+ <div class="flex items-center gap-3">
+ <div class="bg-primary/10 text-primary ring-primary/20 flex size-8 items-center justify-center rounded-lg ring-1">
+ <NavigationIcon class="size-4" />
+ </div>
+ <div>
+ <Card.Title class="text-base">{m.navigation_mobile_appearance_title()}</Card.Title>
+ <Card.Description class="text-xs">{m.navigation_mobile_appearance_description()}</Card.Description>
+ </div>
+ </div>
+ </Card.Header>
+ <Card.Content class="px-3 py-3 sm:px-6 sm:py-4">
+ <div class="grid grid-cols-1 gap-3 sm:gap-4 lg:grid-cols-[repeat(auto-fit,minmax(400px,1fr))]">
+ <NavigationModeSettingControl
+ id="mobileNavigationMode"
+ label={m.navigation_mode_label()}
+ description={m.navigation_mode_description()}
+ icon={NavigationIcon}
+ serverValue={$formInputs.mobileNavigationMode.value}
+ localOverride={persistedState.mode}
+ onServerChange={(value) => {
+ $formInputs.mobileNavigationMode.value = value;
+ }}
+ onLocalOverride={(value) => setLocalOverride('mode', value)}
+ onClearOverride={() => clearLocalOverride('mode')}
+ serverDisabled={uiConfigDisabled}
+ />
+
+ <NavigationSettingControl
+ id="mobileNavigationShowLabels"
+ label={m.navigation_show_labels_label()}
+ description={m.navigation_show_labels_description()}
+ icon={EyeIcon}
+ serverValue={$formInputs.mobileNavigationShowLabels.value}
+ localOverride={persistedState.showLabels}
+ onServerChange={(value) => {
+ $formInputs.mobileNavigationShowLabels.value = value;
+ }}
+ onLocalOverride={(value) => setLocalOverride('showLabels', value)}
+ onClearOverride={() => clearLocalOverride('showLabels')}
+ serverDisabled={uiConfigDisabled}
+ />
+ </div>
+ </Card.Content>
+ </Card.Root>
+
+ <!-- Mobile Navigation Behavior Card -->
+ <Card.Root class="overflow-hidden pt-0">
+ <Card.Header class="bg-muted/20 border-b !py-4">
+ <div class="flex items-center gap-3">
+ <div class="bg-primary/10 text-primary ring-primary/20 flex size-8 items-center justify-center rounded-lg ring-1">
+ <NavigationIcon class="size-4" />
+ </div>
+ <div>
+ <Card.Title class="text-base">{m.navigation_mobile_behavior_title()}</Card.Title>
+ <Card.Description class="text-xs">{m.navigation_mobile_behavior_description()}</Card.Description>
+ </div>
+ </div>
+ </Card.Header>
+ <Card.Content class="px-3 py-3 sm:px-6 sm:py-4">
+ <div class="grid grid-cols-1 gap-3 sm:gap-4 lg:grid-cols-[repeat(auto-fit,minmax(400px,1fr))]">
+ <NavigationSettingControl
+ id="mobileNavigationScrollToHide"
+ label={m.navigation_scroll_to_hide_label()}
+ description={m.navigation_scroll_to_hide_description()}
+ icon={ScrollTextIcon}
+ serverValue={$formInputs.mobileNavigationScrollToHide.value}
+ localOverride={persistedState.scrollToHide}
+ onServerChange={(value) => {
+ $formInputs.mobileNavigationScrollToHide.value = value;
+ }}
+ onLocalOverride={(value) => setLocalOverride('scrollToHide', value)}
+ onClearOverride={() => clearLocalOverride('scrollToHide')}
+ serverDisabled={uiConfigDisabled}
+ />
+
+ <NavigationSettingControl
+ id="mobileNavigationTapToHide"
+ label={m.navigation_tap_to_hide_label()}
+ description={m.navigation_tap_to_hide_description()}
+ icon={MousePointerClickIcon}
+ serverValue={$formInputs.mobileNavigationTapToHide.value}
+ localOverride={persistedState.tapToHide}
+ onServerChange={(value) => {
+ $formInputs.mobileNavigationTapToHide.value = value;
+ }}
+ onLocalOverride={(value) => setLocalOverride('tapToHide', value)}
+ onClearOverride={() => clearLocalOverride('tapToHide')}
+ serverDisabled={uiConfigDisabled}
+ />
+ </div>
+ </Card.Content>
+ </Card.Root>
+</div>
diff --git a/frontend/src/routes/settings/general/+page.svelte b/frontend/src/routes/settings/general/+page.svelte
index a38eacf77..bea59a9db 100644
--- a/frontend/src/routes/settings/general/+page.svelte
+++ b/frontend/src/routes/settings/general/+page.svelte
@@ -37,7 +37,7 @@
}
</script>
-<div class="px-4 py-4 sm:px-6 sm:py-6 lg:px-8">
+<div class="px-2 py-4 sm:px-6 sm:py-6 lg:px-8">
<div
class="from-background/60 via-background/40 to-background/60 relative overflow-hidden rounded-xl border bg-gradient-to-br p-4 shadow-sm sm:p-6"
>
diff --git a/frontend/src/routes/settings/navigation/+page.svelte b/frontend/src/routes/settings/navigation/+page.svelte
new file mode 100644
index 000000000..e6e7671d6
--- /dev/null
+++ b/frontend/src/routes/settings/navigation/+page.svelte
@@ -0,0 +1,69 @@
+<script lang="ts">
+ import type { Settings } from '$lib/types/settings.type';
+ import settingsStore from '$lib/stores/config-store';
+ import { settingsService } from '$lib/services/settings-service';
+ import UiConfigDisabledTag from '$lib/components/ui-config-disabled-tag.svelte';
+ import NavigationSettingsForm from '../forms/navigation-settings-form.svelte';
+ import NavigationIcon from '@lucide/svelte/icons/navigation';
+ import { m } from '$lib/paraglide/messages';
+ import { getContext } from 'svelte';
+
+ let { data } = $props();
+ let currentSettings = $state(data.settings);
+ let hasChanges = $state(false);
+ let isLoading = $state(false);
+
+ const isReadOnly = $derived.by(() => $settingsStore.uiConfigDisabled);
+
+ const formState = getContext('settingsFormState') as any;
+
+ $effect(() => {
+ if (formState) {
+ formState.hasChanges = hasChanges;
+ formState.isLoading = isLoading;
+ }
+ });
+
+ async function updateSettingsConfig(updatedSettings: Partial<Settings>) {
+ try {
+ await settingsService.updateSettings(updatedSettings as any);
+ currentSettings = { ...currentSettings, ...updatedSettings };
+ settingsStore.set(currentSettings);
+ settingsStore.reload();
+ } catch (error) {
+ console.error('Error updating navigation settings:', error);
+ throw error;
+ }
+ }
+</script>
+
+<div class="px-2 py-4 sm:px-6 sm:py-6 lg:px-8">
+ <div
+ class="from-background/60 via-background/40 to-background/60 relative overflow-hidden rounded-xl border bg-gradient-to-br p-4 shadow-sm sm:p-6"
+ >
+ <div class="bg-primary/10 pointer-events-none absolute -top-10 -right-10 size-40 rounded-full blur-3xl"></div>
+ <div class="bg-muted/40 pointer-events-none absolute -bottom-10 -left-10 size-40 rounded-full blur-3xl"></div>
+ <div class="relative flex items-start gap-3 sm:gap-4">
+ <div
+ class="bg-primary/10 text-primary ring-primary/20 flex size-8 shrink-0 items-center justify-center rounded-lg ring-1 sm:size-10"
+ >
+ <NavigationIcon class="size-4 sm:size-5" />
+ </div>
+ <div class="min-w-0 flex-1">
+ <div class="flex items-start justify-between gap-3">
+ <h1 class="settings-title min-w-0 text-xl sm:text-3xl">{m.navigation_title()}</h1>
+ {#if isReadOnly}
+ <div class="shrink-0">
+ <UiConfigDisabledTag />
+ </div>
+ {/if}
+ </div>
+ <p class="text-muted-foreground mt-1 text-sm sm:text-base">{m.navigation_description()}</p>
+ </div>
+ </div>
+ </div>
+
+ <div class="mt-6 sm:mt-8">
+ <NavigationSettingsForm settings={currentSettings} callback={updateSettingsConfig} bind:hasChanges bind:isLoading />
+ </div>
+</div>
diff --git a/frontend/src/routes/settings/navigation/+page.ts b/frontend/src/routes/settings/navigation/+page.ts
new file mode 100644
index 000000000..2fb12b242
--- /dev/null
+++ b/frontend/src/routes/settings/navigation/+page.ts
@@ -0,0 +1,10 @@
+import type { PageLoad } from './$types';
+import { settingsService } from '$lib/services/settings-service';
+
+export const load: PageLoad = async () => {
+ const settings = await settingsService.getSettings();
+
+ return {
+ settings
+ };
+};
diff --git a/frontend/src/routes/settings/security/+page.svelte b/frontend/src/routes/settings/security/+page.svelte
index f885766a1..88764674f 100644
--- a/frontend/src/routes/settings/security/+page.svelte
+++ b/frontend/src/routes/settings/security/+page.svelte
@@ -38,7 +38,7 @@
}
</script>
-<div class="px-4 py-4 sm:px-6 sm:py-6 lg:px-8">
+<div class="px-2 py-4 sm:px-6 sm:py-6 lg:px-8">
<div
class="from-background/60 via-background/40 to-background/60 relative overflow-hidden rounded-xl border bg-gradient-to-br p-4 shadow-sm sm:p-6"
>
diff --git a/frontend/src/routes/settings/users/+page.svelte b/frontend/src/routes/settings/users/+page.svelte
index 2f82f5399..3c5763503 100644
--- a/frontend/src/routes/settings/users/+page.svelte
+++ b/frontend/src/routes/settings/users/+page.svelte
@@ -110,7 +110,7 @@
}
</script>
-<div class="px-4 py-4 sm:px-6 sm:py-6 lg:px-8">
+<div class="px-2 py-4 sm:px-6 sm:py-6 lg:px-8">
<div
class="from-background/60 via-background/40 to-background/60 relative overflow-hidden rounded-xl border bg-gradient-to-br p-4 shadow-sm sm:p-6"
>
diff --git a/frontend/src/routes/volumes/+page.svelte b/frontend/src/routes/volumes/+page.svelte
index f62724689..74d1f7dd1 100644
--- a/frontend/src/routes/volumes/+page.svelte
+++ b/frontend/src/routes/volumes/+page.svelte
@@ -8,6 +8,8 @@
import CreateVolumeSheet from '$lib/components/sheets/create-volume-sheet.svelte';
import type { VolumeCreateOptions } from 'dockerode';
import { ArcaneButton } from '$lib/components/arcane-button/index.js';
+ import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';
+ import EllipsisIcon from '@lucide/svelte/icons/ellipsis';
import StatCard from '$lib/components/stat-card.svelte';
import VolumeTable from './volume-table.svelte';
import { m } from '$lib/paraglide/messages';
@@ -59,12 +61,12 @@
</script>
<div class="space-y-6">
- <div class="flex flex-col justify-between gap-4 sm:flex-row sm:items-center">
+ <div class="relative flex flex-col justify-between gap-4 sm:flex-row sm:items-center">
<div>
<h1 class="text-3xl font-bold tracking-tight">{m.volumes_title()}</h1>
<p class="text-muted-foreground mt-1 text-sm">{m.volumes_subtitle()}</p>
</div>
- <div class="flex items-center gap-2">
+ <div class="hidden items-center gap-2 sm:flex">
<ArcaneButton
action="create"
customLabel={m.volumes_create_button()}
@@ -80,6 +82,29 @@
disabled={isLoading.refresh}
/>
</div>
+
+ <div class="absolute right-4 top-4 flex items-center sm:hidden">
+ <DropdownMenu.Root>
+ <DropdownMenu.Trigger class="bg-background/70 flex inline-flex size-9 items-center justify-center rounded-lg border">
+ <span class="sr-only">{m.common_open_menu()}</span>
+ <EllipsisIcon />
+ </DropdownMenu.Trigger>
+
+ <DropdownMenu.Content
+ align="end"
+ class="bg-card/80 supports-[backdrop-filter]:bg-card/60 z-50 min-w-[160px] rounded-md p-1 shadow-lg backdrop-blur-sm supports-[backdrop-filter]:backdrop-blur-sm"
+ >
+ <DropdownMenu.Group>
+ <DropdownMenu.Item onclick={() => (isCreateDialogOpen = true)} disabled={isLoading.creating}>
+ {m.volumes_create_button()}
+ </DropdownMenu.Item>
+ <DropdownMenu.Item onclick={refreshVolumes} disabled={isLoading.refresh}>
+ {m.common_refresh()}
+ </DropdownMenu.Item>
+ </DropdownMenu.Group>
+ </DropdownMenu.Content>
+ </DropdownMenu.Root>
+ </div>
</div>
<div class="grid grid-cols-1 gap-4 sm:grid-cols-3">
diff --git a/frontend/static/app.webmanifest b/frontend/static/app.webmanifest
index 3c75cfccd..c43822c93 100644
--- a/frontend/static/app.webmanifest
+++ b/frontend/static/app.webmanifest
@@ -2,8 +2,8 @@
"name": "Arcane",
"short_name": "Arcane",
"description": "Modern Docker container management platform",
- "theme_color": "#000000",
- "background_color": "#ffffff",
+ "theme_color": "oklch(0.141 0.005 285.823)",
+ "background_color": "oklch(0.141 0.005 285.823)",
"display": "standalone",
"orientation": "portrait-primary",
"scope": "/",