Skip to content

Modern Docker Management, Designed for Everyone

fix: dashboard card buttons paddings overlaps

Kyle Mendellc1a0bda6735a
diff --git a/frontend/src/lib/components/action-button-group/action-button-group.svelte b/frontend/src/lib/components/action-button-group/action-button-group.svelte
index 21ba6c24a..c10de98c8 100644
--- a/frontend/src/lib/components/action-button-group/action-button-group.svelte
+++ b/frontend/src/lib/components/action-button-group/action-button-group.svelte
@@ -12,9 +12,11 @@
buttons?: ActionButton[];
size?: ArcaneButtonSize;
class?: string;
+ inlineClass?: string;
+ menuClass?: string;
}
- let { buttons = [], size = 'default', class: className = '' }: Props = $props();
+ let { buttons = [], size = 'default', class: className = '', inlineClass = '', menuClass = '' }: Props = $props();
const DROPDOWN_WIDTH = $derived(size === 'sm' ? 44 : 48);
const GAP = 8;
@@ -166,11 +168,12 @@
{/snippet}
{#if buttons.length > 0}
- <div class={cn('flex min-w-0 flex-1 items-center justify-end gap-2', className)} {@attach observeWidth}>
+ <div class={cn('relative flex min-w-0 flex-1 items-center justify-end gap-2', className)} {@attach observeWidth}>
<div
{@attach measureButtons(buttons, size)}
- class="pointer-events-none invisible fixed -left-[9999px] flex items-center gap-2"
+ class="pointer-events-none invisible absolute top-0 left-0 flex items-center gap-2"
aria-hidden="true"
+ inert
>
{#each buttons as button (button.id)}
{#if button.menuItems && button.menuItems.length > 0}
@@ -194,7 +197,7 @@
{/each}
</div>
- <div class="hidden items-center gap-2 lg:flex">
+ <div class={cn('hidden items-center gap-2 lg:flex', inlineClass)}>
{#each visibleButtons as button (button.id)}
{#if button.menuItems && button.menuItems.length > 0}
{@render splitButton(button, false)}
@@ -278,7 +281,7 @@
{/if}
</div>
- <div class="flex items-center gap-2 lg:hidden">
+ <div class={cn('flex items-center gap-2 lg:hidden', menuClass)}>
<DropdownMenu.Root>
<DropdownMenu.Trigger>
{#snippet child({ props })}
diff --git a/frontend/src/routes/(app)/dashboard/dashboard-all-environments-view.svelte b/frontend/src/routes/(app)/dashboard/dashboard-all-environments-view.svelte
index 6a9736e55..210368d1b 100644
--- a/frontend/src/routes/(app)/dashboard/dashboard-all-environments-view.svelte
+++ b/frontend/src/routes/(app)/dashboard/dashboard-all-environments-view.svelte
@@ -1,5 +1,6 @@
<script lang="ts">
import { goto, invalidateAll } from '$app/navigation';
+ import { resolve } from '$app/paths';
import { formatDistanceToNow } from 'date-fns';
import { onDestroy } from 'svelte';
import { toast } from 'svelte-sonner';
@@ -512,7 +513,7 @@
id: `${item.environment.id}-details`,
action: 'inspect',
label: m.common_view_details(),
- onclick: () => void goto(`/environments/${item.environment.id}`),
+ onclick: () => void goto(resolve(`/environments/${item.environment.id}`)),
icon: InspectIcon
});
@@ -731,13 +732,13 @@
<Card.Root
variant="outlined"
- class={`overflow-hidden border transition-colors ${isCurrent ? 'border-blue-500/40 bg-blue-500/5' : 'border-border/60'}`}
+ class={`dashboard-environment-card [container-type:inline-size] overflow-hidden border transition-colors ${isCurrent ? 'border-blue-500/40 bg-blue-500/5' : 'border-border/60'}`}
>
<Card.Content class="space-y-4 p-4">
- <div class="flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between">
+ <div class="grid grid-cols-[minmax(0,1fr)_auto] gap-x-3 gap-y-3">
<div class="min-w-0 space-y-2">
- <div class="flex flex-wrap items-center gap-2">
- <div class="text-base font-semibold tracking-tight">{environment.name}</div>
+ <div class="flex min-w-0 flex-wrap items-center gap-2">
+ <div class="min-w-0 max-w-full break-words text-base font-semibold tracking-tight">{environment.name}</div>
{#if isCurrent}
<StatusBadge text={m.common_current()} variant="blue" size="sm" minWidth="none" />
{/if}
@@ -818,12 +819,22 @@
</div>
</div>
- <div class="flex min-w-0 flex-1 items-start justify-end pt-1 sm:pt-0">
+ <div class="flex min-w-0 items-start justify-end pt-1">
{#await environmentBoardStatePromise}
- <ActionButtonGroup buttons={getEnvironmentActionButtons(baseItem, isCurrent)} size="sm" />
+ <ActionButtonGroup
+ buttons={getEnvironmentActionButtons(baseItem, isCurrent)}
+ size="sm"
+ inlineClass="dashboard-environment-card-action-inline"
+ menuClass="dashboard-environment-card-action-menu"
+ />
{:then boardState}
{@const loadedItem = boardState.overviewById.get(environment.id) ?? baseItem}
- <ActionButtonGroup buttons={getEnvironmentActionButtons(loadedItem, isCurrent)} size="sm" />
+ <ActionButtonGroup
+ buttons={getEnvironmentActionButtons(loadedItem, isCurrent)}
+ size="sm"
+ inlineClass="dashboard-environment-card-action-inline"
+ menuClass="dashboard-environment-card-action-menu"
+ />
{/await}
</div>
</div>
@@ -959,3 +970,25 @@
onConfirm={confirmPrune}
onCancel={closePruneDialog}
/>
+
+<style>
+ @container (max-width: 47.999rem) {
+ :global(.dashboard-environment-card-action-inline) {
+ display: none;
+ }
+
+ :global(.dashboard-environment-card-action-menu) {
+ display: flex;
+ }
+ }
+
+ @container (min-width: 48rem) {
+ :global(.dashboard-environment-card-action-inline) {
+ display: flex;
+ }
+
+ :global(.dashboard-environment-card-action-menu) {
+ display: none;
+ }
+ }
+</style>