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.
Go aialertsdashboarddockerdocker-monitoringgohomelabinfrastructure-monitoringkubernetesmonitoringmspproxmoxproxmox-backup-serverproxmox-mail-gatewayproxmox-veself-hostedtruenastypescriptvspherewebhooks
Fix workloads filter action wrapping
rcourtmand4896c8a9fa6
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.mdindex 7bfa762a4b..ecd450e36f 100644--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md@@ -334,10 +334,12 @@ work extends shared components instead of creating new local variants.`List` visible labels, tooltip titles, and icons instead of each resourcesurface rebuilding that language with subtly different resource-specificconcepts. Shared- `PageControls` owns trailing filter-row actions such as utility buttons,- Columns, and Reset; those controls must stay grouped at the row end when- dense toolbars wrap so popovers remain viewport-safe instead of drifting- off-screen from page-local flex behavior. Shared `FilterToolbarPanel` owns+ `PageControls` owns trailing filter-row actions such as toolbar display+ controls, utility buttons, Columns, and Reset. Controls that should wrap+ with the column/reset cluster must enter through `toolbarTrailing` instead+ of staying as loose filter-row children, and those controls must stay+ grouped when dense toolbars wrap so popovers remain viewport-safe instead of+ drifting off-screen from page-local flex behavior. Shared `FilterToolbarPanel` ownsdefault filter-popover geometry, while narrow consumers such as`ColumnPicker` must opt into their panel width through that primitive ratherthan layering competing width classes page by page.diff --git a/docs/release-control/v6/internal/subsystems/performance-and-scalability.md b/docs/release-control/v6/internal/subsystems/performance-and-scalability.mdindex d48d22abec..e048361e76 100644--- a/docs/release-control/v6/internal/subsystems/performance-and-scalability.md+++ b/docs/release-control/v6/internal/subsystems/performance-and-scalability.md@@ -825,7 +825,11 @@ grouped/list selector instead of reintroducing local `Group By` casing orplatform-specific cluster wording. Dense workload toolbar variants must keepthat same row wrap-capable so optional runtime, chart, column, and resetcontrols remain reachable on desktop instead of forcing a single no-wrap row-that clips trailing actions.+that clips trailing actions. The workload shell must route table display+actions such as grouped/list mode and chart visibility through+`PageControls.toolbarTrailing`, leaving route/filter selects as primary toolbar+children so the display-action cluster wraps together with Columns/Reset across+narrow desktop widths.The Workloads-owned filter-config assembly now lives in`frontend-modern/src/components/Workloads/useWorkloadsState.ts`, so futurefilter runtime changes must extend through those owners instead ofdiff --git a/frontend-modern/src/components/Workloads/WorkloadsFilter.tsx b/frontend-modern/src/components/Workloads/WorkloadsFilter.tsxindex f5f57f9228..9c1b2ca096 100644--- a/frontend-modern/src/components/Workloads/WorkloadsFilter.tsx+++ b/frontend-modern/src/components/Workloads/WorkloadsFilter.tsx@@ -46,7 +46,7 @@ export const WorkloadsFilter: Component<WorkloadsFilterProps> = (props) => {show: showReset(),onClick: resetFilters,title: 'Reset all filters',- class: 'ml-auto text-base-content',+ class: 'text-base-content',icon: (<svgwidth="12"@@ -64,6 +64,43 @@ export const WorkloadsFilter: Component<WorkloadsFilterProps> = (props) => {),}}showFilters={showToolbarFilters()}+ toolbarTrailing={+ <>+ <GroupedTableModeSegmentedControl+ value={props.groupingMode()}+ onChange={props.setGroupingMode}+ />++ <Show when={props.onChartsToggle}>+ <FilterSegmentedControl+ class="hidden lg:inline-flex"+ value={props.chartsCollapsed?.() ? 'hidden' : 'shown'}+ onChange={() => props.onChartsToggle?.()}+ aria-label="Charts"+ options={[+ {+ value: 'shown',+ title: props.chartsCollapsed?.() ? 'Show charts' : 'Hide charts',+ label: (+ <>+ <svg+ class="w-3 h-3"+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ stroke-width="2"+ >+ <polyline points="22 12 18 12 15 21 9 3 6 12 2 12" />+ </svg>+ Charts+ </>+ ),+ },+ ]}+ />+ </Show>+ </>+ }><Show when={props.hostFilter}>{(hostFilter) => (@@ -168,41 +205,6 @@ export const WorkloadsFilter: Component<WorkloadsFilterProps> = (props) => {<option value="degraded">Degraded</option><option value="stopped">Stopped</option></LabeledFilterSelect>-- <GroupedTableModeSegmentedControl- value={props.groupingMode()}- onChange={props.setGroupingMode}- />-- <Show when={props.onChartsToggle}>- <FilterSegmentedControl- class="hidden lg:inline-flex"- value={props.chartsCollapsed?.() ? 'hidden' : 'shown'}- onChange={() => props.onChartsToggle?.()}- aria-label="Charts"- options={[- {- value: 'shown',- title: props.chartsCollapsed?.() ? 'Show charts' : 'Hide charts',- label: (- <>- <svg- class="w-3 h-3"- viewBox="0 0 24 24"- fill="none"- stroke="currentColor"- stroke-width="2"- >- <polyline points="22 12 18 12 15 21 9 3 6 12 2 12" />- </svg>- Charts- </>- ),- },- ]}- />- </Show>-</PageControls></Card>);diff --git a/frontend-modern/src/components/Workloads/__tests__/WorkloadsFilter.test.tsx b/frontend-modern/src/components/Workloads/__tests__/WorkloadsFilter.test.tsxindex 4f8264bbf3..ec0579a5af 100644--- a/frontend-modern/src/components/Workloads/__tests__/WorkloadsFilter.test.tsx+++ b/frontend-modern/src/components/Workloads/__tests__/WorkloadsFilter.test.tsx@@ -2,10 +2,7 @@ import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';import { render, screen, cleanup, fireEvent } from '@solidjs/testing-library';import { createSignal } from 'solid-js';import { WorkloadsFilter } from '../WorkloadsFilter';-import {- DEFAULT_WORKLOADS_SORT_KEY,- type WorkloadsFilterProps,-} from '../workloadsFilterModel';+import { DEFAULT_WORKLOADS_SORT_KEY, type WorkloadsFilterProps } from '../workloadsFilterModel';// Mock useBreakpoint — hoist so tests can control isMobileconst { isMobileMock } = vi.hoisted(() => {@@ -143,6 +140,11 @@ describe('WorkloadsFilter', () => {const { container } = render(() => <WorkloadsFilter {...props} />);expect(screen.getByTestId('column-picker')).toBeInTheDocument();+ const toolbarActions = container.querySelector('.page-controls-toolbar-actions');+ expect(toolbarActions).not.toBeNull();+ expect(toolbarActions!).toContainElement(screen.getByText('Grouped'));+ expect(toolbarActions!).toContainElement(screen.getByText('List'));+ expect(toolbarActions!).toContainElement(screen.getByTestId('column-picker'));expect(Array.from(container.querySelectorAll('.workloads-filter *')).some((element) =>(element.getAttribute('class') ?? '').includes('lg:flex-nowrap'),diff --git a/frontend-modern/src/components/shared/PageControls.test.tsx b/frontend-modern/src/components/shared/PageControls.test.tsxindex 3dc34f4ea8..08c831f93f 100644--- a/frontend-modern/src/components/shared/PageControls.test.tsx+++ b/frontend-modern/src/components/shared/PageControls.test.tsx@@ -35,7 +35,7 @@ describe('PageControls', () => {const resetButton = screen.getByRole('button', { name: /reset all/i });expect(columnsButton).toBeInTheDocument();expect(resetButton).toBeInTheDocument();- const trailingActions = columnsButton.closest('.ml-auto');+ const trailingActions = columnsButton.closest('.page-controls-toolbar-actions');expect(trailingActions).not.toBeNull();expect(trailingActions!).toContainElement(resetButton);@@ -83,4 +83,33 @@ describe('PageControls', () => {expect(screen.getAllByTestId('scope-slot')).toHaveLength(1);expect(screen.getByTestId('scope-slot')).toHaveTextContent('mobile scope');});++ it('keeps toolbar trailing actions grouped with columns in collapsed filter layouts', () => {+ render(() => (+ <PageControls+ search={<div data-testid="search">Search</div>}+ showFilters={true}+ mobileFilters={{ enabled: true, count: 1, onToggle: vi.fn() }}+ toolbarTrailing={<div data-testid="toolbar-trailing">Grouped List</div>}+ columnVisibility={{+ availableToggles: () => [{ id: 'subject', label: 'Subject' }],+ isHiddenByUser: () => false,+ toggle: vi.fn(),+ resetToDefaults: vi.fn(),+ }}+ utilityActions={<div data-testid="desktop-utility">Desktop utility</div>}+ >+ <div>Filters</div>+ </PageControls>+ ));++ const trailing = screen.getByTestId('toolbar-trailing');+ const columnsButton = screen.getByRole('button', { name: /columns/i });+ const trailingActions = columnsButton.closest('.page-controls-toolbar-actions');++ expect(trailingActions).not.toBeNull();+ expect(trailingActions!).toContainElement(trailing);+ expect(trailingActions!).toContainElement(columnsButton);+ expect(screen.queryByTestId('desktop-utility')).not.toBeInTheDocument();+ });});diff --git a/frontend-modern/src/components/shared/PageControls.tsx b/frontend-modern/src/components/shared/PageControls.tsxindex c6670755ae..0a0d1a4a60 100644--- a/frontend-modern/src/components/shared/PageControls.tsx+++ b/frontend-modern/src/components/shared/PageControls.tsx@@ -39,6 +39,7 @@ interface PageControlsProps extends JSX.HTMLAttributes<HTMLDivElement> {contentClass?: string;searchRowClass?: string;toolbarClass?: string;+ toolbarTrailing?: JSX.Element;mobileRowClass?: string;mobileLeading?: JSX.Element;mobileTrailing?: JSX.Element;@@ -58,6 +59,7 @@ export const PageControls: Component<PageControlsProps> = (props) => {'contentClass','searchRowClass','toolbarClass',+ 'toolbarTrailing','mobileRowClass','mobileLeading','mobileTrailing',@@ -83,7 +85,12 @@ export const PageControls: Component<PageControlsProps> = (props) => {Boolean(local.columnVisibility && local.columnVisibility.availableToggles().length > 0);const showResetAction = () => local.resetAction?.show === true;const hasTrailingActions = () =>- Boolean(activeUtilityActions() || showColumnVisibility() || showResetAction());+ Boolean(+ local.toolbarTrailing ||+ activeUtilityActions() ||+ showColumnVisibility() ||+ showResetAction(),+ );return (<FilterHeader@@ -103,7 +110,9 @@ export const PageControls: Component<PageControlsProps> = (props) => {{local.children}<Show when={hasTrailingActions()}>- <div class="ml-auto inline-flex flex-wrap items-center gap-2">+ <div class="page-controls-toolbar-actions inline-flex flex-wrap items-center gap-2 2xl:ml-auto">+ <Show when={local.toolbarTrailing}>{local.toolbarTrailing}</Show>+<Show when={activeUtilityActions()}><FilterDivider />{activeUtilityActions()}