Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Canonicalize sortable table indicators

rcourtman3d77ac9cec60
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index 312995727d..5c22ecfc41 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -913,6 +913,12 @@ the shared `TableHead` primitive and expose column state through `aria-sort`;
the feature owner may define the sort keys and data comparator, but the header
interaction must update that canonical owner state rather than forking
table-local sort state or making header labels look clickable while inert.
+Sortable header direction presentation belongs to
+`frontend-modern/src/components/shared/tableSortPresentation.ts`. Inactive
+sortable columns stay visually quiet; only the active column renders its
+ascending or descending marker. Storage, Workloads, backup, and shared platform
+tables must consume that helper rather than repeating dormant up/down icons in
+every header or defining page-local direction glyphs.
Shared filter/search primitives may provide the common shell, keyboard behavior,
history, and reset mechanics, but the owning page or table must supply
@@ -2146,7 +2152,8 @@ default` instead of fusing provider and badge text such as
persists per table through `usePersistentSignal` storage keys; rows with
missing values sink to the bottom regardless of direction; headers expose
`aria-sort` and the arrow indicator consistent with the workloads table
- header; and header alignment stays on the canonical
+ header through the active-only `tableSortPresentation.ts` helper; and header
+ alignment stays on the canonical
`getPlatformTableHeadClassForKind` helpers from `columnAlignment.ts`. A
table's default order remains its page-model status-first compare until
the user selects a column, and grouped modes (for example Docker's
diff --git a/docs/release-control/v6/internal/subsystems/performance-and-scalability.md b/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
index ea78689178..314f942615 100644
--- a/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
+++ b/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
@@ -889,6 +889,10 @@ change may globally weaken the Task 03 lifecycle-state idempotency invariant.
the column label must remain present through an `sr-only` label so the
header row exposes names such as Uptime, Image, Context, and Node instead
of collapsing to only the visible text columns.
+ Sort-direction presentation must remain a constant-time shared helper call:
+ inactive headers render no repeated marker, while the active header consumes
+ `frontend-modern/src/components/shared/tableSortPresentation.ts`. It must not
+ add per-column state, measurement, or listeners to the workload hot path.
Inline detail table rows rendered from workload or infrastructure hot
paths must compose the frontend-primitives-owned
`InlineDetailTableRow` shell. Performance ownership remains on expansion
diff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.md
index e058cf9a23..ced30753ad 100644
--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md
+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md
@@ -3351,6 +3351,11 @@ storage-local raw `<select>` wrapper. Grouping, sort key, and sort direction are
durable presentation preferences, so `StoragePageControls` supplies them
through the frontend-primitives-owned `FilterBar.viewOptions` content boundary
instead of leaving them as permanent filter-rail controls.
+Sortable storage and Proxmox backup headers keep their real button and
+`aria-sort` semantics, but their visible direction marker must come from the
+frontend-primitives-owned `tableSortPresentation.ts` helper. Inactive columns
+must not repeat dormant up/down icons across the header row; only the active
+sort column displays its direction.
Recovery all-history, all-item-type, and all-platform defaults follow the same
shared filter-option contract through
`frontend-modern/src/utils/recoveryTablePresentation.ts`, so recovery history
diff --git a/frontend-modern/browser-verification.json b/frontend-modern/browser-verification.json
index aec12c73f9..405a4da6f7 100644
--- a/frontend-modern/browser-verification.json
+++ b/frontend-modern/browser-verification.json
@@ -1,28 +1,27 @@
{
"version": 1,
- "base_sha": "32b721503cc1bf75592baed55599c98e1c2aa896",
- "verified_at": "2026-08-24T15:58:26Z",
+ "base_sha": "e140ee207130c3e3be4997736429eccd7e987b53",
+ "verified_at": "2026-08-24T16:05:29Z",
"result": "passed",
"changed_paths": [
- "frontend-modern/src/components/Infrastructure/ResourceDetailDrawer.tsx",
- "frontend-modern/src/components/Storage/DiskDetail.tsx",
- "frontend-modern/src/components/Storage/StoragePoolDetail.tsx",
- "frontend-modern/src/features/storageBackups/detailPresentation.ts"
+ "frontend-modern/src/components/Storage/StoragePoolsTable.tsx",
+ "frontend-modern/src/components/Workloads/WorkloadTableHeader.tsx",
+ "frontend-modern/src/components/shared/tableSortPresentation.ts",
+ "frontend-modern/src/features/platformPage/sharedPlatformPage.tsx",
+ "frontend-modern/src/features/proxmox/proxmoxBackupsTableShared.tsx"
],
"content_sha256": {
- "frontend-modern/src/components/Infrastructure/ResourceDetailDrawer.tsx": "5eb9c0f3293e10771e1c68c91e61030046c1999a12d007ffcd45a1e345306fc2",
- "frontend-modern/src/components/Storage/DiskDetail.tsx": "f9c0574b3437b4dfe81585aecdbfed441dbeef32f066022a0fc3dd5aa5719991",
- "frontend-modern/src/components/Storage/StoragePoolDetail.tsx": "f678e7339627759d82cd78e50c3afad8857203ff5f8f196c4676277c5b613d29",
- "frontend-modern/src/features/storageBackups/detailPresentation.ts": "5a179856f2f0fe148034abc8c3360b598eab89084871a923e8d8918754dc3187"
+ "frontend-modern/src/components/Storage/StoragePoolsTable.tsx": "a2dc17b6c7531c95bc52a4f20bc34e2d9157a87647b5ae20fc7fb5113b0ca5ec",
+ "frontend-modern/src/components/Workloads/WorkloadTableHeader.tsx": "bfc35a4200e6d7bd6bb26a660f3c316fe84e1b9f7a80cb43fd4a3869ce8144e8",
+ "frontend-modern/src/components/shared/tableSortPresentation.ts": "85dbad24387cc0f9909c65dc65694df4feba3dc80781398961be6548069ba4d9",
+ "frontend-modern/src/features/platformPage/sharedPlatformPage.tsx": "504400c889c59cd33f66df8be9ef92f047fa8a74765f86b893445b6fbb9ded66",
+ "frontend-modern/src/features/proxmox/proxmoxBackupsTableShared.tsx": "e5b2dd95865854d8755f4dd2e8f70e89763d35600b5f0029a9a90f8a2d90eb04"
},
- "routes": [
- "/proxmox/overview",
- "/proxmox/storage"
- ],
+ "routes": ["/proxmox/storage", "/proxmox/backups/date", "/proxmox/overview"],
"viewports": [
{
"width": 1280,
- "height": 800
+ "height": 720
},
{
"width": 390,
@@ -30,16 +29,17 @@
}
],
"states": [
- "Proxmox node detail opening on Overview with History inactive at 1280px",
- "storage-pool detail opening on Overview with configuration and ZFS facts visible at 390px",
- "storage-pool History selected with its capacity chart and trailing range control at desktop and 390px",
- "physical-disk detail opening on Overview and switching to History with live and stored I/O charts at 390px"
+ "Proxmox Storage table with no visible marker when its default sorted column is hidden",
+ "Proxmox Storage table with Usage selected as the active descending sort",
+ "compact mobile Storage table with Used as the sole active descending sort",
+ "Proxmox backup table with Created as its sole active descending sort",
+ "Proxmox overview node, workload, and storage headers using the shared active-only marker"
],
"interactions": [
- "opened a storage pool and confirmed historical content and range controls are absent from the default Overview tab",
- "selected storage-pool History and confirmed the range control and Capacity Trend appear together without clipping",
- "switched to Physical Disks, opened a disk, and confirmed the same Overview-to-History interaction and trailing range placement",
- "compared the storage detail tab framing with an expanded Proxmox node drawer at 1280px",
- "reset the temporary responsive viewport override after completing the phone-width checks"
+ "clicked the desktop Storage Usage header and confirmed only Usage displayed a descending marker with aria-sort descending",
+ "inspected the compact mobile Storage table and confirmed only Used displayed its persisted descending marker while the page remained contained to 390 pixels",
+ "inspected the Proxmox backup table and confirmed only the active Created column displayed a direction marker",
+ "inspected Proxmox overview table headers and confirmed only the active workload Type column displayed a direction marker",
+ "confirmed inactive sortable headers remained clickable and clearly labelled without dormant up/down icons"
]
}
diff --git a/frontend-modern/src/components/Storage/StoragePoolsTable.tsx b/frontend-modern/src/components/Storage/StoragePoolsTable.tsx
index 2e5daf4141..67ed272f63 100644
--- a/frontend-modern/src/components/Storage/StoragePoolsTable.tsx
+++ b/frontend-modern/src/components/Storage/StoragePoolsTable.tsx
@@ -1,7 +1,4 @@
import { Component, For, Show, createMemo } from 'solid-js';
-import ArrowDownIcon from 'lucide-solid/icons/arrow-down';
-import ArrowUpIcon from 'lucide-solid/icons/arrow-up';
-import ArrowUpDownIcon from 'lucide-solid/icons/arrow-up-down';
import {
Table,
TableBody,
@@ -10,6 +7,7 @@ import {
TableHeader,
TableRow,
} from '@/components/shared/Table';
+import { getTableSortIndicator } from '@/components/shared/tableSortPresentation';
import { getPlatformTableHeadClassForKind } from '@/features/platformPage/sharedPlatformPage';
import {
getStoragePoolColumnWidthPercent,
@@ -69,7 +67,6 @@ type StoragePoolsTableProps = {
const STORAGE_POOL_HEADER_SORT_BUTTON_CLASS =
'inline-flex min-w-0 max-w-full items-center gap-1 rounded-sm text-left outline-none transition-colors hover:text-base-content focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-1 focus-visible:ring-offset-surface';
-const STORAGE_POOL_HEADER_SORT_ICON_CLASS = 'h-3 w-3 shrink-0';
const getNextStorageColumnSortDirection = (
currentSortKey: StorageSortKey,
@@ -195,30 +192,10 @@ export const StoragePoolsTable: Component<StoragePoolsTableProps> = (props) => {
>
<span class="min-w-0 truncate">{column.label}</span>
</Show>
- <Show
- when={props.sortKey === column.sortKey}
- fallback={
- <ArrowUpDownIcon
- aria-hidden="true"
- class={`${STORAGE_POOL_HEADER_SORT_ICON_CLASS} text-muted/70`}
- />
- }
- >
- <Show
- when={props.sortDirection === 'asc'}
- fallback={
- <ArrowDownIcon
- aria-hidden="true"
- class={`${STORAGE_POOL_HEADER_SORT_ICON_CLASS} text-base-content`}
- />
- }
- >
- <ArrowUpIcon
- aria-hidden="true"
- class={`${STORAGE_POOL_HEADER_SORT_ICON_CLASS} text-base-content`}
- />
- </Show>
- </Show>
+ {getTableSortIndicator(
+ props.sortKey === column.sortKey,
+ props.sortDirection,
+ )}
</button>
</TableHead>
)}
diff --git a/frontend-modern/src/components/Storage/__tests__/Storage.test.tsx b/frontend-modern/src/components/Storage/__tests__/Storage.test.tsx
index 96a2506ebc..d300d25c3c 100644
--- a/frontend-modern/src/components/Storage/__tests__/Storage.test.tsx
+++ b/frontend-modern/src/components/Storage/__tests__/Storage.test.tsx
@@ -594,8 +594,15 @@ describe('Storage', () => {
).toBe(true);
const usageHeader = screen.getByRole('columnheader', { name: 'Usage' });
+ const sortableHeaderButtons = screen.getAllByRole('button', { name: /^Sort .* column/ });
+ expect(within(usageHeader).getByRole('button')).not.toHaveTextContent(/[▲▼]/);
+
fireEvent.click(within(usageHeader).getByRole('button', { name: 'Sort Usage column' }));
expect(usageHeader).toHaveAttribute('aria-sort', 'descending');
+ expect(within(usageHeader).getByRole('button')).toHaveTextContent('▼');
+ expect(
+ sortableHeaderButtons.filter((button) => /[▲▼]/.test(button.textContent ?? '')),
+ ).toHaveLength(1);
const viewOptions = openStorageViewOptions();
expect((within(viewOptions).getByLabelText('Sort by') as HTMLSelectElement).value).toBe(
'usage',
diff --git a/frontend-modern/src/components/Workloads/WorkloadTableHeader.tsx b/frontend-modern/src/components/Workloads/WorkloadTableHeader.tsx
index d9807a5339..2c752775ae 100644
--- a/frontend-modern/src/components/Workloads/WorkloadTableHeader.tsx
+++ b/frontend-modern/src/components/Workloads/WorkloadTableHeader.tsx
@@ -1,6 +1,7 @@
import { For } from 'solid-js';
import { TableHead, TableHeader, TableRow } from '@/components/shared/Table';
+import { getTableSortIndicator } from '@/components/shared/tableSortPresentation';
import {
getPlatformColumnAlign,
type PlatformTableColumnKind,
@@ -114,7 +115,7 @@ export function WorkloadTableHeader(props: WorkloadTableHeaderProps) {
) : (
label()
)}
- {isSorted() && (props.sortDirection() === 'asc' ? ' ▲' : ' ▼')}
+ {getTableSortIndicator(Boolean(isSorted()), props.sortDirection())}
</div>
</TableHead>
);
diff --git a/frontend-modern/src/components/Workloads/__tests__/WorkloadsSurface.performance.contract.test.tsx b/frontend-modern/src/components/Workloads/__tests__/WorkloadsSurface.performance.contract.test.tsx
index df9dcbad40..57d2f14e2e 100644
--- a/frontend-modern/src/components/Workloads/__tests__/WorkloadsSurface.performance.contract.test.tsx
+++ b/frontend-modern/src/components/Workloads/__tests__/WorkloadsSurface.performance.contract.test.tsx
@@ -1655,6 +1655,7 @@ describe('Workloads performance contract', () => {
expect(workloadsWorkloadTableSource).not.toContain('GuestDrawer');
expect(workloadTableHeaderSource).toContain('TableHead');
expect(workloadTableHeaderSource).toContain('col.sortKey as WorkloadSortKey');
+ expect(workloadTableHeaderSource).toContain('getTableSortIndicator');
expect(workloadTableHeaderSource).toContain('style={getGuestColumnStyle(');
expect(workloadTableHeaderSource).toContain('props.workloadTableLayoutMode()');
expect(workloadTableHeaderSource).toContain('props.workloadTableVisibleColumnIds()');
diff --git a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
index 3628fbdcc0..2258977859 100644
--- a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
+++ b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
@@ -87,6 +87,7 @@ import summaryCardInteractionSource from '@/components/shared/summaryCardInterac
import summaryRowActionButtonSource from '@/components/shared/SummaryRowActionButton.tsx?raw';
import summaryInteractionA11ySource from '@/components/shared/summaryInteractionA11y.ts?raw';
import tableSource from '@/components/shared/Table.tsx?raw';
+import tableSortPresentationSource from '@/components/shared/tableSortPresentation.ts?raw';
import tableCardHeaderSource from '@/components/shared/TableCardHeader.tsx?raw';
import summaryTableFocusSource from '@/components/shared/summaryTableFocus.ts?raw';
import tableCardSource from '@/components/shared/TableCard.tsx?raw';
@@ -174,6 +175,7 @@ import guestDrawerHistorySource from '@/components/Workloads/GuestDrawerHistory.
import nodeDrawerSource from '@/components/Workloads/NodeDrawer.tsx?raw';
import workloadsSurfaceSource from '@/components/Workloads/WorkloadsSurface.tsx?raw';
import workloadsTableSource from '@/components/Workloads/WorkloadsTable.tsx?raw';
+import workloadTableHeaderSource from '@/components/Workloads/WorkloadTableHeader.tsx?raw';
import workloadPanelSource from '@/components/Workloads/WorkloadPanel.tsx?raw';
import guestRowStateSource from '@/components/Workloads/useGuestRowState.ts?raw';
import workloadSelectionStateSource from '@/components/Workloads/useWorkloadSelectionState.ts?raw';
@@ -1447,6 +1449,25 @@ describe('shared primitive guardrails', () => {
expect(userAssignmentsPanelSource.match(/frame="flush"/g) ?? []).toHaveLength(1);
});
+ it('keeps sortable table direction markers active-only and shared', () => {
+ expect(tableSortPresentationSource).toContain('export function getTableSortIndicator');
+ expect(tableSortPresentationSource).toContain('if (!active) return null');
+
+ for (const source of [
+ sharedPlatformPageSource,
+ workloadTableHeaderSource,
+ storagePoolsTableSource,
+ proxmoxBackupsTableSharedSource,
+ ]) {
+ expect(source).toContain('getTableSortIndicator');
+ }
+
+ for (const source of [storagePoolsTableSource, proxmoxBackupsTableSharedSource]) {
+ expect(source).not.toContain('ArrowUpDownIcon');
+ expect(source).not.toContain('SORT_ICON_CLASS');
+ }
+ });
+
it('keeps chart visibility display actions on the shared toolbar toggle', () => {
const registry = JSON.parse(sharedTemplateRegistrySource) as {
rules?: Array<{
diff --git a/frontend-modern/src/components/shared/__tests__/tableSortPresentation.test.ts b/frontend-modern/src/components/shared/__tests__/tableSortPresentation.test.ts
new file mode 100644
index 0000000000..44b60be185
--- /dev/null
+++ b/frontend-modern/src/components/shared/__tests__/tableSortPresentation.test.ts
@@ -0,0 +1,14 @@
+import { describe, expect, it } from 'vitest';
+import { getTableSortIndicator } from '@/components/shared/tableSortPresentation';
+
+describe('getTableSortIndicator', () => {
+ it('keeps inactive sortable headers visually quiet', () => {
+ expect(getTableSortIndicator(false, 'asc')).toBeNull();
+ expect(getTableSortIndicator(false, 'desc')).toBeNull();
+ });
+
+ it('shows only the active direction', () => {
+ expect(getTableSortIndicator(true, 'asc')).toBe('▲');
+ expect(getTableSortIndicator(true, 'desc')).toBe('▼');
+ });
+});
diff --git a/frontend-modern/src/components/shared/tableSortPresentation.ts b/frontend-modern/src/components/shared/tableSortPresentation.ts
new file mode 100644
index 0000000000..3324126c6d
--- /dev/null
+++ b/frontend-modern/src/components/shared/tableSortPresentation.ts
@@ -0,0 +1,16 @@
+export type TableSortDirection = 'asc' | 'desc';
+
+/**
+ * Canonical visual sort marker for table headers.
+ *
+ * Inactive headers remain discoverable through their button semantics instead
+ * of repeating a dormant icon in every column. Only the active column needs a
+ * direction marker.
+ */
+export function getTableSortIndicator(
+ active: boolean,
+ direction: TableSortDirection,
+): '▲' | '▼' | null {
+ if (!active) return null;
+ return direction === 'asc' ? '▲' : '▼';
+}
diff --git a/frontend-modern/src/features/platformPage/sharedPlatformPage.tsx b/frontend-modern/src/features/platformPage/sharedPlatformPage.tsx
index 6296b94b3e..17149dd301 100644
--- a/frontend-modern/src/features/platformPage/sharedPlatformPage.tsx
+++ b/frontend-modern/src/features/platformPage/sharedPlatformPage.tsx
@@ -23,6 +23,7 @@ import { FilterBar, filterChipStatusDot, type FilterDef } from '@/components/sha
import { FilterSegmentedControl } from '@/components/shared/FilterToolbar';
import { type SearchInputProps, type SearchInputSuggestion } from '@/components/shared/SearchInput';
import { Table, TableBody, TableHead, TableHeader, TableRow } from '@/components/shared/Table';
+import { getTableSortIndicator } from '@/components/shared/tableSortPresentation';
import { TableCard } from '@/components/shared/TableCard';
import { TableCardHeader } from '@/components/shared/TableCardHeader';
import { useActiveHorizontalRailItemVisibility } from '@/components/shared/useActiveHorizontalRailItemVisibility';
@@ -573,7 +574,7 @@ export function PlatformSortableTableHead<SortKey extends string>(props: {
onClick={handleClick}
>
{props.children}
- {isSorted() && (props.sort.sortDirection() === 'asc' ? ' ▲' : ' ▼')}
+ {isSorted() ? ` ${getTableSortIndicator(true, props.sort.sortDirection())}` : null}
</TableHead>
);
}
diff --git a/frontend-modern/src/features/proxmox/__tests__/proxmoxBackupsTableShared.test.tsx b/frontend-modern/src/features/proxmox/__tests__/proxmoxBackupsTableShared.test.tsx
index 729df7b985..8785d393c4 100644
--- a/frontend-modern/src/features/proxmox/__tests__/proxmoxBackupsTableShared.test.tsx
+++ b/frontend-modern/src/features/proxmox/__tests__/proxmoxBackupsTableShared.test.tsx
@@ -89,6 +89,12 @@ describe('proxmoxBackupsTableShared', () => {
expect(proxmoxBackupsTableSharedSource).toContain('PlatformTableRelativeTimeValue');
expect(proxmoxBackupsTableSharedSource).not.toContain('formatRelativeTime(');
});
+
+ it('keeps backup sort headers on the shared active-only indicator', () => {
+ expect(proxmoxBackupsTableSharedSource).toContain('getTableSortIndicator');
+ expect(proxmoxBackupsTableSharedSource).not.toContain('ArrowUpDownIcon');
+ expect(proxmoxBackupsTableSharedSource).not.toContain('SORT_ICON_CLASS');
+ });
});
function artifact(overrides: Partial<RecoverableArtifact> = {}): RecoverableArtifact {
diff --git a/frontend-modern/src/features/proxmox/proxmoxBackupsTableShared.tsx b/frontend-modern/src/features/proxmox/proxmoxBackupsTableShared.tsx
index 8b791a0e5e..3600340ea6 100644
--- a/frontend-modern/src/features/proxmox/proxmoxBackupsTableShared.tsx
+++ b/frontend-modern/src/features/proxmox/proxmoxBackupsTableShared.tsx
@@ -1,12 +1,10 @@
-import { Show, type Accessor } from 'solid-js';
-import ArrowDownIcon from 'lucide-solid/icons/arrow-down';
-import ArrowUpIcon from 'lucide-solid/icons/arrow-up';
-import ArrowUpDownIcon from 'lucide-solid/icons/arrow-up-down';
+import type { Accessor } from 'solid-js';
import { filterChipStatusDot } from '@/components/shared/FilterBar';
import { type FilterOption } from '@/components/shared/FilterButtonGroup';
import { MetadataBadge } from '@/components/shared/MetadataBadge';
import { ProgressBar } from '@/components/shared/ProgressBar';
import { TableHead } from '@/components/shared/Table';
+import { getTableSortIndicator } from '@/components/shared/tableSortPresentation';
import { WorkloadTypeBadge as SharedWorkloadTypeBadge } from '@/components/shared/WorkloadTypeBadge';
import { PlatformTableRelativeTimeValue } from '@/features/platformPage/sharedPlatformPage';
@@ -334,13 +332,11 @@ export function ProxmoxBackupWorkloadTypeBadge(props: {
);
}
-// Sortable column header — matches Storage's pattern (StoragePoolsTable.tsx).
+// Sortable column header — matches the shared active-only table pattern.
// Clicking an inactive column sorts it with the supplied default direction;
-// clicking the active column flips direction. Renders the idle / asc / desc
-// arrow trio so the affordance reads identically across the app.
+// clicking the active column flips direction.
const SORT_BUTTON_CLASS =
'inline-flex min-w-0 max-w-full items-center gap-1 rounded-sm outline-none transition-colors hover:text-base-content focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-1 focus-visible:ring-offset-surface';
-const SORT_ICON_CLASS = 'h-3 w-3 shrink-0';
export function SortableHead<K extends string>(props: {
label: string;
@@ -376,21 +372,7 @@ export function SortableHead<K extends string>(props: {
title={ariaLabel()}
>
<span class="min-w-0 truncate">{props.label}</span>
- <Show
- when={isActive()}
- fallback={
- <ArrowUpDownIcon class={`${SORT_ICON_CLASS} text-muted/70`} aria-hidden="true" />
- }
- >
- <Show
- when={props.direction() === 'asc'}
- fallback={
- <ArrowDownIcon class={`${SORT_ICON_CLASS} text-base-content`} aria-hidden="true" />
- }
- >
- <ArrowUpIcon class={`${SORT_ICON_CLASS} text-base-content`} aria-hidden="true" />
- </Show>
- </Show>
+ {getTableSortIndicator(isActive(), props.direction())}
</button>
</TableHead>
);