Modern Docker Management, Designed for Everyone
Go composecontainer-managementcontainersdockerdocker-composedocker-managementgoself-hostedsveltekittypescriptweb-ui
chore(deps): upgrade to tanstack-table v9 (#2839)
Kyle Mendelld81c19e67df1
diff --git a/frontend/messages/en.json b/frontend/messages/en.jsonindex cd1eca38b..5a94faec3 100644--- a/frontend/messages/en.json+++ b/frontend/messages/en.json@@ -160,6 +160,7 @@"common_select_option": "Select an option","common_sort_by": "Sort by","common_no_results_found": "No results found.",+ "common_no_results_hint": "Try adjusting your search or filters.","common_clear_filters": "Clear filters","common_search": "Search…","common_usage": "Usage",diff --git a/frontend/package.json b/frontend/package.jsonindex 3defb610b..86182e54b 100644--- a/frontend/package.json+++ b/frontend/package.json@@ -27,7 +27,9 @@"@lezer/highlight": "^1.2.3","@sveltejs/kit": "^3.0.0-next.1","@tanstack/svelte-query": "^6.1.33",- "@tanstack/table-core": "^8.21.3",+ "@tanstack/svelte-table": "^9.0.0-beta.1",+ "@tanstack/table-core": "^9.0.0-beta.1",+ "@tanstack/virtual-core": "^3.17.0","@uiw/codemirror-themes": "^4.25.10","@xterm/addon-fit": "^0.11.0","@xterm/xterm": "^6.0.0",@@ -58,9 +60,9 @@"@typescript/native-preview": "7.0.0-dev.20260602.1","bits-ui": "^2.18.1","clsx": "^2.1.1",+ "fallow": "^2.89.0","formsnap": "^2.0.1","isomorphic-dompurify": "^3.15.0",- "fallow": "^2.89.0","mode-watcher": "^1.1.0","paneforge": "^1.0.2","runed": "^0.37.1",diff --git a/frontend/src/lib/components/arcane-button/variants.ts b/frontend/src/lib/components/arcane-button/variants.tsindex 5a183ef7e..348c21793 100644--- a/frontend/src/lib/components/arcane-button/variants.ts+++ b/frontend/src/lib/components/arcane-button/variants.ts@@ -31,7 +31,7 @@ export const arcaneButtonVariants = tv({'transition-all duration-200 ' +'active:scale-[0.98] ' +'border disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 ' +- 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 focus-visible:ring-offset-0 ' ++ 'focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:ring-offset-0 ' +"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",variants: {tone: {diff --git a/frontend/src/lib/components/arcane-table/arcane-table-desktop-view.svelte b/frontend/src/lib/components/arcane-table/arcane-table-desktop-view.svelteindex 9db97a957..cf7a0b071 100644--- a/frontend/src/lib/components/arcane-table/arcane-table-desktop-view.svelte+++ b/frontend/src/lib/components/arcane-table/arcane-table-desktop-view.svelte@@ -1,8 +1,10 @@-<script lang="ts">- import { type Table as TableType, type Cell, type Row } from '@tanstack/table-core';+<script lang="ts" generics="TData extends Record<string, any> & { id: string }">+ import type { ArcaneCell, ArcaneRow, ArcaneSvelteTable } from './table-features';+ import { FlexRender } from '@tanstack/svelte-table';+ import { createVirtualizer } from './virtualizer.svelte';+ import Skeleton from '$lib/components/ui/skeleton/skeleton.svelte';import * as Table from '$lib/components/ui/table/index.js';import * as Empty from '$lib/components/ui/empty/index.js';- import FlexRender from '$lib/components/ui/data-table/flex-render.svelte';import { FolderXIcon, ArrowRightIcon, ArrowDownIcon } from '$lib/icons';import { m } from '$lib/paraglide/messages';import { cn } from '$lib/utils';@@ -16,6 +18,7 @@} from './arcane-table.types.svelte';import TableCheckbox from './arcane-table-checkbox.svelte';import type { Component, Snippet } from 'svelte';+ import type { Attachment } from 'svelte/attachments';import { slide } from 'svelte/transition';void slide;@@ -35,23 +38,29 @@unstyled = false,expandedRowContent,expandedRows,- onToggleRowExpanded+ onToggleRowExpanded,+ scrollElement,+ loading = false}: {- table: TableType<any>;+ table: ArcaneSvelteTable<TData>;selectedIds: string[];columnsCount: number;- groupedRows?: GroupedData<any>[] | null;+ groupedRows?: GroupedData<TData>[] | null;groupIcon?: (groupName: string) => Component;groupCollapsedState?: Record<string, boolean>;selectionDisabled?: boolean;onGroupToggle?: (groupName: string) => void;- getGroupSelectionState?: (groupItems: any[]) => GroupSelectionState;- onToggleGroupSelection?: (groupItems: any[]) => void;+ getGroupSelectionState?: (groupItems: TData[]) => GroupSelectionState;+ onToggleGroupSelection?: (groupItems: TData[]) => void;onToggleRowSelection?: (id: string, selected: boolean) => void;unstyled?: boolean;- expandedRowContent?: Snippet<[{ row: Row<any>; item: any }]>;+ expandedRowContent?: Snippet<[{ row: ArcaneRow<TData>; item: TData }]>;expandedRows?: Set<string>;onToggleRowExpanded?: (rowId: string) => void;+ /** The scrollable ancestor, supplied by the wrapper, used to virtualize long flat lists. */+ scrollElement?: HTMLElement;+ /** First-load flag — when set and there's no data, render skeleton rows. */+ loading?: boolean;} = $props();const hasExpand = $derived(!!expandedRowContent);@@ -73,9 +82,11 @@return '';}- const stickyCellSurfaceClasses = 'bg-background/95';- const stickyActionsClasses = `sticky right-0 z-10 transition-colors ${stickyCellSurfaceClasses}`;- const stickySelectClasses = `w-0 pr-6! ${stickyCellSurfaceClasses}`;+ // Narrow, transparent select cell so the row's hover/selected highlight shows through it+ // uniformly (it carried an opaque background before, which broke the highlight at the edge).+ const selectCellClasses = 'w-0 pr-4!';+ // Row actions live in a zero-width host cell; their content floats over the row (see cellContent).+ const actionsCellClasses = 'relative w-0 p-0 last:pr-0';function handleRowClick(event: MouseEvent, rowId: string) {if (shouldIgnoreTableRowClick(event)) return;@@ -89,12 +100,11 @@}// Get cell classes based on column metadata- function getCellClasses(cell: Cell<any, unknown>, isGrouped: boolean, isFirstCell: boolean): string {- const meta = cell.column.columnDef.meta as { width?: ColumnWidth; align?: ColumnAlign; truncate?: boolean } | undefined;+ function getCellClasses(cell: ArcaneCell<TData>, isGrouped: boolean, isFirstCell: boolean): string {+ const meta = cell.column.columnDef.meta;return cn(- cell.column.id === 'actions' && 'text-right whitespace-nowrap',- cell.column.id === 'select' && stickySelectClasses,- cell.column.id === 'actions' && stickyActionsClasses,+ cell.column.id === 'select' && selectCellClasses,+ cell.column.id === 'actions' && actionsCellClasses,getWidthClass(meta?.width),getAlignClass(meta?.align),meta?.truncate && 'max-w-0 truncate',@@ -104,8 +114,100 @@// Get rows for a specific group from the table modelconst isGrouped = $derived(groupedRows !== null && groupedRows.length > 0);++ // --- Row virtualization ---------------------------------------------------------------------+ // Only the flat (non-grouped, non-expandable) path is virtualized, and only past a threshold —+ // the case that matters is the "All" page size (TABLE_PAGE_SIZE_ALL), where the server returns+ // the full unpaginated set. Normal paginated pages (<= 100 rows) render plainly. Grouped and+ // expandable layouts keep their existing, proven rendering.+ const VIRTUALIZE_THRESHOLD = 100;+ const ROW_ESTIMATE_PX = 52;+ const flatRows = $derived(table.getRowModel().rows);+ const shouldVirtualize = $derived(!isGrouped && !hasExpand && !!scrollElement && flatRows.length > VIRTUALIZE_THRESHOLD);++ // Runes can't be created conditionally, so the virtualizer always exists but is `enabled` only+ // when we actually virtualize; disabled, it stays cheap and reports an empty window.+ const rowVirtualizer = createVirtualizer<HTMLElement, HTMLTableRowElement>(() => ({+ count: flatRows.length,+ getScrollElement: () => scrollElement ?? null,+ estimateSize: () => ROW_ESTIMATE_PX,+ overscan: 10,+ getItemKey: (index) => flatRows[index]?.id ?? index,+ enabled: shouldVirtualize+ }));</script>+{#snippet cellContent(cell: ArcaneCell<TData>)}+ {#if cell.column.id === 'actions'}+ <!-- Row actions float over the row's right edge, revealed on hover/focus (or while the menu is+ open). pointer-events are off until revealed so the hidden control can't swallow row clicks. -->+ <div+ class="pointer-events-none absolute top-1/2 right-2 z-10 -translate-y-1/2 opacity-0 transition-opacity group-hover/row:pointer-events-auto group-hover/row:opacity-100 group-focus-within/row:pointer-events-auto group-focus-within/row:opacity-100 has-[[data-state=open]]:pointer-events-auto has-[[data-state=open]]:opacity-100"+ data-row-select-ignore+ >+ <FlexRender {cell} />+ </div>+ {:else}+ <FlexRender {cell} />+ {/if}+{/snippet}++{#snippet flatRow(row: ArcaneRow<TData>, measureRow?: Attachment<HTMLTableRowElement>)}+ {@const rowId = row.original.id}+ {@const isExpanded = expandedRows?.has(rowId) ?? false}+ <Table.Row+ {@attach measureRow}+ data-state={(selectedIds ?? []).includes(rowId) && 'selected'}+ onclick={(event) => handleRowClick(event, rowId)}+ class={cn(hasExpand && 'cursor-pointer', isExpanded && 'bg-primary/15')}+ >+ {#if hasExpand}+ <Table.Cell class="w-8 px-2" data-row-select-ignore>+ <button+ class="text-muted-foreground hover:text-foreground flex items-center justify-center transition-transform duration-200"+ class:rotate-90={isExpanded}+ onclick={(e) => {+ e.stopPropagation();+ onToggleRowExpanded?.(rowId);+ }}+ aria-label={isExpanded ? 'Collapse row' : 'Expand row'}+ >+ <ArrowRightIcon class="size-4" />+ </button>+ </Table.Cell>+ {/if}+ {#each row.getVisibleCells() as cell (cell.id)}+ <Table.Cell class={getCellClasses(cell, false, false)}>+ {@render cellContent(cell)}+ </Table.Cell>+ {/each}+ </Table.Row>++ {#if hasExpand && isExpanded && expandedRowContent}+ <Table.Row class="bg-primary/10 hover:bg-primary/10">+ <Table.Cell colspan={columnsCount} class="p-0">+ <div transition:slide={{ duration: 200 }}>+ <div class="px-6 py-4">+ {@render expandedRowContent({ row, item: row.original })}+ </div>+ </div>+ </Table.Cell>+ </Table.Row>+ {/if}+{/snippet}++{#snippet skeletonRows()}+ {#each Array.from({ length: 8 }, (_, i) => i) as r (r)}+ <Table.Row class="hover:bg-transparent">+ {#each Array.from({ length: columnsCount }, (_, i) => i) as c (c)}+ <Table.Cell>+ <Skeleton class="h-4 w-full max-w-[140px]" />+ </Table.Cell>+ {/each}+ </Table.Row>+ {/each}+{/snippet}+<divclass={cn('h-full w-full',@@ -113,7 +215,7 @@'[&_tr]:border-border/40! [&_thead]:bg-transparent! [&_thead]:backdrop-blur-none [&_tr]:bg-transparent! [&_tr]:hover:bg-transparent! [&_tr:hover_td]:bg-transparent! [&_tr[data-state=selected]]:bg-transparent! [&_tr[data-state=selected]_td]:bg-transparent!')}>- <Table.Root>+ <Table.Root class={shouldVirtualize ? 'table-fixed' : undefined}><Table.Header>{#each table.getHeaderGroups() as headerGroup (headerGroup.id)}<Table.Row>@@ -123,13 +225,10 @@{#each headerGroup.headers as header (header.id)}<Table.Headcolspan={header.colSpan}- class={cn(- header.column.id === 'select' && stickySelectClasses,- header.column.id === 'actions' && stickyActionsClasses- )}+ class={cn(header.column.id === 'select' && selectCellClasses, header.column.id === 'actions' && actionsCellClasses)}>{#if !header.isPlaceholder}- <FlexRender content={header.column.columnDef.header} context={header.getContext()} />+ <FlexRender {header} />{/if}</Table.Head>{/each}@@ -153,7 +252,7 @@onclick={() => onGroupToggle?.(group.groupName)}>{#if !selectionDisabled}- <Table.Cell class={stickySelectClasses}>+ <Table.Cell class={selectCellClasses}><TableCheckboxchecked={selectionState === 'all'}indeterminate={selectionState === 'some'}@@ -182,7 +281,7 @@<!-- Group Items (if not collapsed) -->{#if !isCollapsed}{#each groupRows as row (row.id)}- {@const rowId = (row.original as any).id}+ {@const rowId = row.original.id}{@const isExpanded = expandedRows?.has(rowId) ?? false}<Table.Rowdata-state={(selectedIds ?? []).includes(rowId) && 'selected'}@@ -207,20 +306,7 @@{#each row.getVisibleCells() as cell, cellIndex (cell.id)}{@const isFirstDataCell = !selectionDisabled ? cellIndex === 1 : cellIndex === 0}<Table.Cell class={getCellClasses(cell, true, isFirstDataCell)}>- {#if cell.column.id === 'actions'}- <div class="flex items-center justify-end" data-row-select-ignore>- <div- class={cn(- 'border-border/40 bg-background pointer-events-auto flex items-center gap-1 rounded-md border px-2 py-1',- unstyled && 'border-transparent bg-transparent shadow-none'- )}- >- <FlexRender content={cell.column.columnDef.cell} context={cell.getContext()} />- </div>- </div>- {:else}- <FlexRender content={cell.column.columnDef.cell} context={cell.getContext()} />- {/if}+ {@render cellContent(cell)}</Table.Cell>{/each}</Table.Row>@@ -250,70 +336,19 @@><Empty.Header><Empty.Media variant="icon">- <FolderXIcon class="text-muted-foreground/40 size-10" />+ <FolderXIcon class="text-muted-foreground/60 size-10" /></Empty.Media>- <Empty.Title class="text-base font-medium">{m.common_no_results_found()}</Empty.Title>+ <Empty.Title class="text-lg font-semibold">{m.common_no_results_found()}</Empty.Title>+ <Empty.Description class="text-muted-foreground text-sm">{m.common_no_results_hint()}</Empty.Description></Empty.Header></Empty.Root></Table.Cell></Table.Row>{/if}{:else}- {#each table.getRowModel().rows as row (row.id)}- {@const rowId = (row.original as any).id}- {@const isExpanded = expandedRows?.has(rowId) ?? false}- <Table.Row- data-state={(selectedIds ?? []).includes(rowId) && 'selected'}- onclick={(event) => handleRowClick(event, rowId)}- class={cn(hasExpand && 'cursor-pointer', isExpanded && 'bg-primary/15')}- >- {#if hasExpand}- <Table.Cell class="w-8 px-2" data-row-select-ignore>- <button- class="text-muted-foreground hover:text-foreground flex items-center justify-center transition-transform duration-200"- class:rotate-90={isExpanded}- onclick={(e) => {- e.stopPropagation();- onToggleRowExpanded?.(rowId);- }}- aria-label={isExpanded ? 'Collapse row' : 'Expand row'}- >- <ArrowRightIcon class="size-4" />- </button>- </Table.Cell>- {/if}- {#each row.getVisibleCells() as cell (cell.id)}- <Table.Cell class={getCellClasses(cell, false, false)}>- {#if cell.column.id === 'actions'}- <div class="flex items-center justify-end" data-row-select-ignore>- <div- class={cn(- 'border-border/40 bg-background pointer-events-auto flex items-center gap-1 rounded-full border px-2 py-1 shadow-sm',- unstyled && 'border-transparent bg-transparent shadow-none'- )}- >- <FlexRender content={cell.column.columnDef.cell} context={cell.getContext()} />- </div>- </div>- {:else}- <FlexRender content={cell.column.columnDef.cell} context={cell.getContext()} />- {/if}- </Table.Cell>- {/each}- </Table.Row>-- {#if hasExpand && isExpanded && expandedRowContent}- <Table.Row class="bg-primary/10 hover:bg-primary/10">- <Table.Cell colspan={columnsCount} class="p-0">- <div transition:slide={{ duration: 200 }}>- <div class="px-6 py-4">- {@render expandedRowContent({ row, item: row.original })}- </div>- </div>- </Table.Cell>- </Table.Row>- {/if}- {:else}+ {#if loading && flatRows.length === 0}+ {@render skeletonRows()}+ {:else if flatRows.length === 0}<Table.Row><Table.Cell colspan={columnsCount} class="h-48"><Empty.Root@@ -323,14 +358,37 @@><Empty.Header><Empty.Media variant="icon">- <FolderXIcon class="text-muted-foreground/40 size-10" />+ <FolderXIcon class="text-muted-foreground/60 size-10" /></Empty.Media>- <Empty.Title class="text-base font-medium">{m.common_no_results_found()}</Empty.Title>+ <Empty.Title class="text-lg font-semibold">{m.common_no_results_found()}</Empty.Title>+ <Empty.Description class="text-muted-foreground text-sm">{m.common_no_results_hint()}</Empty.Description></Empty.Header></Empty.Root></Table.Cell></Table.Row>- {/each}+ {:else if shouldVirtualize}+ {@const vItems = rowVirtualizer.virtualItems}+ {@const first = vItems[0]}+ {@const last = vItems[vItems.length - 1]}+ {@const padTop = first ? first.start : 0}+ {@const padBottom = last ? rowVirtualizer.totalSize - last.end : 0}+ {#if padTop > 0}+ <tr aria-hidden="true"><td colspan={columnsCount} class="border-0 p-0" style="height: {padTop}px"></td></tr>+ {/if}+ {#each vItems as vItem (vItem.key)}+ {@const row = flatRows[vItem.index]}+ {#if row}+ {@render flatRow(row, rowVirtualizer.measureElement)}+ {/if}+ {/each}+ {#if padBottom > 0}+ <tr aria-hidden="true"><td colspan={columnsCount} class="border-0 p-0" style="height: {padBottom}px"></td></tr>+ {/if}+ {:else}+ {#each flatRows as row (row.id)}+ {@render flatRow(row)}+ {/each}+ {/if}{/if}</Table.Body></Table.Root>diff --git a/frontend/src/lib/components/arcane-table/arcane-table-filter.svelte b/frontend/src/lib/components/arcane-table/arcane-table-filter.svelteindex f14e284dc..4449d8e84 100644--- a/frontend/src/lib/components/arcane-table/arcane-table-filter.svelte+++ b/frontend/src/lib/components/arcane-table/arcane-table-filter.svelte@@ -1,5 +1,4 @@-<script lang="ts" generics="TData, TValue">- import type { Column } from '@tanstack/table-core';+<script lang="ts">import { SvelteSet } from 'svelte/reactivity';import * as Command from '$lib/components/ui/command/index.js';import * as Popover from '$lib/components/ui/popover/index.js';@@ -10,13 +9,20 @@import { m } from '$lib/paraglide/messages';import { CheckIcon, FilterIcon } from '$lib/icons';+ // Structural shape of the faceted-filter column controls — see the note in+ // arcane-table-header.svelte for why we avoid v9's invariant `Column` generic here.+ type FilterableColumn = {+ getFilterValue: () => unknown;+ setFilterValue: (value: unknown) => void;+ };+let {column,title,options,showCheckboxes = true}: {- column: Column<TData, TValue>;+ column: FilterableColumn;title: string;options: {label: string;@@ -40,7 +46,10 @@size="sm"icon={FilterIcon}customLabel={title}- class="border-input hover:bg-card/60 h-8 border border-dashed hover:text-inherit"+ class={cn(+ 'border-input hover:bg-card/60 h-8 border border-dashed hover:text-inherit',+ selectedValues.size > 0 && 'border-primary/40 bg-primary/10 border-solid text-foreground'+ )}data-testid={`facet-${title.toLowerCase()}-trigger`}>{#if selectedValues.size > 0}diff --git a/frontend/src/lib/components/arcane-table/arcane-table-header.svelte b/frontend/src/lib/components/arcane-table/arcane-table-header.svelteindex 33785e354..466820e15 100644--- a/frontend/src/lib/components/arcane-table/arcane-table-header.svelte+++ b/frontend/src/lib/components/arcane-table/arcane-table-header.svelte@@ -1,5 +1,4 @@<script lang="ts">- import { type Column } from '@tanstack/table-core';import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';import { ArcaneButton } from '$lib/components/arcane-button/index.js';import { cn } from '$lib/utils.js';@@ -9,13 +8,23 @@type DivAttributes = SvelteHTMLElements['div'];+ // Structural shape of the column controls this header drives. v9's `Column<TFeatures, TData>`+ // is invariant in TData and can't be threaded cleanly through `renderComponent`, so we depend+ // only on the methods used here — the real column satisfies this with no generic and no `any`.+ type SortableHeaderColumn = {+ getCanSort: () => boolean;+ getIsSorted: () => false | 'asc' | 'desc';+ toggleSorting: (desc?: boolean) => void;+ toggleVisibility: (value?: boolean) => void;+ };+let {column,title,class: className,...restProps}: {- column?: Column<any, any>;+ column?: SortableHeaderColumn;title: string;class?: string;} & DivAttributes = $props();@@ -39,11 +48,11 @@class="data-[state=open]:bg-accent -ml-3 h-8">{#if column.getIsSorted() === 'desc'}- <ArrowDownIcon />+ <ArrowDownIcon class="text-foreground size-4" />{:else if column.getIsSorted() === 'asc'}- <ArrowUpIcon />+ <ArrowUpIcon class="text-foreground size-4" />{:else}- <ArrowsUpDownIcon />+ <ArrowsUpDownIcon class="text-muted-foreground/70 size-4" />{/if}</ArcaneButton>{/snippet}diff --git a/frontend/src/lib/components/arcane-table/arcane-table-mobile-view.svelte b/frontend/src/lib/components/arcane-table/arcane-table-mobile-view.svelteindex 8613f50e9..da39e1662 100644--- a/frontend/src/lib/components/arcane-table/arcane-table-mobile-view.svelte+++ b/frontend/src/lib/components/arcane-table/arcane-table-mobile-view.svelte@@ -1,6 +1,7 @@-<script lang="ts">- import { type Table as TableType, type Row } from '@tanstack/table-core';+<script lang="ts" generics="TData extends Record<string, any> & { id: string }">+ import type { ArcaneRow, ArcaneSvelteTable } from './table-features';import * as Empty from '$lib/components/ui/empty/index.js';+ import Skeleton from '$lib/components/ui/skeleton/skeleton.svelte';import DropdownCard from '$lib/components/dropdown-card.svelte';import { FolderXIcon } from '$lib/icons';import { m } from '$lib/paraglide/messages';@@ -20,17 +21,20 @@unstyled = false,expandedRowContent,expandedRows,- onToggleRowExpanded+ onToggleRowExpanded,+ loading = false}: {- table: TableType<any>;- mobileCard: Snippet<[{ row: any; item: any; mobileFieldVisibility: Record<string, boolean> }]>;+ table: ArcaneSvelteTable<TData>;+ mobileCard: Snippet<[{ row: ArcaneRow<TData>; item: TData; mobileFieldVisibility: Record<string, boolean> }]>;mobileFieldVisibility: Record<string, boolean>;- groupedRows?: GroupedData<any>[] | null;+ groupedRows?: GroupedData<TData>[] | null;groupIcon?: (groupName: string) => Component;unstyled?: boolean;- expandedRowContent?: Snippet<[{ row: Row<any>; item: any }]>;+ expandedRowContent?: Snippet<[{ row: ArcaneRow<TData>; item: TData }]>;expandedRows?: Set<string>;onToggleRowExpanded?: (rowId: string) => void;+ /** First-load flag — when set and there's no data, render skeleton cards. */+ loading?: boolean;} = $props();const hasExpand = $derived(!!expandedRowContent);@@ -44,6 +48,20 @@const isGrouped = $derived(groupedRows !== null && groupedRows.length > 0);</script>+{#snippet mobileSkeleton()}+ {#each Array.from({ length: 6 }, (_, i) => i) as r (r)}+ <div class="px-3 py-2.5">+ <div class="flex items-center gap-3">+ <Skeleton class="size-9 rounded-md" />+ <div class="flex-1 space-y-1.5">+ <Skeleton class="h-4 w-1/2" />+ <Skeleton class="h-3 w-1/3" />+ </div>+ </div>+ </div>+ {/each}+{/snippet}+<div class="divide-border/30 divide-y">{#if isGrouped && groupedRows}<div class="space-y-4 py-2">@@ -59,12 +77,12 @@><div class="divide-border/30 divide-y">{#each groupRows as row (row.id)}- {@const rowId = (row.original as any).id}+ {@const rowId = row.original.id}{@const isExpanded = expandedRows?.has(rowId) ?? false}<!-- svelte-ignore a11y_click_events_have_key_events --><!-- svelte-ignore a11y_no_static_element_interactions --><div class={cn(hasExpand && 'cursor-pointer')} onclick={(e) => handleRowClick(e, rowId)}>- {@render mobileCard({ row, item: row.original as any, mobileFieldVisibility })}+ {@render mobileCard({ row, item: row.original, mobileFieldVisibility })}</div>{#if hasExpand && isExpanded && expandedRowContent}<div class="bg-muted/30 px-4 py-3" transition:slide={{ duration: 200 }}>@@ -84,19 +102,22 @@{#if groupedRows.length === 0}<div class="p-4"><Empty.Root- class={cn('min-h-48 rounded-xl border-0 py-12', unstyled ? 'bg-transparent' : 'bg-card/30 backdrop-blur-sm')}+ class={cn('min-h-48 rounded-xl py-12', unstyled ? 'border-transparent bg-transparent' : 'bg-card/30 backdrop-blur-sm')}role="status"aria-live="polite"><Empty.Header><Empty.Media variant="icon">- <FolderXIcon class="text-muted-foreground/40 size-10" />+ <FolderXIcon class="text-muted-foreground/60 size-10" /></Empty.Media>- <Empty.Title class="text-base font-medium">{m.common_no_results_found()}</Empty.Title>+ <Empty.Title class="text-lg font-semibold">{m.common_no_results_found()}</Empty.Title>+ <Empty.Description class="text-muted-foreground text-sm">{m.common_no_results_hint()}</Empty.Description></Empty.Header></Empty.Root></div>{/if}+ {:else if loading && table.getRowModel().rows.length === 0}+ {@render mobileSkeleton()}{:else}<!-- Non-grouped view (original behavior) -->{#each table.getRowModel().rows as row (row.id)}@@ -105,7 +126,7 @@<!-- svelte-ignore a11y_click_events_have_key_events --><!-- svelte-ignore a11y_no_static_element_interactions --><div class={cn(hasExpand && 'cursor-pointer')} onclick={(e) => handleRowClick(e, rowId)}>- {@render mobileCard({ row, item: row.original as any, mobileFieldVisibility })}+ {@render mobileCard({ row, item: row.original, mobileFieldVisibility })}</div>{#if hasExpand && isExpanded && expandedRowContent}<div class="bg-muted/30 px-4 py-3" transition:slide={{ duration: 200 }}>@@ -115,15 +136,16 @@{:else}<div class="p-4"><Empty.Root- class={cn('min-h-48 rounded-xl border-0 py-12', unstyled ? 'bg-transparent' : 'bg-card/30 backdrop-blur-sm')}+ class={cn('min-h-48 rounded-xl py-12', unstyled ? 'border-transparent bg-transparent' : 'bg-card/30 backdrop-blur-sm')}role="status"aria-live="polite"><Empty.Header><Empty.Media variant="icon">- <FolderXIcon class="text-muted-foreground/40 size-10" />+ <FolderXIcon class="text-muted-foreground/60 size-10" /></Empty.Media>- <Empty.Title class="text-base font-medium">{m.common_no_results_found()}</Empty.Title>+ <Empty.Title class="text-lg font-semibold">{m.common_no_results_found()}</Empty.Title>+ <Empty.Description class="text-muted-foreground text-sm">{m.common_no_results_hint()}</Empty.Description></Empty.Header></Empty.Root></div>diff --git a/frontend/src/lib/components/arcane-table/arcane-table-pagination.svelte b/frontend/src/lib/components/arcane-table/arcane-table-pagination.svelteindex ce4898971..d5d4a5d26 100644--- a/frontend/src/lib/components/arcane-table/arcane-table-pagination.svelte+++ b/frontend/src/lib/components/arcane-table/arcane-table-pagination.svelte@@ -1,5 +1,4 @@<script lang="ts">- import { type Table as TableType } from '@tanstack/table-core';import { ArcaneButton } from '$lib/components/arcane-button/index.js';import * as Select from '$lib/components/ui/select/index.js';import { m } from '$lib/paraglide/messages';@@ -18,8 +17,7 @@setPage,setPageSize}: {- table: TableType<any>;- items: Paginated<any>;+ items: Paginated<unknown>;currentPage: number;totalPages: number;totalItems: number;diff --git a/frontend/src/lib/components/arcane-table/arcane-table-toolbar.svelte b/frontend/src/lib/components/arcane-table/arcane-table-toolbar.svelteindex cf28b69ba..de654d98f 100644--- a/frontend/src/lib/components/arcane-table/arcane-table-toolbar.svelte+++ b/frontend/src/lib/components/arcane-table/arcane-table-toolbar.svelte@@ -1,5 +1,5 @@-<script lang="ts" generics="TData">- import type { Table } from '@tanstack/table-core';+<script lang="ts" generics="TData extends Record<string, any>">+ import type { ArcaneSvelteTable } from './table-features';import DataTableFacetedFilter from './arcane-table-filter.svelte';import DataTableViewOptions from './arcane-table-view-options.svelte';import { Input } from '$lib/components/ui/input/index.js';@@ -32,7 +32,7 @@class: className,imageNameFilterOptions = []}: {- table: Table<TData>;+ table: ArcaneSvelteTable<TData>;selectedIds?: string[];selectionDisabled?: boolean;bulkActions?: BulkAction[];@@ -45,7 +45,7 @@imageNameFilterOptions?: string[];} = $props();- const isFiltered = $derived(table.getState().columnFilters.length > 0 || !!table.getState().globalFilter);+ const isFiltered = $derived(table.state.columnFilters.length > 0 || !!table.state.globalFilter);const usageColumn = $derived(table.getAllColumns().some((col) => col.id === 'inUse') ? table.getColumn('inUse') : undefined);const updatesColumn = $derived(table.getAllColumns().some((col) => col.id === 'updates') ? table.getColumn('updates') : undefined@@ -84,7 +84,7 @@!!(imageNameColumn && imageNameFilterOptions.length > 0) ||!!(statusColumn && serviceCountColumn)));- const activeFilterCount = $derived(table.getState().columnFilters.length);+ const activeFilterCount = $derived(table.state.columnFilters.length);</script><div class={cn('flex flex-wrap items-center gap-2 px-3 py-2.5', className)}>@@ -93,7 +93,7 @@<SearchIcon class="text-muted-foreground pointer-events-none absolute top-1/2 left-2.5 size-4 -translate-y-1/2" /><Inputplaceholder={m.common_search()}- value={(table.getState().globalFilter as string) ?? ''}+ value={(table.state.globalFilter as string) ?? ''}oninput={(e) => debouncedSetGlobal(e.currentTarget.value)}onchange={(e) => table.setGlobalFilter(e.currentTarget.value)}onkeydown={(e) => {diff --git a/frontend/src/lib/components/arcane-table/arcane-table-view-options.svelte b/frontend/src/lib/components/arcane-table/arcane-table-view-options.svelteindex b27840c6a..35f4883bd 100644--- a/frontend/src/lib/components/arcane-table/arcane-table-view-options.svelte+++ b/frontend/src/lib/components/arcane-table/arcane-table-view-options.svelte@@ -1,5 +1,5 @@-<script lang="ts" generics="TData">- import type { Table } from '@tanstack/table-core';+<script lang="ts" generics="TData extends Record<string, any>">+ import type { ArcaneSvelteTable } from './table-features';import { ArcaneButton } from '$lib/components/arcane-button/index.js';import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';import { m } from '$lib/paraglide/messages';@@ -12,7 +12,7 @@onToggleField,customViewOptions}: {- table?: Table<TData>;+ table?: ArcaneSvelteTable<TData>;fields?: { id: string; label: string; visible: boolean }[];onToggleField?: (fieldId: string) => void;customViewOptions?: Snippet;@@ -49,8 +49,7 @@{#each table.getAllColumns().filter((col) => typeof col.accessorFn !== 'undefined' && col.getCanHide()) as column (column)}- {@const meta = column.columnDef.meta as { title?: string }}- {@const headerText = meta?.title ?? column.id}+ {@const headerText = column.columnDef.meta?.title ?? column.id}<DropdownMenu.CheckboxItemchecked={column.getIsVisible()}onCheckedChange={(checked) => column.toggleVisibility(checked === true)}diff --git a/frontend/src/lib/components/arcane-table/arcane-table.svelte b/frontend/src/lib/components/arcane-table/arcane-table.svelteindex f6b96f5ef..6dee1e035 100644--- a/frontend/src/lib/components/arcane-table/arcane-table.svelte+++ b/frontend/src/lib/components/arcane-table/arcane-table.svelte@@ -1,17 +1,8 @@-<script lang="ts" generics="TData extends {id: string}">- import {- type ColumnDef,- type ColumnFiltersState,- type Row,- type RowSelectionState,- type SortingState,- type VisibilityState,- type Table as TableType,- getCoreRowModel- } from '@tanstack/table-core';- import { createSvelteTable } from '$lib/components/ui/data-table/data-table.svelte.js';+<script lang="ts" generics="TData extends Record<string, any> & { id: string }">+ import { createTable, renderComponent, renderSnippet } from '@tanstack/svelte-table';+ import type { ColumnFiltersState, RowSelectionState, SortingState, ColumnVisibilityState } from '@tanstack/table-core';+ import { arcaneTableFeatures, type ArcaneColumnDef, type ArcaneRow, type ArcaneTable } from './table-features';import DataTableToolbar from './arcane-table-toolbar.svelte';- import { renderComponent, renderSnippet } from '$lib/components/ui/data-table/render-helpers.js';import { onMount, untrack } from 'svelte';import type { Paginated, SearchPaginationSortRequest } from '$lib/types/shared';import type { Snippet } from 'svelte';@@ -47,6 +38,7 @@withoutFilters = false,withoutPagination = false,selectionDisabled = false,+ loading = false,unstyled = false,onRefresh,columns,@@ -61,7 +53,7 @@customToolbarActions,customTableView,customSettings = $bindable<Record<string, unknown>>({}),- columnVisibility = $bindable<VisibilityState>({}),+ columnVisibility = $bindable<ColumnVisibilityState>({}),groupedRows = null,// Grouping propsgroupBy,@@ -78,11 +70,13 @@withoutFilters?: boolean;withoutPagination?: boolean;selectionDisabled?: boolean;+ /** When true and there's no data yet, the desktop view shows skeleton rows (first-load). */+ loading?: boolean;unstyled?: boolean;onRefresh: (requestOptions: SearchPaginationSortRequest) => Promise<Paginated<TData>>;columns: ColumnSpec<TData>[];- rowActions?: Snippet<[{ row: Row<TData>; item: TData }]>;- mobileCard: Snippet<[{ row: Row<TData>; item: TData; mobileFieldVisibility: Record<string, boolean> }]>;+ rowActions?: Snippet<[{ row: ArcaneRow<TData>; item: TData }]>;+ mobileCard: Snippet<[{ row: ArcaneRow<TData>; item: TData; mobileFieldVisibility: Record<string, boolean> }]>;mobileFields?: FieldSpec[];mobileFieldVisibility?: Record<string, boolean>;selectedIds?: string[];@@ -93,7 +87,7 @@customTableView?: Snippet<[{- table: TableType<TData>;+ table: ArcaneTable<TData>;renderPagination: Snippet;mobileFieldsForOptions: { id: string; label: string; visible: boolean }[];onToggleMobileField: (fieldId: string) => void;@@ -101,7 +95,7 @@]>;customSettings?: Record<string, unknown>;- columnVisibility?: VisibilityState;+ columnVisibility?: ColumnVisibilityState;groupedRows?: GroupedData<TData>[] | null;// Grouping propsgroupBy?: (item: TData) => string;@@ -110,7 +104,7 @@onGroupToggle?: (groupName: string) => void;imageNameFilterOptions?: string[];// Expandable row props- expandedRowContent?: Snippet<[{ row: Row<TData>; item: TData }]>;+ expandedRowContent?: Snippet<[{ row: ArcaneRow<TData>; item: TData }]>;} = $props();// Default page size constant@@ -128,6 +122,10 @@// Expandable row statelet expandedRows = $state<Set<string>>(new Set());+ // The desktop scroll container, bound below and handed to the desktop view so it can virtualize+ // long flat lists. The unstyled/styled branches are mutually exclusive, so one ref suffices.+ let desktopScrollEl = $state<HTMLElement>();+function toggleRowExpanded(rowId: string) {const next = new Set(expandedRows);if (next.has(rowId)) {@@ -256,7 +254,7 @@updatePagination({ limit, page: 1 });}- function onToggleAll(checked: boolean, table: TableType<TData>) {+ function onToggleAll(checked: boolean, table: ArcaneTable<TData>) {const pageIds = table.getRowModel().rows.map((r) => (r.original as TData).id);if (checked) {const set = new Set([...(selectedIds ?? []), ...pageIds]);@@ -275,8 +273,8 @@}}- function buildColumns(specs: ColumnSpec<TData>[], isSelectionDisabled: boolean): ColumnDef<TData>[] {- const cols: ColumnDef<TData>[] = [];+ function buildColumns(specs: ColumnSpec<TData>[], isSelectionDisabled: boolean): ArcaneColumnDef<TData>[] {+ const cols: ArcaneColumnDef<TData>[] = [];if (!isSelectionDisabled) {cols.push({@@ -386,7 +384,7 @@return `${colIds}:${hasRowActions}:${isSelectionDisabled}`;}- let cachedColumnsDef = $state<ColumnDef<TData>[]>([]);+ let cachedColumnsDef = $state<ArcaneColumnDef<TData>[]>([]);let lastColumnsKey = '';// Use $effect to rebuild columns only when structure changes@@ -403,7 +401,17 @@// Compute effective column count (add 1 for expand chevron column when expandable)const effectiveColumnsCount = $derived(columnsDef.length + (expandedRowContent ? 1 : 0));- const table = createSvelteTable({+ const table = createTable({+ features: arcaneTableFeatures,+ // Manual / server-side mode: no client row models are registered, so sorting and+ // filtering never run on the client — these flags make that explicit. Pagination is+ // fully external (no rowPaginationFeature registered), so there is no manualPagination.+ manualSorting: true,+ manualFiltering: true,+ // Stable row identity across server refreshes. Without this v9 keys rows by positional+ // index, so every onRefresh fetch re-keys all rows and forces a full re-render; keying+ // by the backing id lets unchanged rows (and their DOM/selection) be reused.+ getRowId: (row) => row.id,get data() {return items.data ?? [];},@@ -503,8 +511,7 @@prefs.current = { ...prefs.current, g: globalFilter };}onRefresh(requestOptions);- },- getCoreRowModel: getCoreRowModel()+ }});function onToggleMobileField(fieldId: string) {@@ -653,18 +660,7 @@</script>{#snippet PaginationSnippet()}- <ArcaneTablePagination- {table}- {items}- {currentPage}- {totalPages}- {totalItems}- {pageSize}- {canPrev}- {canNext}- {setPage}- {setPageSize}- />+ <ArcaneTablePagination {items} {currentPage} {totalPages} {totalItems} {pageSize} {canPrev} {canNext} {setPage} {setPageSize} />{/snippet}{#if customTableView}@@ -688,7 +684,7 @@</div>{/if}- <div class="[isolation:isolate] hidden h-full min-h-0 flex-1 overflow-auto md:block">+ <div bind:this={desktopScrollEl} class="[isolation:isolate] hidden h-full min-h-0 flex-1 overflow-auto md:block"><ArcaneTableDesktopView{table}{selectedIds}@@ -705,6 +701,8 @@{expandedRowContent}{expandedRows}onToggleRowExpanded={toggleRowExpanded}+ scrollElement={desktopScrollEl}+ {loading}/></div>@@ -720,6 +718,7 @@{expandedRowContent}{expandedRows}onToggleRowExpanded={toggleRowExpanded}+ {loading}/></div></div>@@ -749,7 +748,10 @@</div>{/if}- <div class="bg-background/80 [isolation:isolate] hidden h-full min-h-0 flex-1 overflow-auto md:block">+ <div+ bind:this={desktopScrollEl}+ class="bg-background/80 [isolation:isolate] hidden h-full min-h-0 flex-1 overflow-auto md:block"+ ><ArcaneTableDesktopView{table}{selectedIds}@@ -765,6 +767,8 @@{expandedRowContent}{expandedRows}onToggleRowExpanded={toggleRowExpanded}+ scrollElement={desktopScrollEl}+ {loading}/></div>@@ -778,6 +782,7 @@{expandedRowContent}{expandedRows}onToggleRowExpanded={toggleRowExpanded}+ {loading}/></div>diff --git a/frontend/src/lib/components/arcane-table/arcane-table.types.svelte.ts b/frontend/src/lib/components/arcane-table/arcane-table.types.svelte.tsindex dd3c62c63..ca3bfb823 100644--- a/frontend/src/lib/components/arcane-table/arcane-table.types.svelte.ts+++ b/frontend/src/lib/components/arcane-table/arcane-table.types.svelte.ts@@ -1,4 +1,5 @@-import type { Row, Column, FilterFn, ColumnFiltersState, VisibilityState, Table as TableType } from '@tanstack/table-core';+import type { CellData, ColumnFiltersState, ColumnVisibilityState, RowData, TableFeatures } from '@tanstack/table-core';+import type { ArcaneColumn, ArcaneFilterFn, ArcaneRow, ArcaneSvelteTable } from './table-features';import type { Snippet } from 'svelte';import type { Component } from 'svelte';@@ -23,17 +24,31 @@ export type SortState = { column: string; direction: SortDirection };export type ColumnWidth = 'auto' | 'min' | 'max' | number;export type ColumnAlign = 'left' | 'center' | 'right';-export type ColumnSpec<T> = {+// Arcane stows presentation hints on each column's `meta`. Augmenting v9's `ColumnMeta`+// (which now threads TFeatures/TData/TValue) types these instead of the inline+// `meta as { … }` casts the desktop view / toolbar / view-options used to read them back.+// The generic signature must mirror table-core's declaration for declaration merging.+declare module '@tanstack/table-core' {+ interface ColumnMeta<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData = CellData> {+ title?: string;+ filterOptions?: FilterOption[];+ width?: ColumnWidth;+ align?: ColumnAlign;+ truncate?: boolean;+ }+}++export type ColumnSpec<T extends RowData> = {accessorKey?: keyof T & string;accessorFn?: (row: T) => any;id?: string;title: string;hidden?: boolean;sortable?: boolean;- cell?: Snippet<[{ row: Row<T>; item: T; value: unknown }]>;- header?: Snippet<[{ column: Column<T>; title: string; class?: string }]>;+ cell?: Snippet<[{ row: ArcaneRow<T>; item: T; value: unknown }]>;+ header?: Snippet<[{ column: ArcaneColumn<T>; title: string; class?: string }]>;class?: string;- filterFn?: FilterFn<T>;+ filterFn?: ArcaneFilterFn<T>;filterOptions?: FilterOption[];width?: ColumnWidth;align?: ColumnAlign;@@ -57,7 +72,7 @@ export type CompactTablePrefs = {c?: Record<string, unknown>;};-export function encodeHidden(visibility: VisibilityState): string[] {+export function encodeHidden(visibility: ColumnVisibilityState): string[] {const hidden: string[] = [];for (const [id, visible] of Object.entries(visibility)) {if (visible === false) hidden.push(id);@@ -65,7 +80,7 @@ export function encodeHidden(visibility: VisibilityState): string[] {return hidden;}-export function applyHiddenPatch(target: VisibilityState, hidden?: string[]) {+export function applyHiddenPatch(target: ColumnVisibilityState, hidden?: string[]) {if (!hidden?.length) return;for (const id of hidden) {target[id] = false;@@ -151,7 +166,10 @@ export function shouldIgnoreTableRowClick(event: MouseEvent): boolean {return !!target?.closest('a, button, input, [role="checkbox"], [data-slot="checkbox"], [data-row-select-ignore]');}-export function getTableRowsForItems<T extends { id?: string }>(table: TableType<T>, groupItems: Array<{ id: string }>) {+export function getTableRowsForItems<T extends RowData & { id?: string }>(+ table: ArcaneSvelteTable<T>,+ groupItems: Array<{ id: string }>+) {const groupIds = new Set(groupItems.map((item) => item.id));return table.getRowModel().rows.filter((row) => groupIds.has(row.original.id ?? ''));}diff --git a/frontend/src/lib/components/arcane-table/index.ts b/frontend/src/lib/components/arcane-table/index.tsindex cf08093ec..d169e1145 100644--- a/frontend/src/lib/components/arcane-table/index.ts+++ b/frontend/src/lib/components/arcane-table/index.ts@@ -2,5 +2,15 @@ export { default as DataTableToolbar } from './arcane-table-toolbar.svelte';export { default as DataTableViewOptions } from './arcane-table-view-options.svelte';export { default as DataTableFacetedFilter } from './arcane-table-filter.svelte';export type { ColumnSpec, FieldSpec, MobileFieldVisibility, BulkAction } from './arcane-table.types.svelte';+export type {+ ArcaneFeatures,+ ArcaneColumnDef,+ ArcaneRow,+ ArcaneColumn,+ ArcaneCell,+ ArcaneTable,+ ArcaneSvelteTable,+ ArcaneFilterFn+} from './table-features';export { default as UniversalMobileCard } from './cards/universal-mobile-card.svelte';export { usageFilters, imageUpdateFilters, severityFilters, vulnerabilitySeverityFilters } from './data.js';diff --git a/frontend/src/lib/components/arcane-table/table-features.ts b/frontend/src/lib/components/arcane-table/table-features.tsnew file mode 100644index 000000000..af05f510c--- /dev/null+++ b/frontend/src/lib/components/arcane-table/table-features.ts@@ -0,0 +1,57 @@+import {+ columnFilteringFeature,+ columnVisibilityFeature,+ globalFilteringFeature,+ rowSelectionFeature,+ rowSortingFeature,+ tableFeatures,+ type SvelteTable+} from '@tanstack/svelte-table';+import type { Cell, Column, ColumnDef, FilterFn, Row, RowData, Table } from '@tanstack/table-core';++/**+ * The single, app-wide TanStack Table v9 feature set shared by every Arcane table.+ *+ * Arcane runs all tables in manual / server-side mode — sorting, filtering and+ * pagination all happen on the backend (driven by `requestOptions` + `onRefresh`) — so+ * we register only the *state* features the UI actually drives and deliberately omit+ * every client-side row-model factory (`createSortedRowModel`, `createFilteredRowModel`,+ * `createPaginatedRowModel`, …). v9 tree-shakes the unregistered feature code out of the+ * bundle, which is the headline performance win of this migration. The core row model is+ * automatic, so no `rowModels` entry is needed.+ *+ * Declared once, statically, outside any component (per the `tableFeatures` guidance).+ */+export const arcaneTableFeatures = tableFeatures({+ rowSelectionFeature,+ columnVisibilityFeature,+ rowSortingFeature,+ columnFilteringFeature,+ globalFilteringFeature+});++/**+ * The concrete `TFeatures` for every Arcane table. v9 threads a leading `TFeatures`+ * generic through `ColumnDef`/`Row`/`Column`/`Cell`/`Table`; binding it here lets the+ * single-data-param aliases below absorb it, so the ~30 consumers and the public+ * `ColumnSpec` API never have to spell the feature generic.+ */+export type ArcaneFeatures = typeof arcaneTableFeatures;++// v9 requires `TData extends RowData` (= Record<string, any> | Array<any>). Every Arcane table+// row is an object DTO (which satisfies RowData), so the aliases carry that bound explicitly;+// callers thread it through their own `TData extends Record<string, any>` generic. These bind+// the real `arcaneTableFeatures` so the buildColumns cell/header callbacks infer precise+// contexts. The leaf view components (header/cell/row/table props) instead use fully-`any`+// tanstack types — v9's conditional type shapes only reconcile a deferred `TData` against a+// resolved instantiation when `TFeatures` is also `any`, and those components were already+// loosely typed pre-migration.+export type ArcaneColumnDef<T extends RowData> = ColumnDef<ArcaneFeatures, T>;+export type ArcaneRow<T extends RowData> = Row<ArcaneFeatures, T>;+export type ArcaneColumn<T extends RowData> = Column<ArcaneFeatures, T>;+export type ArcaneCell<T extends RowData> = Cell<ArcaneFeatures, T>;+/** Core table type — used for callback contexts and read-only method access. */+export type ArcaneTable<T extends RowData> = Table<ArcaneFeatures, T>;+/** The Svelte adapter table instance — adds reactive `.state` (read state slices). */+export type ArcaneSvelteTable<T extends RowData> = SvelteTable<ArcaneFeatures, T>;+export type ArcaneFilterFn<T extends RowData> = FilterFn<ArcaneFeatures, T>;diff --git a/frontend/src/lib/components/arcane-table/virtualizer.svelte.ts b/frontend/src/lib/components/arcane-table/virtualizer.svelte.tsnew file mode 100644index 000000000..d294c54c1--- /dev/null+++ b/frontend/src/lib/components/arcane-table/virtualizer.svelte.ts@@ -0,0 +1,77 @@+import {+ Virtualizer,+ elementScroll,+ observeElementOffset,+ observeElementRect,+ type VirtualItem,+ type VirtualizerOptions+} from '@tanstack/virtual-core';++// The three platform adapters (`observeElementRect` / `observeElementOffset` / `scrollToFn`) are+// supplied for the caller, so they only provide the data-driven options (count, getScrollElement,+// estimateSize, …).+type SuppliedKeys = 'observeElementRect' | 'observeElementOffset' | 'scrollToFn';+type CreateVirtualizerOptions<TScroll extends Element, TItem extends Element> = Omit<+ VirtualizerOptions<TScroll, TItem>,+ SuppliedKeys+> &+ Partial<Pick<VirtualizerOptions<TScroll, TItem>, SuppliedKeys>>;++/**+ * A Svelte 5 runes wrapper around `@tanstack/virtual-core`.+ *+ * We wrap the framework-agnostic core directly (rather than `@tanstack/svelte-virtual`, whose v3+ * adapter still uses Svelte 4 stores and mis-tracks the scroll-element binding under runes) — the+ * same approach the repo took for `@tanstack/table-core`. `onChange` pushes the recomputed window+ * into `$state`, and `$effect.pre` re-applies options whenever the reactive inputs (row count,+ * scroll element, …) change.+ *+ * Pass `options` as a thunk so its reactive reads are tracked.+ */+export function createVirtualizer<TScroll extends Element, TItem extends Element>(+ options: () => CreateVirtualizerOptions<TScroll, TItem>+) {+ let virtualItems = $state.raw<VirtualItem[]>([]);+ let totalSize = $state(0);++ function resolveOptions(): VirtualizerOptions<TScroll, TItem> {+ const supplied = options();+ return {+ observeElementRect,+ observeElementOffset,+ scrollToFn: elementScroll,+ ...supplied,+ onChange: (instance, sync) => {+ virtualItems = instance.getVirtualItems();+ totalSize = instance.getTotalSize();+ supplied.onChange?.(instance, sync);+ }+ };+ }++ const instance = new Virtualizer<TScroll, TItem>(resolveOptions());+ virtualItems = instance.getVirtualItems();+ totalSize = instance.getTotalSize();++ // Re-apply options on reactive input changes, then recompute the visible window.+ $effect.pre(() => {+ instance.setOptions(resolveOptions());+ instance._willUpdate();+ virtualItems = instance.getVirtualItems();+ totalSize = instance.getTotalSize();+ });++ // Attach scroll/resize observers after the DOM (and the bound scroll element) exists.+ $effect(() => instance._didMount());++ return {+ get virtualItems() {+ return virtualItems;+ },+ get totalSize() {+ return totalSize;+ },+ /** `use:` action target — measures real row heights for accurate offsets. */+ measureElement: (node: TItem) => instance.measureElement(node)+ };+}diff --git a/frontend/src/lib/components/image-update-item.svelte b/frontend/src/lib/components/image-update-item.svelteindex ea848b140..feae4b989 100644--- a/frontend/src/lib/components/image-update-item.svelte+++ b/frontend/src/lib/components/image-update-item.svelte@@ -11,6 +11,7 @@import { createQuery } from '@tanstack/svelte-query';import UpdateStatusPopover from '$lib/components/update-status-popover.svelte';import { activityToastOptions, extractActivityId } from '$lib/utils/activity-toast';+ import UncheckedRingIcon from '$lib/components/unchecked-ring-icon.svelte';interface Props {updateInfo?: ImageUpdateData;@@ -489,17 +490,17 @@<buttononclick={checkImageUpdate}disabled={isChecking}- class="group flex h-4 w-4 items-center justify-center rounded-full border-2 border-dashed border-gray-400 transition-colors hover:border-blue-400 hover:bg-blue-50 disabled:cursor-not-allowed dark:hover:bg-blue-950"+ class="flex size-4 items-center justify-center rounded-full text-gray-400 transition-colors hover:text-blue-400 disabled:cursor-not-allowed">{#if isChecking}- <Spinner class="h-2 w-2 text-blue-400" />+ <Spinner class="size-3 text-blue-400" />{:else}- <div class="h-1.5 w-1.5 rounded-full bg-gray-400 transition-colors group-hover:bg-blue-400"></div>+ <UncheckedRingIcon />{/if}</button>{:else}- <div class="flex h-4 w-4 items-center justify-center rounded-full border-2 border-dashed border-gray-400 opacity-30">- <div class="h-1.5 w-1.5 rounded-full bg-gray-400"></div>+ <div class="flex size-4 items-center justify-center text-gray-400 opacity-30">+ <UncheckedRingIcon /></div>{/if}</span>diff --git a/frontend/src/lib/components/project-update-item.svelte b/frontend/src/lib/components/project-update-item.svelteindex 3f9b00f94..e7a916dbf 100644--- a/frontend/src/lib/components/project-update-item.svelte+++ b/frontend/src/lib/components/project-update-item.svelte@@ -7,6 +7,7 @@import { AlertIcon, CircleArrowUpIcon, ClockIcon, ImagesIcon, RefreshIcon, VerifiedCheckIcon } from '$lib/icons';import type { Component } from 'svelte';import { format } from 'date-fns';+ import UncheckedRingIcon from '$lib/components/unchecked-ring-icon.svelte';interface Props {updateInfo?: ProjectUpdateInfo;@@ -173,11 +174,9 @@{#if status === 'error'}<AlertIcon class="size-4 text-red-500 transition-colors group-hover:text-blue-400" />{:else}- <div- class="flex h-4 w-4 items-center justify-center rounded-full border-2 border-dashed border-gray-400 transition-colors group-hover:border-blue-400 group-hover:bg-blue-50"- >- <div class="h-1.5 w-1.5 rounded-full bg-gray-400 transition-colors group-hover:bg-blue-400"></div>- </div>+ <span class="flex size-4 items-center justify-center text-gray-400 transition-colors group-hover:text-blue-400">+ <UncheckedRingIcon />+ </span>{/if}</button></span>@@ -194,8 +193,8 @@{:else if status === 'has_update'}<CircleArrowUpIcon class="size-4 text-blue-500" />{:else}- <div class="flex h-4 w-4 items-center justify-center rounded-full border-2 border-dashed border-gray-400 opacity-60">- <div class="h-1.5 w-1.5 rounded-full bg-gray-400"></div>+ <div class="flex size-4 items-center justify-center text-gray-400 opacity-60">+ <UncheckedRingIcon /></div>{/if}</span>@@ -237,7 +236,7 @@<div class="space-y-2"><div class="text-foreground text-[11px] font-medium tracking-wide uppercase">{m.images_has_updates()}</div><div class="max-h-40 space-y-1 overflow-auto">- {#each updatedImageRefs as imageRef}+ {#each updatedImageRefs as imageRef (imageRef)}<div class="bg-muted text-foreground rounded-md px-2 py-1 font-mono text-xs break-all">{imageRef}</div>diff --git a/frontend/src/lib/components/ui/data-table/data-table.svelte.ts b/frontend/src/lib/components/ui/data-table/data-table.svelte.tsdeleted file mode 100644index 5a5479b32..000000000--- a/frontend/src/lib/components/ui/data-table/data-table.svelte.ts+++ /dev/null@@ -1,130 +0,0 @@-import { type RowData, type TableOptions, type TableOptionsResolved, type TableState, createTable } from '@tanstack/table-core';--/**- * Creates a reactive TanStack table object for Svelte.- * @param options Table options to create the table with.- * @returns A reactive table object.- * @example- * ```svelte- * <script>- * const table = createSvelteTable({ ... })- * </script>- *- * <table>- * <thead>- * {#each table.getHeaderGroups() as headerGroup}- * <tr>- * {#each headerGroup.headers as header}- * <th colspan={header.colSpan}>- * <FlexRender content={header.column.columnDef.header} context={header.getContext()} />- * </th>- * {/each}- * </tr>- * {/each}- * </thead>- * <!-- ... -->- * </table>- * ```- */-export function createSvelteTable<TData extends RowData>(options: TableOptions<TData>) {- const resolvedOptions: TableOptionsResolved<TData> = mergeObjects(- {- state: {},- onStateChange() {},- renderFallbackValue: null,- mergeOptions: (defaultOptions: TableOptions<TData>, options: Partial<TableOptions<TData>>) => {- return mergeObjects(defaultOptions, options);- }- },- options- );-- const table = createTable(resolvedOptions);- let state = $state<Partial<TableState>>(table.initialState);-- function updateOptions() {- table.setOptions((prev) => {- return mergeObjects(prev, options, {- state: mergeObjects(state, options.state || {}),-- // eslint-disable-next-line @typescript-eslint/no-explicit-any- onStateChange: (updater: any) => {- if (updater instanceof Function) state = updater(state);- else state = mergeObjects(state, updater);-- options.onStateChange?.(updater);- }- });- });- }-- updateOptions();-- $effect.pre(() => {- updateOptions();- });-- return table;-}--type MaybeThunk<T extends object> = T | (() => T | null | undefined);-type Intersection<T extends readonly unknown[]> = (T extends [infer H, ...infer R] ? H & Intersection<R> : unknown) & {};--/**- * Lazily merges several objects (or thunks) while preserving- * getter semantics from every source.- *- * Proxy-based to avoid known WebKit recursion issue.- */-// eslint-disable-next-line @typescript-eslint/no-explicit-any-function mergeObjects<Sources extends readonly MaybeThunk<any>[]>(- ...sources: Sources-): Intersection<{ [K in keyof Sources]: Sources[K] }> {- const resolve = <T extends object>(src: MaybeThunk<T>): T | undefined =>- typeof src === 'function' ? (src() ?? undefined) : src;-- const findSourceWithKey = (key: PropertyKey) => {- for (let i = sources.length - 1; i >= 0; i--) {- const obj = resolve(sources[i]);- if (obj && key in obj) return obj;- }- return undefined;- };-- return new Proxy(Object.create(null), {- get(_, key) {- const src = findSourceWithKey(key);-- return src?.[key as never];- },-- has(_, key) {- return !!findSourceWithKey(key);- },-- ownKeys(): (string | symbol)[] {- const all = new Set<string | symbol>();- for (const s of sources) {- const obj = resolve(s);- if (obj) {- for (const k of Reflect.ownKeys(obj) as (string | symbol)[]) {- all.add(k);- }- }- }- return [...all];- },-- getOwnPropertyDescriptor(_, key) {- const src = findSourceWithKey(key);- if (!src) return undefined;- return {- configurable: true,- enumerable: true,- // eslint-disable-next-line @typescript-eslint/no-explicit-any- value: (src as any)[key],- writable: true- };- }- }) as Intersection<{ [K in keyof Sources]: Sources[K] }>;-}diff --git a/frontend/src/lib/components/ui/data-table/flex-render.svelte b/frontend/src/lib/components/ui/data-table/flex-render.sveltedeleted file mode 100644index be0421f21..000000000--- a/frontend/src/lib/components/ui/data-table/flex-render.svelte+++ /dev/null@@ -1,33 +0,0 @@-<script lang="ts" generics="TData, TValue, TContext extends HeaderContext<TData, TValue> | CellContext<TData, TValue>">- import type { CellContext, ColumnDefTemplate, HeaderContext } from '@tanstack/table-core';- import { RenderComponentConfig, RenderSnippetConfig } from './render-helpers.js';- type Props = {- /** The cell or header field of the current cell's column definition. */- content?: TContext extends HeaderContext<TData, TValue>- ? ColumnDefTemplate<HeaderContext<TData, TValue>>- : TContext extends CellContext<TData, TValue>- ? ColumnDefTemplate<CellContext<TData, TValue>>- : never;- /** The result of the `getContext()` function of the header or cell */- context: TContext;- };-- let { content, context }: Props = $props();-</script>--{#if typeof content === 'string'}- {content}-{:else if content instanceof Function}- <!-- It's unlikely that a CellContext will be passed to a Header -->- <!-- eslint-disable-next-line @typescript-eslint/no-explicit-any -->- {@const result = content(context as any)}- {#if result instanceof RenderComponentConfig}- {@const { component: Component, props } = result}- <Component {...props} />- {:else if result instanceof RenderSnippetConfig}- {@const { snippet, params } = result}- {@render snippet?.(params)}- {:else}- {result}- {/if}-{/if}diff --git a/frontend/src/lib/components/ui/data-table/index.ts b/frontend/src/lib/components/ui/data-table/index.tsdeleted file mode 100644index 05fb82150..000000000--- a/frontend/src/lib/components/ui/data-table/index.ts+++ /dev/null@@ -1,3 +0,0 @@-export { default as FlexRender } from './flex-render.svelte';-export { renderComponent, renderSnippet } from './render-helpers.js';-export { createSvelteTable } from './data-table.svelte.js';diff --git a/frontend/src/lib/components/ui/data-table/render-helpers.ts b/frontend/src/lib/components/ui/data-table/render-helpers.tsdeleted file mode 100644index 99a6dffda..000000000--- a/frontend/src/lib/components/ui/data-table/render-helpers.ts+++ /dev/null@@ -1,108 +0,0 @@-import type { Component, ComponentProps, Snippet } from 'svelte';--/**- * A helper class to make it easy to identify Svelte components in- * `columnDef.cell` and `columnDef.header` properties.- *- * > NOTE: This class should only be used internally by the adapter. If you're- * reading this and you don't know what this is for, you probably don't need it.- *- * @example- * ```svelte- * {@const result = content(context as any)}- * {#if result instanceof RenderComponentConfig}- * {@const { component: Component, props } = result}- * <Component {...props} />- * {/if}- * ```- */-export class RenderComponentConfig<TComponent extends Component> {- component: TComponent;- props: ComponentProps<TComponent> | Record<string, never>;- constructor(component: TComponent, props: ComponentProps<TComponent> | Record<string, never> = {}) {- this.component = component;- this.props = props;- }-}--/**- * A helper class to make it easy to identify Svelte Snippets in `columnDef.cell` and `columnDef.header` properties.- *- * > NOTE: This class should only be used internally by the adapter. If you're- * reading this and you don't know what this is for, you probably don't need it.- *- * @example- * ```svelte- * {@const result = content(context as any)}- * {#if result instanceof RenderSnippetConfig}- * {@const { snippet, params } = result}- * {@render snippet(params)}- * {/if}- * ```- */-export class RenderSnippetConfig<TProps> {- snippet: Snippet<[TProps]>;- params: TProps;- constructor(snippet: Snippet<[TProps]>, params: TProps) {- this.snippet = snippet;- this.params = params;- }-}--/**- * A helper function to help create cells from Svelte components through ColumnDef's `cell` and `header` properties.- *- * This is only to be used with Svelte Components - use `renderSnippet` for Svelte Snippets.- *- * @param component A Svelte component- * @param props The props to pass to `component`- * @returns A `RenderComponentConfig` object that helps svelte-table know how to render the header/cell component.- * @example- * ```ts- * // +page.svelte- * const defaultColumns = [- * columnHelper.accessor('name', {- * header: header => renderComponent(SortHeader, { label: 'Name', header }),- * }),- * columnHelper.accessor('state', {- * header: header => renderComponent(SortHeader, { label: 'State', header }),- * }),- * ]- * ```- * @see {@link https://tanstack.com/table/latest/docs/guide/column-defs}- */-export function renderComponent<- // eslint-disable-next-line @typescript-eslint/no-explicit-any- T extends Component<any>,- Props extends ComponentProps<T>->(component: T, props: Props = {} as Props) {- return new RenderComponentConfig(component, props);-}--/**- * A helper function to help create cells from Svelte Snippets through ColumnDef's `cell` and `header` properties.- *- * The snippet must only take one parameter.- *- * This is only to be used with Snippets - use `renderComponent` for Svelte Components.- *- * @param snippet- * @param params- * @returns - A `RenderSnippetConfig` object that helps svelte-table know how to render the header/cell snippet.- * @example- * ```ts- * // +page.svelte- * const defaultColumns = [- * columnHelper.accessor('name', {- * cell: cell => renderSnippet(nameSnippet, { name: cell.row.name }),- * }),- * columnHelper.accessor('state', {- * cell: cell => renderSnippet(stateSnippet, { state: cell.row.state }),- * }),- * ]- * ```- * @see {@link https://tanstack.com/table/latest/docs/guide/column-defs}- */-export function renderSnippet<TProps>(snippet: Snippet<[TProps]>, params: TProps = {} as TProps) {- return new RenderSnippetConfig(snippet, params);-}diff --git a/frontend/src/lib/components/ui/empty/empty.svelte b/frontend/src/lib/components/ui/empty/empty.svelteindex 56f38c3da..3ae567c2b 100644--- a/frontend/src/lib/components/ui/empty/empty.svelte+++ b/frontend/src/lib/components/ui/empty/empty.svelte@@ -8,7 +8,7 @@<divdata-slot="empty"class={cn(- 'flex min-w-0 flex-1 flex-col items-center justify-center gap-6 rounded-lg border-dashed p-6 text-center text-balance md:p-12',+ 'border-border/50 bg-muted/20 flex min-w-0 flex-1 flex-col items-center justify-center gap-6 rounded-lg border border-dashed p-6 text-center text-balance md:p-12',className)}{...restProps}diff --git a/frontend/src/lib/components/ui/sonner/sonner.svelte b/frontend/src/lib/components/ui/sonner/sonner.svelteindex f6360abac..e3cb81731 100644--- a/frontend/src/lib/components/ui/sonner/sonner.svelte+++ b/frontend/src/lib/components/ui/sonner/sonner.svelte@@ -11,10 +11,16 @@toastOptions={{classes: {toast:- 'group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg',+ 'group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:rounded-xl group-[.toaster]:shadow-lg',+ title: 'group-[.toast]:font-semibold',description: 'group-[.toast]:text-muted-foreground',actionButton: 'group-[.toast]:bg-primary group-[.toast]:text-primary-foreground',- cancelButton: 'group-[.toast]:bg-muted group-[.toast]:text-muted-foreground'+ cancelButton: 'group-[.toast]:bg-muted group-[.toast]:text-muted-foreground',+ // Flat per-type accent: a colored left border, no glass/heavy bg.+ success: 'group-[.toaster]:border-l-4 group-[.toaster]:border-l-emerald-500',+ error: 'group-[.toaster]:border-l-4 group-[.toaster]:border-l-red-500',+ warning: 'group-[.toaster]:border-l-4 group-[.toaster]:border-l-amber-500',+ info: 'group-[.toaster]:border-l-4 group-[.toaster]:border-l-sky-500'}}}{...restProps}diff --git a/frontend/src/lib/components/ui/table/table-cell.svelte b/frontend/src/lib/components/ui/table/table-cell.svelteindex 7708c7daf..4ded6662a 100644--- a/frontend/src/lib/components/ui/table/table-cell.svelte+++ b/frontend/src/lib/components/ui/table/table-cell.svelte@@ -9,7 +9,7 @@bind:this={ref}data-slot="table-cell"class={cn(- 'bg-transparent px-4 py-3 align-middle whitespace-nowrap',+ 'bg-transparent px-4 py-2 align-middle whitespace-nowrap','first:pl-6 last:pr-6 [&:has([role=checkbox])]:pr-0',className)}diff --git a/frontend/src/lib/components/ui/table/table-head.svelte b/frontend/src/lib/components/ui/table/table-head.svelteindex a5fe162aa..4f207caf8 100644--- a/frontend/src/lib/components/ui/table/table-head.svelte+++ b/frontend/src/lib/components/ui/table/table-head.svelte@@ -9,7 +9,7 @@bind:this={ref}data-slot="table-head"class={cn(- 'text-muted-foreground h-11 px-4 text-left align-middle text-[11px] font-semibold tracking-wide whitespace-nowrap uppercase',+ 'text-muted-foreground bg-background sticky top-0 z-20 h-11 px-4 text-left align-middle text-[11px] font-semibold tracking-wide whitespace-nowrap uppercase','first:pl-6 last:pr-6 [&:has([role=checkbox])]:pr-0',className)}diff --git a/frontend/src/lib/components/ui/table/table-row.svelte b/frontend/src/lib/components/ui/table/table-row.svelteindex d03d26d8f..f5338a88b 100644--- a/frontend/src/lib/components/ui/table/table-row.svelte+++ b/frontend/src/lib/components/ui/table/table-row.svelte@@ -15,7 +15,7 @@data-slot="table-row"class={cn('group/row border-border/40 bg-background cursor-pointer border-b transition-colors',- 'hover:bg-primary/15 data-[state=selected]:bg-primary/10',+ 'hover:bg-primary/10 data-[state=selected]:bg-primary/20',className)}{...restProps}diff --git a/frontend/src/lib/components/unchecked-ring-icon.svelte b/frontend/src/lib/components/unchecked-ring-icon.sveltenew file mode 100644index 000000000..a1eb2d513--- /dev/null+++ b/frontend/src/lib/components/unchecked-ring-icon.svelte@@ -0,0 +1,14 @@+<script lang="ts">+ import { cn } from '$lib/utils.js';+ import type { SVGAttributes } from 'svelte/elements';++ let { class: className, ...restProps }: SVGAttributes<SVGSVGElement> = $props();+</script>++<!-- SVG ring instead of a CSS dashed border: `pathLength` makes the dashes wrap perfectly evenly+ around the circle (CSS `border-dashed` renders lopsided on a small ring), and the inner dot is+ exactly centered. Both follow `currentColor` from the parent. -->+<svg viewBox="0 0 16 16" class={cn('size-4', className)} fill="none" aria-hidden="true" {...restProps}>+ <circle cx="8" cy="8" r="6.25" stroke="currentColor" stroke-width="1.5" pathLength="32" stroke-dasharray="2 2" />+ <circle cx="8" cy="8" r="2.25" fill="currentColor" />+</svg>diff --git a/frontend/src/routes/(app)/containers/container-table.svelte b/frontend/src/routes/(app)/containers/container-table.svelteindex 7fadf9ba4..ae491f462 100644--- a/frontend/src/routes/(app)/containers/container-table.svelte+++ b/frontend/src/routes/(app)/containers/container-table.svelte@@ -231,7 +231,7 @@const columns = $derived([{ accessorKey: 'id', title: m.common_id(), cell: IdCell, hidden: true },{ accessorKey: 'names', id: 'name', title: m.common_name(), sortable: !groupByProject, cell: NameCell },- { accessorKey: 'image', title: m.common_image(), sortable: !groupByProject, cell: ImageCell, truncate: true },+ { accessorKey: 'image', title: m.common_image(), sortable: !groupByProject, cell: ImageCell, width: 'max' },{ accessorKey: 'state', title: m.common_state(), sortable: !groupByProject, cell: StateCell },{id: 'updates',@@ -452,8 +452,8 @@{#snippet ImageCell({ item }: { item: ContainerSummaryDto })}<ArcaneTooltip.Root>- <ArcaneTooltip.Trigger class="block w-full min-w-0">- <span class="block w-full cursor-default truncate text-left font-mono text-xs">+ <ArcaneTooltip.Trigger class="flex w-full min-w-0">+ <span class="min-w-0 flex-1 cursor-default truncate text-left font-mono text-xs">{truncateImageDigest(item.image)}</span></ArcaneTooltip.Trigger>diff --git a/frontend/src/routes/(app)/environments/[id]/gitops/sync-table.svelte b/frontend/src/routes/(app)/environments/[id]/gitops/sync-table.svelteindex 759e279a1..81850a2c6 100644--- a/frontend/src/routes/(app)/environments/[id]/gitops/sync-table.svelte+++ b/frontend/src/routes/(app)/environments/[id]/gitops/sync-table.svelte@@ -8,8 +8,7 @@import { tryCatch } from '$lib/utils/api';import type { Paginated, SearchPaginationSortRequest } from '$lib/types/shared';import type { GitOpsSync } from '$lib/types/automation';- import type { Row } from '@tanstack/table-core';- import type { ColumnSpec, BulkAction } from '$lib/components/arcane-table';+ import type { ColumnSpec, BulkAction, ArcaneRow } from '$lib/components/arcane-table';import { UniversalMobileCard } from '$lib/components/arcane-table/index.js';import { format } from 'date-fns';import { m } from '$lib/paraglide/messages';@@ -190,7 +189,7 @@]);</script>-{#snippet NameCell({ item, value }: { item: GitOpsSync; value: any; row: Row<GitOpsSync> })}+{#snippet NameCell({ item, value }: { item: GitOpsSync; value: any; row: ArcaneRow<GitOpsSync> })}{#if item.projectId}<a class="font-medium hover:underline" href={getProjectDetailsUrl(item.projectId)}>{value}@@ -200,25 +199,25 @@{/if}{/snippet}-{#snippet BranchCell({ value }: { value: any; item: GitOpsSync; row: Row<GitOpsSync> })}+{#snippet BranchCell({ value }: { value: any; item: GitOpsSync; row: ArcaneRow<GitOpsSync> })}<div class="flex items-center gap-1.5"><GitBranchIcon class="text-muted-foreground size-3.5" /><code class="bg-muted text-muted-foreground rounded px-2 py-0.5 text-xs">{value}</code></div>{/snippet}-{#snippet PathCell({ value }: { value: any; item: GitOpsSync; row: Row<GitOpsSync> })}+{#snippet PathCell({ value }: { value: any; item: GitOpsSync; row: ArcaneRow<GitOpsSync> })}<div class="flex items-center gap-1.5"><FolderIcon class="text-muted-foreground size-3.5" /><code class="bg-muted text-muted-foreground rounded px-2 py-0.5 text-xs">{value}</code></div>{/snippet}-{#snippet AutoSyncCell({ value }: { value: any; item: GitOpsSync; row: Row<GitOpsSync> })}+{#snippet AutoSyncCell({ value }: { value: any; item: GitOpsSync; row: ArcaneRow<GitOpsSync> })}<StatusBadge variant={value ? 'blue' : 'gray'} text={value ? m.common_enabled() : m.common_disabled()} />{/snippet}-{#snippet StatusCell({ value }: { value: any; item: GitOpsSync; row: Row<GitOpsSync> })}+{#snippet StatusCell({ value }: { value: any; item: GitOpsSync; row: ArcaneRow<GitOpsSync> })}{#if value === 'success'}<StatusBadge variant="green" text={m.common_success()} />{:else if value === 'failed'}@@ -230,7 +229,7 @@{/if}{/snippet}-{#snippet CommitCell({ value, item }: { value: any; item: GitOpsSync; row: Row<GitOpsSync> })}+{#snippet CommitCell({ value, item }: { value: any; item: GitOpsSync; row: ArcaneRow<GitOpsSync> })}{#if value}{@const commitUrl = item.repository?.url ? toGitCommitUrl(item.repository.url, String(value)) : null}<div class="flex items-center gap-1.5">@@ -254,7 +253,7 @@{/if}{/snippet}-{#snippet LastSyncCell({ value }: { value: any; item: GitOpsSync; row: Row<GitOpsSync> })}+{#snippet LastSyncCell({ value }: { value: any; item: GitOpsSync; row: ArcaneRow<GitOpsSync> })}<span class="text-sm">{value ? format(new Date(value), 'PP p') : m.common_never()}</span>{/snippet}diff --git a/frontend/src/routes/(app)/images/+page.svelte b/frontend/src/routes/(app)/images/+page.svelteindex dcb40bcd6..8c1c6ab22 100644--- a/frontend/src/routes/(app)/images/+page.svelte+++ b/frontend/src/routes/(app)/images/+page.svelte@@ -229,6 +229,7 @@bind:imagesbind:selectedIdsbind:requestOptions+ loading={imagesQuery.isLoading}onRefreshData={async (options) => {requestOptions = options;await Promise.all([imagesQuery.refetch(), imageUsageCountsQuery.refetch()]);diff --git a/frontend/src/routes/(app)/images/image-table.svelte b/frontend/src/routes/(app)/images/image-table.svelteindex 0ef76791e..c4c92cede 100644--- a/frontend/src/routes/(app)/images/image-table.svelte+++ b/frontend/src/routes/(app)/images/image-table.svelte@@ -48,13 +48,15 @@selectedIds = $bindable(),requestOptions = $bindable(),onImageUpdated,- onRefreshData+ onRefreshData,+ loading = false}: {images: Paginated<ImageSummaryDto>;selectedIds: string[];requestOptions: SearchPaginationSortRequest;onImageUpdated?: () => Promise<void>;onRefreshData?: (options: SearchPaginationSortRequest) => Promise<void>;+ loading?: boolean;} = $props();let isLoading = $state({@@ -717,6 +719,7 @@<ArcaneTablepersistKey="arcane-image-table"items={images}+ {loading}bind:requestOptionsbind:selectedIdsbind:mobileFieldVisibilitydiff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 718f9c36c..2efac8cef 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -111,9 +111,15 @@ importers:'@tanstack/svelte-query':specifier: ^6.1.33version: 6.1.33([email protected])+ '@tanstack/svelte-table':+ specifier: ^9.0.0-beta.1+ version: 9.0.0-beta.1([email protected])'@tanstack/table-core':- specifier: ^8.21.3- version: 8.21.3+ specifier: ^9.0.0-beta.1+ version: 9.0.0-beta.1+ '@tanstack/virtual-core':+ specifier: ^3.17.0+ version: 3.17.0'@uiw/codemirror-themes':specifier: ^4.25.10version: 4.25.10(@codemirror/[email protected])(@codemirror/[email protected])(@codemirror/[email protected])@@ -1295,6 +1301,9 @@ packages:'@tanstack/[email protected]':resolution: {integrity: sha512-g96SmSSQecYTYcyuAMRXr895GplJv01UGt7qttQWPOUyZ5EGz5tbRc589bMc2m5BsPFD6O0PCEAHdbDYNP6UBw==}+ '@tanstack/[email protected]':+ resolution: {integrity: sha512-WlzzCt3xi0G6pCAJu1U+2jiECwabETDpQDi3hfkFZvJii9AuZqEKbOiVarX1/bWhTNjU486yQtJCCasi/0q+Cw==}+'@tanstack/[email protected]':resolution: {integrity: sha512-y7Wa/hxqEHl+vSfphv7EJNkWheLmt7sFfB2bVzTxVt7PFdukL/4pKYqFX0tX2ORR00uNs4qMng4j3pn5moZ6Wg==}peerDependencies:@@ -1306,9 +1315,23 @@ packages:peerDependencies:svelte: ^5.25.0- '@tanstack/[email protected]':- resolution: {integrity: sha512-ldZXEhOBb8Is7xLs01fR3YEc3DERiz5silj8tnGkFZytt1abEvl/GhUmCE0PMLaMPTa3Jk4HbKmRlHmu+gCftg==}- engines: {node: '>=12'}+ '@tanstack/[email protected]':+ resolution: {integrity: sha512-XhXlU3jIO/WxikfeVczRdsAvRWzsLBh8Ic6sC7nzfzvMbPut7ZSdCbE7/usfm0bMjVGMmZmyzZy2xRu73QYWAA==}+ peerDependencies:+ svelte: ^5.0.0++ '@tanstack/[email protected]':+ resolution: {integrity: sha512-l6FCE2T4s4E+CsW1xFlILAqoktH3p4KpxJZvtEIes9ZaT/1O+ZPfP78MOFrrkxxMJH+zBrX5oehl6xPX7zXl4Q==}+ engines: {node: '>=16'}+ peerDependencies:+ svelte: ^5.0.0++ '@tanstack/[email protected]':+ resolution: {integrity: sha512-X2o30qijSwWnS0YpIKWk3xZqdvDw3y1mcOmxeiLqGkbevTvBtm7iv7IK8ZvHnXRu5hlcKuaGFjTF5Iri56+tkg==}+ engines: {node: '>=16'}++ '@tanstack/[email protected]':+ resolution: {integrity: sha512-gOxY/hFkPh/XQYhnThBHzkbkX3Ed+z/iushyz+R+JAr213aXxUDgQoTgTdrDpBSRsjFM73P/KfUyWmaF9WHMkQ==}'@tybys/[email protected]':resolution: {integrity: sha512-RoBvJ2X0wuKlWFIjrwffGw1IqZHKQqzIchKaadZZfnNpsAYp2mM0h36JtPCjNDAHGgYez/15uMBpfGwchhiMgg==}@@ -3645,6 +3668,8 @@ snapshots:'@tanstack/[email protected]': {}+ '@tanstack/[email protected]': {}+dependencies:'@tanstack/query-devtools': 5.100.14@@ -3657,7 +3682,22 @@ snapshots:'@tanstack/query-core': 5.100.14svelte: 5.56.1- '@tanstack/[email protected]': {}+ '@tanstack/[email protected]([email protected])':+ dependencies:+ '@tanstack/store': 0.11.0+ svelte: 5.56.1++ '@tanstack/[email protected]([email protected])':+ dependencies:+ '@tanstack/svelte-store': 0.12.0([email protected])+ '@tanstack/table-core': 9.0.0-beta.1+ svelte: 5.56.1++ '@tanstack/[email protected]':+ dependencies:+ '@tanstack/store': 0.11.0++ '@tanstack/[email protected]': {}'@tybys/[email protected]':dependencies:diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yamlindex 72e67f0c2..96d42a296 100644--- a/pnpm-workspace.yaml+++ b/pnpm-workspace.yaml@@ -46,3 +46,5 @@ minimumReleaseAgeExclude:- "@sveltejs/[email protected]"- "@sveltejs/[email protected]"+ - '@tanstack/[email protected]'+ - '@tanstack/[email protected]'diff --git a/tests/setup/gitops.setup.ts b/tests/setup/gitops.setup.tsindex ad881eb63..8f5e51a18 100644--- a/tests/setup/gitops.setup.ts+++ b/tests/setup/gitops.setup.ts@@ -154,7 +154,7 @@ setup('create gitops sync in arcane', async ({ page }) => {await page.waitForLoadState('load');// Find the sync row and trigger sync- const syncRow = page.locator('tr').filter({ hasText: GITOPS_SYNC_NAME });+ const syncRow = page.locator('tr').filter({ hasText: GITOPS_SYNC_NAME }).first();if ((await syncRow.count()) > 0) {// Look for sync button or menuconst syncButton = syncRow.getByRole('button', { name: /Sync|Sync Now/i });@@ -163,6 +163,7 @@ setup('create gitops sync in arcane', async ({ page }) => {if ((await syncButton.count()) > 0) {await syncButton.click();} else if ((await menuButton.count()) > 0) {+ await syncRow.hover();await menuButton.click();await page.waitForTimeout(300);const syncMenuItem = page.getByRole('menuitem', { name: /Sync/i });diff --git a/tests/spec/api-keys.spec.ts b/tests/spec/api-keys.spec.tsindex b11a42b49..9392de7f1 100644--- a/tests/spec/api-keys.spec.ts+++ b/tests/spec/api-keys.spec.ts@@ -1,5 +1,6 @@import { test, expect, type Page } from '@playwright/test';import { createTestApiKeys, deleteTestApiKeys } from '../utils/playwright.util';+import { openRowActionsMenu } from '../utils/table-actions.util';const API_KEYS_ROUTE = '/settings/api-keys';@@ -99,8 +100,8 @@ test.describe('API Keys Page', () => {const firstRow = page.locator('tbody tr').first();await expect(firstRow).toBeVisible();- await firstRow.getByRole('button', { name: 'Open menu' }).click();- await page.getByRole('menuitem', { name: 'Edit' }).click();+ const menu = await openRowActionsMenu(page, firstRow);+ await menu.getByRole('menuitem', { name: 'Edit' }).click();await expect(page.getByRole('dialog')).toBeVisible();await expect(page.getByText('Edit API Key')).toBeVisible();@@ -115,8 +116,8 @@ test.describe('API Keys Page', () => {const firstRow = page.locator('tbody tr').first();await expect(firstRow).toBeVisible();- await firstRow.getByRole('button', { name: 'Open menu' }).click();- await page.getByRole('menuitem', { name: 'Delete' }).click();+ const menu = await openRowActionsMenu(page, firstRow);+ await menu.getByRole('menuitem', { name: 'Delete' }).click();// Should show confirmation dialogawait expect(page.getByText(/Delete API Key/i)).toBeVisible();@@ -153,8 +154,8 @@ test.describe('API Keys Page', () => {const keyRow = page.locator(`tr:has-text("${apiKeyName}")`);await expect(keyRow).toBeVisible();- await keyRow.getByRole('button', { name: 'Open menu' }).click();- await page.getByRole('menuitem', { name: 'Delete' }).click();+ const menu = await openRowActionsMenu(page, keyRow);+ await menu.getByRole('menuitem', { name: 'Delete' }).click();// Confirm deletionawait expect(page.getByText(/Delete API Key/i)).toBeVisible();diff --git a/tests/spec/containers.spec.ts b/tests/spec/containers.spec.tsindex 1d30cb403..70f96f3c7 100644--- a/tests/spec/containers.spec.ts+++ b/tests/spec/containers.spec.ts@@ -1,6 +1,7 @@import { test, expect, type Page } from '@playwright/test';import { fetchContainersWithRetry, type Paginated } from '../utils/fetch.util';import { ContainerSummary } from 'types/containers.type';+import { openRowActionsMenu } from '../utils/table-actions.util';const CONTAINERS_ROUTE = '/containers';@@ -50,8 +51,8 @@ test.describe('Containers Page', () => {await navigateToContainers(page);const firstRow = page.locator('tbody tr').first();- await firstRow.getByRole('button', { name: 'Open menu' }).click();- await page.getByRole('menuitem', { name: 'Inspect', exact: true }).click();+ const menu = await openRowActionsMenu(page, firstRow);+ await menu.getByRole('menuitem', { name: 'Inspect', exact: true }).click();await expect(page).toHaveURL(/\/containers\/.+/);await expect(@@ -107,9 +108,9 @@ test.describe('Containers Page', () => {if (running) {const row = page.locator(`tr:has(a[href="/containers/${running.id}"])`);- await row.getByRole('button', { name: 'Open menu' }).click();- await expect(page.getByRole('menuitem', { name: 'Restart', exact: true })).toBeVisible();- await expect(page.getByRole('menuitem', { name: 'Stop', exact: true })).toBeVisible();+ const menu = await openRowActionsMenu(page, row);+ await expect(menu.getByRole('menuitem', { name: 'Restart', exact: true })).toBeVisible();+ await expect(menu.getByRole('menuitem', { name: 'Stop', exact: true })).toBeVisible();await page.keyboard.press('Escape');} else {test.info().annotations.push({@@ -120,8 +121,8 @@ test.describe('Containers Page', () => {if (stopped) {const row = page.locator(`tr:has(a[href="/containers/${stopped.id}"])`);- await row.getByRole('button', { name: 'Open menu' }).click();- await expect(page.getByRole('menuitem', { name: 'Start', exact: true })).toBeVisible();+ const menu = await openRowActionsMenu(page, row);+ await expect(menu.getByRole('menuitem', { name: 'Start', exact: true })).toBeVisible();await page.keyboard.press('Escape');} else {test.info().annotations.push({@@ -138,8 +139,8 @@ test.describe('Containers Page', () => {await navigateToContainers(page);const row = page.locator(`tr:has(a[href="/containers/${any.id}"])`);- await row.getByRole('button', { name: 'Open menu' }).click();- await page.getByRole('menuitem', { name: 'Remove', exact: true }).click();+ const menu = await openRowActionsMenu(page, row);+ await menu.getByRole('menuitem', { name: 'Remove', exact: true }).click();const dialog = page.locator('div[role="heading"][aria-level="2"][data-dialog-title]:has-text("Confirm Container Removal")'diff --git a/tests/spec/environment-settings.spec.ts b/tests/spec/environment-settings.spec.tsindex 19e2708c2..b53abb46f 100644--- a/tests/spec/environment-settings.spec.ts+++ b/tests/spec/environment-settings.spec.ts@@ -37,6 +37,7 @@ async function deleteEnvironmentViaUI(page: Page, environmentName: string) {return;}+ await envRow.hover();await envRow.getByRole('button', { name: /open menu/i }).click();await page.getByRole('menuitem', { name: 'Delete', exact: true }).click();await page.getByRole('button', { name: 'Remove', exact: true }).click();diff --git a/tests/spec/images.spec.ts b/tests/spec/images.spec.tsindex 96425690f..91acd59ad 100644--- a/tests/spec/images.spec.ts+++ b/tests/spec/images.spec.ts@@ -1,6 +1,7 @@import { test, expect, type Page } from '@playwright/test';import { fetchImageCountsWithRetry, fetchImagesWithRetry } from '../utils/fetch.util';import { ImageUsageCounts } from 'types/image.type';+import { openRowActionsMenu } from '../utils/table-actions.util';const ROUTES = {page: '/images',@@ -123,17 +124,17 @@ test.describe('Images Page', () => {await navigateToImages(page);const firstRow = page.locator('tbody tr').first();- await firstRow.getByRole('button', { name: 'Open menu' }).click();- await page.getByRole('menuitem', { name: 'Inspect' }).click();+ const menu = await openRowActionsMenu(page, firstRow);+ await menu.getByRole('menuitem', { name: 'Inspect' }).click();});test('should pull image from dropdown menu', async ({ page }) => {test.skip(!realImages.length, 'No images available for pull API test');await navigateToImages(page);- const firstRow = await page.getByRole('cell', { name: 'Open menu' }).first();- await firstRow.getByRole('button', { name: 'Open menu' }).click();- await page.getByRole('menuitem', { name: 'Pull' }).click();+ const firstRow = page.locator('tbody tr').first();+ const menu = await openRowActionsMenu(page, firstRow);+ await menu.getByRole('menuitem', { name: 'Pull' }).click();await page.waitForLoadState('load');@@ -152,8 +153,8 @@ test.describe('Images Page', () => {test.skip(!deleteableImage, 'No deletable images available');const firstRow = await page.getByRole('row', { name: 'ghcr.io/linuxserver/radarr' });- await firstRow.getByRole('button', { name: 'Open menu' }).click();- await page.getByRole('menuitem', { name: 'Remove' }).click();+ const menu = await openRowActionsMenu(page, firstRow);+ await menu.getByRole('menuitem', { name: 'Remove' }).click();await expect(page.locator(diff --git a/tests/spec/project.spec.ts b/tests/spec/project.spec.tsindex 3cdb0aaac..1cfdcf1cc 100644--- a/tests/spec/project.spec.ts+++ b/tests/spec/project.spec.ts@@ -43,6 +43,10 @@ async function getCodeMirrorValue(editor: Locator) {async function openDropdownMenu(page: Page, trigger: Locator) {await expect(trigger).toBeVisible();+ const row = trigger.locator('xpath=ancestor::tr[1]');+ if ((await row.count()) > 0) {+ await row.hover();+ }await trigger.click();const menu = page.locator('[data-slot="dropdown-menu-content"]:visible').last();diff --git a/tests/spec/registries.spec.ts b/tests/spec/registries.spec.tsindex 5346ccd5b..cec872cde 100644--- a/tests/spec/registries.spec.ts+++ b/tests/spec/registries.spec.ts@@ -1,4 +1,5 @@import { test, expect, type Page } from '@playwright/test';+import { openRowActionsMenu } from '../utils/table-actions.util';const route = '/customize/registries';const TOKEN = process.env.REGISTRY_TEST_TOKEN ?? 'e2e-token';@@ -168,8 +169,8 @@ test.describe('Container Registries', () => {await expect(row).toBeVisible();// Test Connection (accept either success or failure toast)- await row.getByRole('button', { name: 'Open menu' }).click();- await page.getByRole('menuitem', { name: 'Test Connection' }).click();+ const menu = await openRowActionsMenu(page, row);+ await menu.getByRole('menuitem', { name: 'Test Connection' }).click();});test('should open Remove Selected dialog and cancel (no mutation)', async ({ page }) => {diff --git a/tests/utils/table-actions.util.ts b/tests/utils/table-actions.util.tsnew file mode 100644index 000000000..d45ae7faa--- /dev/null+++ b/tests/utils/table-actions.util.ts@@ -0,0 +1,15 @@+import { expect, type Locator, type Page } from '@playwright/test';++export async function openRowActionsMenu(page: Page, row: Locator) {+ const targetRow = row.first();+ await expect(targetRow).toBeVisible();+ await targetRow.hover();++ const trigger = targetRow.getByRole('button', { name: /open menu/i }).first();+ await expect(trigger).toBeVisible();+ await trigger.click();++ const menu = page.locator('[data-slot="dropdown-menu-content"]:visible').last();+ await expect(menu).toBeVisible();+ return menu;+}