Skip to content

Modern Docker Management, Designed for Everyone

fix: mobile layout issues on the dashboard (#2149)

Kyle Mendell8049ed657215
diff --git a/frontend/src/lib/components/quick-actions.svelte b/frontend/src/lib/components/quick-actions.svelte
index db320c0be..42cea9386 100644
--- a/frontend/src/lib/components/quick-actions.svelte
+++ b/frontend/src/lib/components/quick-actions.svelte
@@ -1,6 +1,7 @@
<script lang="ts">
import { ArcaneButton } from '$lib/components/arcane-button/index.js';
import { ActionButtonGroup, type ActionButton } from '$lib/components/action-button-group/index.js';
+ import { IsTablet } from '$lib/hooks/is-tablet.svelte.js';
import { m } from '$lib/paraglide/messages';
import { StartIcon, StopIcon, TrashIcon } from '$lib/icons';
import { cn } from '$lib/utils';
@@ -38,6 +39,7 @@
class?: string;
} = $props();
+ const isTablet = new IsTablet();
const isAnyActionLoading = $derived(isLoading.starting || isLoading.stopping || isLoading.pruning);
const currentUserIsAdmin = $derived(!!user?.roles?.includes('admin'));
@@ -84,7 +86,26 @@
<section class={cn(compact ? 'flex min-w-0 flex-1 items-center justify-end' : '', className)}>
{#if compact}
- <ActionButtonGroup buttons={actionButtons} />
+ {#if isTablet.current}
+ <div class="flex w-full min-w-0 items-center justify-center gap-2">
+ {#each actionButtons as button (button.id)}
+ <ArcaneButton
+ action={button.action}
+ customLabel={button.label}
+ loadingLabel={button.loadingLabel}
+ loading={button.loading}
+ disabled={button.disabled}
+ onclick={button.onclick}
+ size="icon"
+ showLabel={false}
+ icon={button.icon}
+ class="min-w-0 flex-1"
+ />
+ {/each}
+ </div>
+ {:else}
+ <ActionButtonGroup buttons={actionButtons} />
+ {/if}
{:else if currentUserIsAdmin}
<h2 class="mb-3 text-lg font-semibold tracking-tight">{m.quick_actions_title()}</h2>
diff --git a/frontend/src/routes/(app)/+layout.svelte b/frontend/src/routes/(app)/+layout.svelte
index d478e63f7..22e38f753 100644
--- a/frontend/src/routes/(app)/+layout.svelte
+++ b/frontend/src/routes/(app)/+layout.svelte
@@ -95,14 +95,14 @@
<main class="flex-1">
<section
class={cn(
- 'px-2',
+ 'px-3',
navigationMode === 'docked'
? navigationSettings.scrollToHide
- ? 'pt-5 sm:px-5 sm:pt-5'
- : 'pt-5 pb-(--mobile-docked-nav-offset,calc(3.5rem+env(safe-area-inset-bottom))) sm:p-5'
+ ? 'pt-5'
+ : 'pt-5 pb-(--mobile-docked-nav-offset,calc(3.5rem+env(safe-area-inset-bottom)))'
: navigationSettings.scrollToHide
- ? 'py-5 sm:p-5'
- : 'py-5 pb-(--mobile-floating-nav-offset,6rem) sm:p-5'
+ ? 'py-5'
+ : 'py-5 pb-(--mobile-floating-nav-offset,6rem)'
)}
>
{@render children()}
diff --git a/frontend/src/routes/(app)/dashboard/+page.svelte b/frontend/src/routes/(app)/dashboard/+page.svelte
index 665f4a0f7..c23ec7ab6 100644
--- a/frontend/src/routes/(app)/dashboard/+page.svelte
+++ b/frontend/src/routes/(app)/dashboard/+page.svelte
@@ -590,7 +590,7 @@
</Card.Root>
</header>
- <section class="flex min-h-0 flex-1 flex-col overflow-hidden">
+ <section class="flex flex-col lg:min-h-0 lg:flex-1 lg:overflow-hidden">
<div class="mb-3 flex items-center justify-between gap-3">
<h2 class="text-lg font-semibold tracking-tight">{m.dashboard_resource_tables_title()}</h2>
<div class="hidden items-center gap-2 md:flex">
@@ -602,7 +602,7 @@
</ArcaneButton>
</div>
</div>
- <div class="grid min-h-0 flex-1 grid-cols-1 gap-4 overflow-hidden lg:grid-cols-2">
+ <div class="grid grid-cols-1 gap-4 lg:min-h-0 lg:flex-1 lg:grid-cols-2 lg:overflow-hidden">
<DashboardContainerTable bind:containers isLoading={false} />
<DashboardImageTable bind:images isLoading={false} />
</div>
diff --git a/frontend/src/routes/(app)/dashboard/dash-container-table.svelte b/frontend/src/routes/(app)/dashboard/dash-container-table.svelte
index 36b8059dc..dab43748d 100644
--- a/frontend/src/routes/(app)/dashboard/dash-container-table.svelte
+++ b/frontend/src/routes/(app)/dashboard/dash-container-table.svelte
@@ -30,6 +30,7 @@
let displayLimit = $state(containers.pagination?.itemsPerPage ?? 5);
let lastMeasuredHeight = $state(0);
+ const MOBILE_ROWS = 4;
const ROW_HEIGHT = 57;
const HEADER_HEIGHT = 145;
const FOOTER_HEIGHT = 48;
@@ -47,7 +48,7 @@
}
function calculateLimitForHeight(height: number) {
- if (isMobile.current) return 10;
+ if (isMobile.current) return MOBILE_ROWS;
if (height <= 0) return 5;
let availableHeight = height - HEADER_HEIGHT;
@@ -150,8 +151,11 @@
/>
{/snippet}
-<div class="flex h-full min-h-0 flex-col" bind:clientHeight={() => lastMeasuredHeight, (value) => handleLayoutChange(value)}>
- <Card.Root class="flex h-full min-h-0 flex-col">
+<div
+ class="flex flex-col lg:h-full lg:min-h-0"
+ bind:clientHeight={() => lastMeasuredHeight, (value) => handleLayoutChange(value)}
+>
+ <Card.Root class="flex flex-col lg:h-full lg:min-h-0">
<Card.Header icon={ContainersIcon} class="shrink-0">
<div class="flex flex-1 items-center justify-between">
<div class="flex flex-col space-y-1.5">
@@ -166,7 +170,7 @@
</ArcaneButton>
</div>
</Card.Header>
- <Card.Content class="flex min-h-0 flex-1 flex-col px-0">
+ <Card.Content class="px-0 lg:flex lg:min-h-0 lg:flex-1 lg:flex-col">
<ArcaneTable
items={{ ...containers, data: containers.data.slice(0, displayLimit) }}
bind:requestOptions
diff --git a/frontend/src/routes/(app)/dashboard/dash-image-table.svelte b/frontend/src/routes/(app)/dashboard/dash-image-table.svelte
index d9132aa7d..cbec4a16c 100644
--- a/frontend/src/routes/(app)/dashboard/dash-image-table.svelte
+++ b/frontend/src/routes/(app)/dashboard/dash-image-table.svelte
@@ -26,6 +26,7 @@
let displayLimit = $state(images.pagination?.itemsPerPage ?? 5);
let lastMeasuredHeight = $state(0);
+ const MOBILE_ROWS = 4;
const ROW_HEIGHT = 57;
const HEADER_HEIGHT = 145;
const FOOTER_HEIGHT = 48;
@@ -45,7 +46,7 @@
}
function calculateLimitForHeight(height: number) {
- if (isMobile.current) return 10;
+ if (isMobile.current) return MOBILE_ROWS;
if (height <= 0) return 5;
let availableHeight = height - HEADER_HEIGHT;
@@ -155,8 +156,11 @@
/>
{/snippet}
-<div class="flex h-full min-h-0 flex-col" bind:clientHeight={() => lastMeasuredHeight, (value) => handleLayoutChange(value)}>
- <Card.Root class="flex h-full min-h-0 flex-col">
+<div
+ class="flex flex-col lg:h-full lg:min-h-0"
+ bind:clientHeight={() => lastMeasuredHeight, (value) => handleLayoutChange(value)}
+>
+ <Card.Root class="flex flex-col lg:h-full lg:min-h-0">
<Card.Header icon={ImagesIcon} class="shrink-0">
<div class="flex flex-1 items-center justify-between">
<div class="flex flex-col space-y-1.5">
@@ -171,7 +175,7 @@
</ArcaneButton>
</div>
</Card.Header>
- <Card.Content class="flex min-h-0 flex-1 flex-col px-0">
+ <Card.Content class="px-0 lg:flex lg:min-h-0 lg:flex-1 lg:flex-col">
<ArcaneTable
items={{ ...images, data: images.data.slice(0, displayLimit) }}
bind:requestOptions