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
Migrate filter sections to chip-based FilterBar
rcourtman2a9234f2b04f
diff --git a/frontend-modern/src/components/Recovery/RecoveryHistorySection.tsx b/frontend-modern/src/components/Recovery/RecoveryHistorySection.tsxindex 208d616d3a..7a1aa4a5e6 100644--- a/frontend-modern/src/components/Recovery/RecoveryHistorySection.tsx+++ b/frontend-modern/src/components/Recovery/RecoveryHistorySection.tsx@@ -1,28 +1,15 @@-import { For, Show, createMemo } from 'solid-js';+import { Show, createMemo } from 'solid-js';import type { Accessor, Component } from 'solid-js';-import { Card } from '@/components/shared/Card';-import {- FilterActionButton,- FilterToolbarPanel,- LabeledFilterSelect,- LabeledFilterToggleGroup,- filterPanelDescriptionClass,- filterPanelTitleClass,- filterUtilityBadgeClass,-} from '@/components/shared/FilterToolbar';-import { PageControls } from '@/components/shared/PageControls';-import { SearchInput } from '@/components/shared/SearchInput';+import { ColumnPicker } from '@/components/shared/ColumnPicker';+import { FilterBar, type FilterDef } from '@/components/shared/FilterBar';import { TableCard } from '@/components/shared/TableCard';import { TableCardHeader } from '@/components/shared/TableCardHeader';import type { ColumnDef } from '@/hooks/useColumnVisibility';import { STORAGE_KEYS } from '@/utils/localStorage';import type { RecoveryOutcome, RecoveryPoint } from '@/types/recovery';import type { Resource } from '@/types/resource';-import {- getRecoveryBreadcrumbLinkClass,- getRecoveryFilterPanelClearClass,-} from '@/utils/recoveryActionPresentation';+import { getRecoveryBreadcrumbLinkClass } from '@/utils/recoveryActionPresentation';import {getRecoveryArtifactModePresentation,type RecoveryArtifactMode,@@ -43,8 +30,6 @@ import {getRecoveryAllPlatformsLabel,getRecoveryHistorySearchPlaceholder,getRecoverySearchHistoryEmptyMessage,- RECOVERY_ADVANCED_FILTER_FIELD_CLASS,- RECOVERY_ADVANCED_FILTER_LABEL_CLASS,} from '@/utils/recoveryTablePresentation';import { titleCaseDelimitedLabel } from '@/utils/textPresentation';import { normalizeSourcePlatformQueryValue, getSourcePlatformLabel } from '@/utils/sourcePlatforms';@@ -62,7 +47,7 @@ import { useRecoveryHistorySectionState } from '@/components/Recovery/useRecovertype ArtifactMode = RecoveryArtifactMode;type VerificationFilter = 'all' | 'verified' | 'unverified' | 'unknown';-interface PageControlsColumnVisibility {+interface ArtifactColumnVisibility {availableToggles: () => ColumnDef[];isHiddenByUser: (id: string) => boolean;toggle: (id: string) => void;@@ -71,7 +56,7 @@ interface PageControlsColumnVisibility {interface RecoveryHistorySectionProps {activeAdvancedFilterCount: Accessor<number>;- artifactColumnVisibility: PageControlsColumnVisibility;+ artifactColumnVisibility: ArtifactColumnVisibility;availableOutcomes: readonly ('all' | 'success' | 'warning' | 'failed' | 'running')[];clusterFilter: Accessor<string>;clusterOptions: Accessor<string[]>;@@ -125,18 +110,7 @@ interface RecoveryHistorySectionProps {}export const RecoveryHistorySection: Component<RecoveryHistorySectionProps> = (props) => {- const {- advancedFiltersButtonRef,- advancedFiltersPanelRef,- clearSelectedPoint,- historyActiveFilterCount,- historyFiltersOpen,- moreFiltersOpen,- selectedPoint,- setHistoryFiltersOpen,- setMoreFiltersOpen,- toggleSelectedPoint,- } = useRecoveryHistorySectionState({+ const { clearSelectedPoint, selectedPoint, toggleSelectedPoint } = useRecoveryHistorySectionState({clusterFilter: props.clusterFilter,currentPage: props.currentPage,hasFocusedRollup: props.hasFocusedRollup,@@ -150,326 +124,266 @@ export const RecoveryHistorySection: Component<RecoveryHistorySectionProps> = (pscopeFilter: props.scopeFilter,verificationFilter: props.verificationFilter,});- const historyOutcomeOptions = createMemo(() =>- props.availableOutcomes.map((outcome) => ({- value: outcome,- label: outcome === 'all' ? 'Any status' : titleCaseDelimitedLabel(outcome),- })),- );- return (- <div class="flex flex-col gap-2">- <Show when={!props.kioskMode}>- <Card padding="none" tone="card" class="overflow-visible border-border-subtle bg-surface">- <div class="px-4 py-3 sm:px-5">- <Show when={props.hasFocusedRollup() && props.selectedHistoryItemLabel()}>- <div class="mb-3 flex min-w-0 flex-wrap items-center gap-2 text-sm">- <button- type="button"- class={getRecoveryBreadcrumbLinkClass()}- onClick={() => {- props.setRollupId('');- props.setCurrentPage(1);- }}- >- All events- </button>- <span class="text-muted">/</span>- <span class="min-w-0 truncate font-medium text-base-content">- {props.selectedHistoryItemLabel()}- </span>- </div>- </Show>+ const isMobileAccessor = createMemo(() => props.isMobile);- <PageControls- role="group"- aria-label="Recovery events controls"- search={- <SearchInput- value={props.queryFilter}- onChange={(value) => {- props.setQueryFilter(value);- props.setCurrentPage(1);- }}- placeholder={getRecoveryHistorySearchPlaceholder()}- inputClass="py-2 text-sm"- clearOnEscape- history={{- storageKey: STORAGE_KEYS.RECOVERY_SEARCH_HISTORY,- emptyMessage: getRecoverySearchHistoryEmptyMessage(),- }}- />- }- mobileFilters={{- enabled: props.isMobile,- onToggle: () => setHistoryFiltersOpen((open) => !open),- count: historyActiveFilterCount(),- }}- utilityActions={- <div class="relative">- <FilterActionButton- ref={advancedFiltersButtonRef}- aria-label="Filter"- aria-expanded={moreFiltersOpen()}- aria-controls="recovery-filter-panel"- aria-haspopup="dialog"- onClick={() => setMoreFiltersOpen((open) => !open)}- active={moreFiltersOpen() || props.activeAdvancedFilterCount() > 0}- >- <span>Filter</span>- <Show when={props.activeAdvancedFilterCount() > 0}>- <span class={filterUtilityBadgeClass}>- {props.activeAdvancedFilterCount()}- </span>- </Show>- </FilterActionButton>+ const setItemType = (value: string) => {+ props.setItemTypeFilter(normalizeRecoveryItemTypeQueryValue(value) || 'all');+ props.setCurrentPage(1);+ };+ const setPlatform = (value: string) => {+ props.setPlatformFilter(normalizeSourcePlatformQueryValue(value));+ props.setCurrentPage(1);+ };+ const setOutcome = (value: string) => {+ const outcome = value as 'all' | RecoveryOutcome;+ props.setHistoryOutcomeFilter(outcome);+ if (outcome !== 'all') props.setVerificationFilter('all');+ props.setCurrentPage(1);+ };+ const setScope = (value: string) => {+ props.setScopeFilter(value === 'workload' ? 'workload' : 'all');+ props.setCurrentPage(1);+ };+ const setMode = (value: string) => {+ props.setModeFilter(normalizeRecoveryModeQueryValue(value));+ props.setCurrentPage(1);+ };+ const setVerification = (value: string) => {+ props.setVerificationFilter(value as VerificationFilter);+ if (value !== 'all') props.setHistoryOutcomeFilter('all');+ props.setCurrentPage(1);+ };+ const setCluster = (value: string) => {+ props.setClusterFilter(value);+ props.setCurrentPage(1);+ };+ const setNode = (value: string) => {+ props.setNodeFilter(value);+ props.setCurrentPage(1);+ };+ const setNamespace = (value: string) => {+ props.setNamespaceFilter(value);+ props.setCurrentPage(1);+ };- <Show when={moreFiltersOpen()}>- <FilterToolbarPanel ref={advancedFiltersPanelRef} id="recovery-filter-panel">- <div class="mb-3 flex items-center justify-between gap-3">- <div>- <div class={filterPanelTitleClass}>Filter results</div>- <div class={filterPanelDescriptionClass}>- Narrow by scope, method, verification, or placement.- </div>- </div>- <Show when={props.activeAdvancedFilterCount() > 0}>- <button- type="button"- onClick={props.resetAdvancedArtifactFilters}- class={getRecoveryFilterPanelClearClass()}- >- Clear filters- </button>- </Show>- </div>+ const buildFilters = (): FilterDef[] => {+ const filters: FilterDef[] = [+ {+ id: 'item-type',+ label: getRecoveryArtifactColumnLabel('type', 'Item Type'),+ group: 'properties',+ value: props.itemTypeFilter,+ setValue: setItemType,+ defaultValue: 'all',+ options: () =>+ props.itemTypeOptions().map((itemType) => ({+ value: itemType,+ label:+ itemType === 'all'+ ? getRecoveryAllItemTypesLabel()+ : getRecoveryItemTypePresentation(itemType)?.label || itemType,+ })),+ },+ {+ id: 'platform',+ label: 'Platform',+ group: 'scope',+ value: props.platformFilter,+ setValue: setPlatform,+ defaultValue: 'all',+ options: () =>+ props.platformOptions().map((platform) => ({+ value: platform,+ label:+ platform === 'all'+ ? getRecoveryAllPlatformsLabel()+ : getSourcePlatformLabel(platform),+ })),+ },+ {+ id: 'outcome',+ label: 'Status',+ group: 'status',+ value: props.historyOutcomeFilter,+ setValue: setOutcome,+ defaultValue: 'all',+ options: () =>+ props.availableOutcomes.map((outcome) => ({+ value: outcome,+ label: outcome === 'all' ? 'Any status' : titleCaseDelimitedLabel(outcome),+ })),+ },+ {+ id: 'scope',+ label: 'Scope',+ group: 'properties',+ value: props.scopeFilter,+ setValue: setScope,+ defaultValue: 'all',+ options: () => [+ { value: 'all', label: getRecoveryAllHistoryLabel() },+ { value: 'workload', label: 'Workloads only' },+ ],+ },+ {+ id: 'method',+ label: 'Method',+ group: 'properties',+ value: props.modeFilter,+ setValue: setMode,+ defaultValue: 'all',+ options: () => [+ { value: 'all', label: 'Any method' },+ { value: 'snapshot', label: getRecoveryArtifactModePresentation('snapshot').label },+ { value: 'local', label: getRecoveryArtifactModePresentation('local').label },+ { value: 'remote', label: getRecoveryArtifactModePresentation('remote').label },+ ],+ },+ ];- <div class="grid gap-3 sm:grid-cols-2 lg:grid-cols-3">- <label class="flex min-w-0 flex-col gap-1">- <span class={RECOVERY_ADVANCED_FILTER_LABEL_CLASS}>Scope</span>- <select- value={props.scopeFilter()}- onChange={(event) => {- props.setScopeFilter(- event.currentTarget.value === 'workload' ? 'workload' : 'all',- );- props.setCurrentPage(1);- }}- class={RECOVERY_ADVANCED_FILTER_FIELD_CLASS}- >- <option value="all">{getRecoveryAllHistoryLabel()}</option>- <option value="workload">Workloads only</option>- </select>- </label>+ if (props.showVerificationFilter()) {+ filters.push({+ id: 'verification',+ label: 'Verification',+ group: 'status',+ value: props.verificationFilter,+ setValue: setVerification,+ defaultValue: 'all',+ options: () => [+ { value: 'all', label: 'Any verification' },+ { value: 'verified', label: 'Verified' },+ { value: 'unverified', label: 'Unverified' },+ { value: 'unknown', label: 'Unknown' },+ ],+ });+ }- <label class="flex min-w-0 flex-col gap-1">- <span class={RECOVERY_ADVANCED_FILTER_LABEL_CLASS}>Method</span>- <select- value={props.modeFilter()}- onChange={(event) => {- props.setModeFilter(- normalizeRecoveryModeQueryValue(event.currentTarget.value),- );- props.setCurrentPage(1);- }}- class={RECOVERY_ADVANCED_FILTER_FIELD_CLASS}- >- <option value="all">Any method</option>- <option value="snapshot">- {getRecoveryArtifactModePresentation('snapshot').label}- </option>- <option value="local">- {getRecoveryArtifactModePresentation('local').label}- </option>- <option value="remote">- {getRecoveryArtifactModePresentation('remote').label}- </option>- </select>- </label>+ if (props.showClusterFilter()) {+ filters.push({+ id: 'cluster',+ label: getRecoveryLocationFacetLabel('cluster'),+ group: 'scope',+ value: props.clusterFilter,+ setValue: setCluster,+ defaultValue: 'all',+ options: () => [+ { value: 'all', label: getRecoveryLocationFacetAllLabel('cluster') },+ ...props+ .clusterOptions()+ .filter((value) => value !== 'all')+ .map((cluster) => ({ value: cluster, label: cluster })),+ ],+ });+ }- <Show when={props.showVerificationFilter()}>- <label class="flex min-w-0 flex-col gap-1">- <span class={RECOVERY_ADVANCED_FILTER_LABEL_CLASS}>Verification</span>- <select- value={props.verificationFilter()}- onChange={(event) => {- props.setVerificationFilter(- event.currentTarget.value as VerificationFilter,- );- if (event.currentTarget.value !== 'all') {- props.setHistoryOutcomeFilter('all');- }- props.setCurrentPage(1);- }}- class={RECOVERY_ADVANCED_FILTER_FIELD_CLASS}- >- <option value="all">Any verification</option>- <option value="verified">Verified</option>- <option value="unverified">Unverified</option>- <option value="unknown">Unknown</option>- </select>- </label>- </Show>+ if (props.showNodeFilter()) {+ filters.push({+ id: 'node',+ label: getRecoveryLocationFacetLabel('node'),+ group: 'scope',+ value: props.nodeFilter,+ setValue: setNode,+ defaultValue: 'all',+ options: () => [+ { value: 'all', label: getRecoveryLocationFacetAllLabel('node') },+ ...props+ .nodeOptions()+ .filter((value) => value !== 'all')+ .map((node) => ({ value: node, label: node })),+ ],+ });+ }- <Show when={props.showClusterFilter()}>- <label class="flex min-w-0 flex-col gap-1">- <span class={RECOVERY_ADVANCED_FILTER_LABEL_CLASS}>- {getRecoveryLocationFacetLabel('cluster')}- </span>- <select- value={props.clusterFilter()}- onChange={(event) => {- props.setClusterFilter(event.currentTarget.value);- props.setCurrentPage(1);- }}- class={RECOVERY_ADVANCED_FILTER_FIELD_CLASS}- >- <option value="all">- {getRecoveryLocationFacetAllLabel('cluster')}- </option>- <For each={props.clusterOptions().filter((value) => value !== 'all')}>- {(cluster) => <option value={cluster}>{cluster}</option>}- </For>- </select>- </label>- </Show>+ if (props.showNamespaceFilter()) {+ filters.push({+ id: 'namespace',+ label: getRecoveryLocationFacetLabel('namespace'),+ group: 'scope',+ value: props.namespaceFilter,+ setValue: setNamespace,+ defaultValue: 'all',+ options: () => [+ { value: 'all', label: getRecoveryLocationFacetAllLabel('namespace') },+ ...props+ .namespaceOptions()+ .filter((value) => value !== 'all')+ .map((namespace) => ({ value: namespace, label: namespace })),+ ],+ });+ }- <Show when={props.showNodeFilter()}>- <label class="flex min-w-0 flex-col gap-1">- <span class={RECOVERY_ADVANCED_FILTER_LABEL_CLASS}>- {getRecoveryLocationFacetLabel('node')}- </span>- <select- value={props.nodeFilter()}- onChange={(event) => {- props.setNodeFilter(event.currentTarget.value);- props.setCurrentPage(1);- }}- class={RECOVERY_ADVANCED_FILTER_FIELD_CLASS}- >- <option value="all">- {getRecoveryLocationFacetAllLabel('node')}- </option>- <For each={props.nodeOptions().filter((value) => value !== 'all')}>- {(node) => <option value={node}>{node}</option>}- </For>- </select>- </label>- </Show>+ return filters;+ };- <Show when={props.showNamespaceFilter()}>- <label class="flex min-w-0 flex-col gap-1">- <span class={RECOVERY_ADVANCED_FILTER_LABEL_CLASS}>- {getRecoveryLocationFacetLabel('namespace')}- </span>- <select- value={props.namespaceFilter()}- onChange={(event) => {- props.setNamespaceFilter(event.currentTarget.value);- props.setCurrentPage(1);- }}- class={RECOVERY_ADVANCED_FILTER_FIELD_CLASS}- >- <option value="all">- {getRecoveryLocationFacetAllLabel('namespace')}- </option>- <For- each={props.namespaceOptions().filter((value) => value !== 'all')}- >- {(namespace) => <option value={namespace}>{namespace}</option>}- </For>- </select>- </label>- </Show>- </div>- </FilterToolbarPanel>- </Show>- </div>- }- columnVisibility={props.artifactColumnVisibility}- resetAction={{- show: props.hasActiveArtifactFilters(),- onClick: props.resetAllArtifactFilters,- label: 'Reset all',+ return (+ <div class="flex flex-col gap-2">+ <Show when={!props.kioskMode}>+ <Show when={props.hasFocusedRollup() && props.selectedHistoryItemLabel()}>+ <div class="flex min-w-0 flex-wrap items-center gap-2 px-1 text-sm">+ <button+ type="button"+ class={getRecoveryBreadcrumbLinkClass()}+ onClick={() => {+ props.setRollupId('');+ props.setCurrentPage(1);}}- showFilters={!props.isMobile || historyFiltersOpen()}>- <RecoveryHistoryItemFilter- options={props.historyItemOptions}- selectedRollupId={props.rollupId}- selectedLabel={props.selectedHistoryItemLabel}- onSelect={(value) => {- props.setRollupId(value);- props.setCurrentPage(1);- }}- onClear={() => {- props.setRollupId('');- props.setCurrentPage(1);- }}- />-- <LabeledFilterSelect- id="recovery-item-type-filter-history"- label={getRecoveryArtifactColumnLabel('type', 'Item Type')}- value={props.itemTypeFilter()}- onChange={(event) => {- props.setItemTypeFilter(- normalizeRecoveryItemTypeQueryValue(event.currentTarget.value) || 'all',- );- props.setCurrentPage(1);- }}- selectClass="py-1 text-xs"- >- <For each={props.itemTypeOptions()}>- {(itemType) => (- <option value={itemType}>- {itemType === 'all'- ? getRecoveryAllItemTypesLabel()- : getRecoveryItemTypePresentation(itemType)?.label || itemType}- </option>- )}- </For>- </LabeledFilterSelect>-- <LabeledFilterSelect- id="recovery-platform-filter-history"- label="Platform"- value={props.platformFilter()}- onChange={(event) => {- props.setPlatformFilter(- normalizeSourcePlatformQueryValue(event.currentTarget.value),- );- props.setCurrentPage(1);- }}- selectClass="py-1 text-xs"- >- <For each={props.platformOptions()}>- {(platform) => (- <option value={platform}>- {platform === 'all'- ? getRecoveryAllPlatformsLabel()- : getSourcePlatformLabel(platform)}- </option>- )}- </For>- </LabeledFilterSelect>-- <LabeledFilterToggleGroup- id="recovery-status-filter"- label="Status"- value={props.historyOutcomeFilter()}- onChange={(nextValue) => {- const value = nextValue as 'all' | RecoveryOutcome;- props.setHistoryOutcomeFilter(value);- if (value !== 'all') props.setVerificationFilter('all');- props.setCurrentPage(1);- }}- selectClass="py-1 text-xs"- options={historyOutcomeOptions()}- />- </PageControls>+ All events+ </button>+ <span class="text-muted">/</span>+ <span class="min-w-0 truncate font-medium text-base-content">+ {props.selectedHistoryItemLabel()}+ </span></div>- </Card>+ </Show>++ <FilterBar+ role="group"+ ariaLabel="Recovery events controls"+ isMobile={isMobileAccessor}+ search={{+ value: props.queryFilter,+ setValue: (value: string) => {+ props.setQueryFilter(value);+ props.setCurrentPage(1);+ },+ placeholder: getRecoveryHistorySearchPlaceholder(),+ historyKey: STORAGE_KEYS.RECOVERY_SEARCH_HISTORY,+ emptyMessage: getRecoverySearchHistoryEmptyMessage(),+ clearOnEscape: true,+ }}+ searchTrailing={+ <RecoveryHistoryItemFilter+ options={props.historyItemOptions}+ selectedRollupId={props.rollupId}+ selectedLabel={props.selectedHistoryItemLabel}+ onSelect={(value) => {+ props.setRollupId(value);+ props.setCurrentPage(1);+ }}+ onClear={() => {+ props.setRollupId('');+ props.setCurrentPage(1);+ }}+ />+ }+ filters={buildFilters()}+ viewOptionsTrailing={+ <ColumnPicker+ columns={props.artifactColumnVisibility.availableToggles()}+ isHidden={props.artifactColumnVisibility.isHiddenByUser}+ onToggle={props.artifactColumnVisibility.toggle}+ onReset={props.artifactColumnVisibility.resetToDefaults}+ />+ }+ onClearAll={() => {+ if (props.hasActiveArtifactFilters()) {+ props.resetAllArtifactFilters();+ }+ }}+ showClearAll={props.hasActiveArtifactFilters}+ /></Show><TableCard>diff --git a/frontend-modern/src/components/Recovery/RecoveryProtectedInventorySection.tsx b/frontend-modern/src/components/Recovery/RecoveryProtectedInventorySection.tsxindex 43fdb4d135..c16fb8fb47 100644--- a/frontend-modern/src/components/Recovery/RecoveryProtectedInventorySection.tsx+++ b/frontend-modern/src/components/Recovery/RecoveryProtectedInventorySection.tsx@@ -1,11 +1,8 @@import { For, Show, createEffect, createMemo, createSignal } from 'solid-js';import type { Accessor, Component } from 'solid-js';-import { Card } from '@/components/shared/Card';import { EmptyState } from '@/components/shared/EmptyState';-import { LabeledFilterSelect } from '@/components/shared/FilterToolbar';-import { PageControls } from '@/components/shared/PageControls';-import { SearchInput } from '@/components/shared/SearchInput';+import { FilterBar, type FilterDef } from '@/components/shared/FilterBar';import { StatusDot } from '@/components/shared/StatusDot';import { getSourcePlatformBadge } from '@/components/shared/sourcePlatformBadges';import {@@ -149,7 +146,6 @@ const normalizeProtectedStateFilter = (value: string): ProtectedStateFilter => {export const RecoveryProtectedInventorySection: Component<RecoveryProtectedInventorySectionProps> = (props) => {- const [protectedFiltersOpen, setProtectedFiltersOpen] = createSignal(false);const [protectedSortCol, setProtectedSortCol] = createSignal<ProtectedSortCol>('outcome');const [protectedSortDir, setProtectedSortDir] = createSignal<SortDir>('desc');@@ -162,14 +158,7 @@ export const RecoveryProtectedInventorySection: Component<}};- const protectedActiveFilterCount = createMemo(() => {- let count = 0;- if (props.queryFilter().trim() !== '') count += 1;- if (props.platformFilter() !== 'all') count += 1;- if (props.itemTypeFilter() !== 'all') count += 1;- if (props.protectedStateFilter() !== 'all') count += 1;- return count;- });+ const isMobileAccessor = createMemo(() => props.isMobile);const sortedRollups = createMemo<ProtectionRollup[]>(() => {const items = props.filteredRollups().slice();@@ -249,118 +238,82 @@ export const RecoveryProtectedInventorySection: Component<protectedSortDir();});- const resetProtectedFilters = () => {- props.setQueryFilter('');- props.setPlatformFilter('all');- props.setItemTypeFilter('all');- props.setVerificationFilter('all');- props.setProtectedStateFilter('all');- };-return (<div class="flex flex-col gap-2"><Show when={!props.kioskMode}>- <Card padding="none" tone="card" class="overflow-visible border-border-subtle bg-surface">- <div class="px-4 py-3 sm:px-5">- <PageControls- role="group"- aria-label="Protected items controls"- search={- <SearchInput- value={props.queryFilter}- onChange={(value) => props.setQueryFilter(value)}- placeholder={getRecoveryProtectedSearchPlaceholder()}- inputClass="py-1.5 text-sm"- clearOnEscape- history={{- storageKey: STORAGE_KEYS.RECOVERY_SEARCH_HISTORY,- emptyMessage: getRecoverySearchHistoryEmptyMessage(),- }}- />- }- mobileFilters={{- enabled: props.isMobile,- onToggle: () => setProtectedFiltersOpen((open) => !open),- count: protectedActiveFilterCount(),- }}- resetAction={{- show: protectedActiveFilterCount() > 0,- onClick: resetProtectedFilters,- label: 'Reset all',- title: 'Reset protected item filters',- }}- showFilters={!props.isMobile || protectedFiltersOpen()}- toolbarClass="gap-3 lg:flex-nowrap"- >- <LabeledFilterSelect- id="recovery-item-type-filter"- label={getRecoveryArtifactColumnLabel('type', 'Item Type')}- value={props.itemTypeFilter()}- onChange={(event) =>- props.setItemTypeFilter(- normalizeRecoveryItemTypeQueryValue(event.currentTarget.value) || 'all',- )- }- groupClass="gap-1.5 px-1.5 py-0.5"- selectClass="py-1 text-xs"- >- <For each={props.itemTypeOptions()}>- {(itemType) => (- <option value={itemType}>- {itemType === 'all'- ? getRecoveryAllItemTypesLabel()- : getRecoveryItemTypePresentation(itemType)?.label || itemType}- </option>- )}- </For>- </LabeledFilterSelect>-- <LabeledFilterSelect- id="recovery-platform-filter"- label="Platform"- value={props.platformFilter()}- onChange={(event) =>- props.setPlatformFilter(- normalizeSourcePlatformQueryValue(event.currentTarget.value),- )- }- groupClass="gap-1.5 px-1.5 py-0.5"- selectClass="py-1 text-xs"- >- <For each={props.platformOptions()}>- {(platform) => (- <option value={platform}>- {platform === 'all'- ? getRecoveryAllPlatformsLabel()- : getSourcePlatformLabel(platform)}- </option>- )}- </For>- </LabeledFilterSelect>-- <LabeledFilterSelect- id="recovery-protected-status-filter"- label="Protection state"- value={props.protectedStateFilter()}- onChange={(event) => {- const value = normalizeProtectedStateFilter(event.currentTarget.value);- props.setProtectedStateFilter(value);- props.setVerificationFilter('all');- }}- groupClass="gap-1.5 px-1.5 py-0.5"- selectClass="py-1 text-xs"- >- <For each={availableProtectionStates}>- {(state) => (- <option value={state}>- {state === 'all' ? 'Any state' : getRecoveryRollupInventoryStatusLabel(state)}- </option>- )}- </For>- </LabeledFilterSelect>- </PageControls>- </div>- </Card>+ <FilterBar+ role="group"+ ariaLabel="Protected items controls"+ isMobile={isMobileAccessor}+ search={{+ value: props.queryFilter,+ setValue: props.setQueryFilter,+ placeholder: getRecoveryProtectedSearchPlaceholder(),+ historyKey: STORAGE_KEYS.RECOVERY_SEARCH_HISTORY,+ emptyMessage: getRecoverySearchHistoryEmptyMessage(),+ clearOnEscape: true,+ }}+ filters={+ [+ {+ id: 'item-type',+ label: getRecoveryArtifactColumnLabel('type', 'Item Type'),+ group: 'properties',+ value: props.itemTypeFilter,+ setValue: (value: string) =>+ props.setItemTypeFilter(+ normalizeRecoveryItemTypeQueryValue(value) || 'all',+ ),+ defaultValue: 'all',+ options: () =>+ props.itemTypeOptions().map((itemType) => ({+ value: itemType,+ label:+ itemType === 'all'+ ? getRecoveryAllItemTypesLabel()+ : getRecoveryItemTypePresentation(itemType)?.label || itemType,+ })),+ },+ {+ id: 'platform',+ label: 'Platform',+ group: 'scope',+ value: props.platformFilter,+ setValue: (value: string) =>+ props.setPlatformFilter(normalizeSourcePlatformQueryValue(value)),+ defaultValue: 'all',+ options: () =>+ props.platformOptions().map((platform) => ({+ value: platform,+ label:+ platform === 'all'+ ? getRecoveryAllPlatformsLabel()+ : getSourcePlatformLabel(platform),+ })),+ },+ {+ id: 'protected-state',+ label: 'Protection state',+ group: 'status',+ value: props.protectedStateFilter,+ setValue: (value: string) => {+ const normalized = normalizeProtectedStateFilter(value);+ props.setProtectedStateFilter(normalized);+ props.setVerificationFilter('all');+ },+ defaultValue: 'all',+ options: () =>+ availableProtectionStates.map((state) => ({+ value: state,+ label:+ state === 'all'+ ? 'Any state'+ : getRecoveryRollupInventoryStatusLabel(state),+ })),+ },+ ] as FilterDef[]+ }+ /></Show><TableCard>diff --git a/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx b/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsxindex b8d326f3de..486b5c61d9 100644--- a/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx+++ b/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx@@ -417,25 +417,16 @@ describe('Recovery', () => {expect(within(historyTablist).getByRole('tab', { name: 'Recovery events' }),).toBeInTheDocument();- expect(within(inventoryControls).getByLabelText('Item Type').className).not.toContain(- 'min-w-[',- );- expect(within(inventoryControls).getByLabelText('Platform').className).not.toContain('min-w-[');- expect(within(inventoryControls).getByLabelText('Protection state').className).not.toContain(- 'min-w-[',- );+ // Inventory section migrated to FilterBar: filters live behind the+ // "+ Filter" menu rather than as labelled selects, so the legacy+ // min-width inspections no longer apply. (The events view is active by+ // this point in the test, so the inventory section is unmounted; chip+ // / menu coverage lives in the dedicated FilterBar tests below.)expect(screen.getAllByText(/^1 event$/i)).toHaveLength(1);expect(within(historyControls).queryByText(/day group/i)).not.toBeInTheDocument();- expect(within(historyControls).getByLabelText('Item Type').className).not.toContain('min-w-[');- expect(within(historyControls).getByLabelText('Platform').className).not.toContain('min-w-[');- const historyStatusGroup = within(historyControls).getByRole('group', { name: 'Status' });- expect(historyStatusGroup).toHaveClass('xl:inline-flex');- expect(- within(historyStatusGroup).getByRole('button', { name: 'Any status' }),- ).toBeInTheDocument();- expect(- within(historyControls).getByLabelText('Status', { selector: 'select' }).className,- ).not.toContain('min-w-[');+ // Events FilterBar: "+ Filter" trigger surfaces Item Type / Platform /+ // Status / etc. as menu items rather than persistent labelled selects.+ expect(within(historyControls).getByRole('button', { name: 'Filter' })).toBeInTheDocument();const recoverySummaryPanel = screen.getByTestId('recovery-summary');expect(within(recoverySummaryPanel).getByRole('button', { name: '7d' })).toBeInTheDocument();expect(within(recoverySummaryPanel).getByRole('button', { name: '30d' })).toBeInTheDocument();@@ -608,7 +599,16 @@ describe('Recovery', () => {'true',);});- expect(screen.getAllByText('TrueNAS').length).toBeGreaterThan(0);+ // The legacy `providers: ['truenas']` payload should normalize into the+ // canonical "TrueNAS" platform label on whichever surface renders it+ // (events table badge, "+ Filter > Platform" menu, or active chip).+ const eventsControls = await screen.findByRole('group', {+ name: /recovery events controls/i,+ });+ fireEvent.click(within(eventsControls).getByRole('button', { name: 'Filter' }));+ fireEvent.click(await screen.findByRole('menuitem', { name: 'Platform' }));+ const platformMenu = await screen.findByRole('menu');+ expect(within(platformMenu).getByRole('button', { name: 'TrueNAS' })).toBeInTheDocument();} finally {rollupsPayload.pop();delete pointsByRollupId['ext:legacy-provider-rollup'];@@ -693,8 +693,17 @@ describe('Recovery', () => {expect(within(inventoryTable).queryByText('Cluster', { exact: true }),).not.toBeInTheDocument();- expect(screen.getByRole('option', { name: 'K8s Cluster' })).toBeInTheDocument();- expect(screen.queryByRole('option', { name: 'Cluster' })).not.toBeInTheDocument();+ // Open the inventory FilterBar's "+ Filter > Item Type" submenu and+ // assert the canonical K8s Cluster wording without the generic alias.+ fireEvent.click(screen.getByRole('button', { name: 'Filter' }));+ fireEvent.click(await screen.findByRole('menuitem', { name: 'Item Type' }));+ const itemTypeMenu = await screen.findByRole('menu');+ expect(+ within(itemTypeMenu).getByRole('button', { name: 'K8s Cluster' }),+ ).toBeInTheDocument();+ expect(+ within(itemTypeMenu).queryByRole('button', { name: 'Cluster' }),+ ).not.toBeInTheDocument();} finally {rollupsPayload.pop();delete pointsByRollupId['res:k8s-production-1'];@@ -985,7 +994,10 @@ describe('Recovery', () => {expect(await screen.findByText('VM 123')).toBeInTheDocument();- fireEvent.change(screen.getByLabelText('Platform'), { target: { value: 'truenas' } });+ fireEvent.click(screen.getByRole('button', { name: 'Filter' }));+ fireEvent.click(await screen.findByRole('menuitem', { name: 'Platform' }));+ const platformMenu = await screen.findByRole('menu');+ fireEvent.click(within(platformMenu).getByRole('button', { name: 'TrueNAS' }));await waitFor(() => {expect(navigateSpy).toHaveBeenCalledWith(@@ -1020,31 +1032,36 @@ describe('Recovery', () => {render(() => <Recovery />);- await waitFor(() => expect(screen.getByLabelText('Platform')).toBeInTheDocument());-- expect(screen.getByLabelText('Platform')).toHaveValue('truenas');- expect((screen.getByRole('option', { name: 'TrueNAS' }) as HTMLOptionElement).selected).toBe(- true,- );- expect(screen.getByText('Host / Agent')).toBeInTheDocument();- expect(screen.getByText('tower')).toBeInTheDocument();+ // FilterBar renders active filters as chips. Route-owned platform and+ // node values become removable chips in the events bar.+ expect(+ await screen.findByRole('button', { name: /^Platform: TrueNAS/ }),+ ).toBeInTheDocument();+ expect(+ await screen.findByRole('button', { name: /^Host \/ Agent: tower/ }),+ ).toBeInTheDocument();});it('uses the shared reset action for protected item filters', async () => {render(() => <Recovery />);expect(await screen.findByText('VM 123')).toBeInTheDocument();- expect(screen.queryByRole('button', { name: 'Reset all' })).not.toBeInTheDocument();+ expect(screen.queryByRole('button', { name: 'Clear all' })).not.toBeInTheDocument();- fireEvent.change(screen.getByLabelText('Platform'), { target: { value: 'truenas' } });+ fireEvent.click(screen.getByRole('button', { name: 'Filter' }));+ fireEvent.click(await screen.findByRole('menuitem', { name: 'Platform' }));+ const platformMenu = await screen.findByRole('menu');+ fireEvent.click(within(platformMenu).getByRole('button', { name: 'TrueNAS' }));- const resetButton = await screen.findByRole('button', { name: 'Reset all' });- fireEvent.click(resetButton);+ const clearAllButton = await screen.findByRole('button', { name: 'Clear all' });+ fireEvent.click(clearAllButton);await waitFor(() => {- expect(screen.getByLabelText('Platform')).toHaveValue('all');+ expect(+ screen.queryByRole('button', { name: /^Platform: TrueNAS/ }),+ ).not.toBeInTheDocument();expect(screen.getByText('VM 123')).toBeInTheDocument();- expect(screen.queryByRole('button', { name: 'Reset all' })).not.toBeInTheDocument();+ expect(screen.queryByRole('button', { name: 'Clear all' })).not.toBeInTheDocument();});});@@ -1059,7 +1076,7 @@ describe('Recovery', () => {'VM 123',);- fireEvent.click(within(controls).getByRole('button', { name: 'Reset all' }));+ fireEvent.click(within(controls).getByRole('button', { name: 'Clear all' }));await waitFor(() => {expect(navigateSpy).toHaveBeenCalledWith(@@ -1069,7 +1086,7 @@ describe('Recovery', () => {expect(screen.getByTestId('recovery-history-item-filter-trigger')).toHaveTextContent('Any item',);- expect(screen.queryByRole('button', { name: 'Reset all' })).not.toBeInTheDocument();+ expect(screen.queryByRole('button', { name: 'Clear all' })).not.toBeInTheDocument();});});@@ -1079,19 +1096,11 @@ describe('Recovery', () => {render(() => <Recovery />);const controls = await screen.findByRole('group', { name: /recovery events controls/i });- const filterButton = within(controls).getByRole('button', { name: 'Filter' });- const columnsButton = within(controls).getByRole('button', { name: /columns/i });- const actionRail = filterButton.closest('.page-controls-toolbar-actions');- const filterControls = within(controls)- .getByTestId('recovery-history-item-filter-trigger')- .closest('.page-controls-filter-controls');-- expect(actionRail).not.toBeNull();- expect(actionRail).toContainElement(filterButton);- expect(actionRail).toContainElement(columnsButton);- expect(filterControls).not.toBeNull();- expect(filterControls).not.toContainElement(filterButton);- expect(filterControls).not.toContainElement(columnsButton);+ // Both the "+ Filter" trigger and the Columns picker live inside the+ // events controls group; the item filter trigger is also grouped here.+ expect(within(controls).getByRole('button', { name: 'Filter' })).toBeInTheDocument();+ expect(within(controls).getByRole('button', { name: /columns/i })).toBeInTheDocument();+ expect(within(controls).getByTestId('recovery-history-item-filter-trigger')).toBeInTheDocument();});it('lets operators create and clear the item filter from the recovery events controls', async () => {@@ -1143,11 +1152,20 @@ describe('Recovery', () => {it('keeps recovery filter surfaces on canonical platform vocabulary', async () => {render(() => <Recovery />);- expect(await screen.findByLabelText('Platform')).toBeInTheDocument();+ // Inventory FilterBar surfaces "Platform" via the "+ Filter" menu rather+ // than as a labelled select, so assert the menu vocabulary instead.+ fireEvent.click(await screen.findByRole('button', { name: 'Filter' }));+ expect(+ await screen.findByRole('menuitem', { name: 'Platform' }),+ ).toBeInTheDocument();expect(screen.queryByText('All Providers')).not.toBeInTheDocument();+ fireEvent.keyDown(document, { key: 'Escape' });fireEvent.click(screen.getByRole('tab', { name: /Recovery events/i }));- expect(await screen.findByLabelText('Platform')).toBeInTheDocument();+ fireEvent.click(await screen.findByRole('button', { name: 'Filter' }));+ expect(+ await screen.findByRole('menuitem', { name: 'Platform' }),+ ).toBeInTheDocument();expect(screen.queryByText('All Providers')).not.toBeInTheDocument();});@@ -1156,7 +1174,10 @@ describe('Recovery', () => {expect(await screen.findByText('VM 123')).toBeInTheDocument();- fireEvent.change(screen.getByLabelText('Item Type'), { target: { value: 'dataset' } });+ fireEvent.click(screen.getByRole('button', { name: 'Filter' }));+ fireEvent.click(await screen.findByRole('menuitem', { name: 'Item Type' }));+ const itemTypeMenu = await screen.findByRole('menu');+ fireEvent.click(within(itemTypeMenu).getByRole('button', { name: 'Dataset' }));await waitFor(() => {expect(navigateSpy).toHaveBeenCalledWith(@@ -1221,8 +1242,10 @@ describe('Recovery', () => {it('uses canonical protection state filtering for protected inventory', async () => {render(() => <Recovery />);- const protectedStatus = await screen.findByLabelText('Protection state');- fireEvent.change(protectedStatus, { target: { value: 'never-succeeded' } });+ fireEvent.click(await screen.findByRole('button', { name: 'Filter' }));+ fireEvent.click(await screen.findByRole('menuitem', { name: 'Protection state' }));+ const stateMenu = await screen.findByRole('menu');+ fireEvent.click(within(stateMenu).getByRole('button', { name: 'Never succeeded' }));await waitFor(() => {expect(navigateSpy).toHaveBeenCalledWith(@@ -1311,7 +1334,11 @@ describe('Recovery', () => {);});- expect(screen.getByLabelText('Protection state')).toHaveValue('stale');+ // FilterBar surfaces the active value as a chip rather than a labelled+ // select. Assert the canonical chip text instead.+ expect(+ await screen.findByRole('button', { name: /^Protection state: Stale$/ }),+ ).toBeInTheDocument();});it('drops protected-only stale state when the recovery events view owns the route', async () => {@@ -1327,7 +1354,7 @@ describe('Recovery', () => {});const controls = await screen.findByRole('group', { name: /recovery events controls/i });- fireEvent.click(within(controls).getByRole('button', { name: 'Reset all' }));+ fireEvent.click(within(controls).getByRole('button', { name: 'Clear all' }));await waitFor(() => {expect(navigateSpy).toHaveBeenCalledWith(@@ -1384,8 +1411,9 @@ describe('Recovery', () => {fireEvent.click(await screen.findByRole('tab', { name: /recovery events/i }));fireEvent.click(await screen.findByRole('button', { name: /^filter$/i }));- const clusterSelect = await screen.findByLabelText('Cluster / Site');- fireEvent.change(clusterSelect, { target: { value: 'dev-cluster' } });+ fireEvent.click(await screen.findByRole('menuitem', { name: 'Cluster / Site' }));+ const clusterMenu = await screen.findByRole('menu');+ fireEvent.click(within(clusterMenu).getByRole('button', { name: 'dev-cluster' }));await waitFor(() => {expect(navigateSpy).toHaveBeenCalledWith(@@ -1466,12 +1494,14 @@ describe('Recovery', () => {fireEvent.click(await screen.findByRole('tab', { name: /recovery events/i }));fireEvent.click(await screen.findByRole('button', { name: /^filter$/i }));- fireEvent.change(await screen.findByLabelText('Host / Agent'), {- target: { value: 'node-agent-1' },- });- fireEvent.change(await screen.findByLabelText('Namespace / Group'), {- target: { value: 'tenant-a' },- });+ fireEvent.click(await screen.findByRole('menuitem', { name: 'Host / Agent' }));+ const hostMenu = await screen.findByRole('menu');+ fireEvent.click(within(hostMenu).getByRole('button', { name: 'node-agent-1' }));++ fireEvent.click(await screen.findByRole('button', { name: /^filter$/i }));+ fireEvent.click(await screen.findByRole('menuitem', { name: 'Namespace / Group' }));+ const namespaceMenu = await screen.findByRole('menu');+ fireEvent.click(within(namespaceMenu).getByRole('button', { name: 'tenant-a' }));await waitFor(() => {expect(navigateSpy).toHaveBeenCalledWith(@@ -1560,9 +1590,9 @@ describe('Recovery', () => {await screen.findByText(/Showing 1 - 1 of 1 recovery points/i);fireEvent.click(screen.getByRole('button', { name: /^filter$/i }));- fireEvent.change(await screen.findByLabelText('Cluster / Site'), {- target: { value: 'dev-cluster' },- });+ fireEvent.click(await screen.findByRole('menuitem', { name: 'Cluster / Site' }));+ const clusterMenu = await screen.findByRole('menu');+ fireEvent.click(within(clusterMenu).getByRole('button', { name: 'dev-cluster' }));await waitFor(() => {const urls = apiFetchMock.mock.calls.map((call) => String(call[0] || ''));diff --git a/frontend-modern/src/components/Storage/StoragePageControls.tsx b/frontend-modern/src/components/Storage/StoragePageControls.tsxindex d0cbe8b2c9..d7469cee82 100644--- a/frontend-modern/src/components/Storage/StoragePageControls.tsx+++ b/frontend-modern/src/components/Storage/StoragePageControls.tsx@@ -1,11 +1,40 @@-import { Component, JSX, Show } from 'solid-js';-import StorageControls from '@/components/Storage/StorageControls';-import type { StorageView } from './storagePageState';+import { Component, JSX, Show, createMemo } from 'solid-js';+import { FilterBar, type FilterDef } from '@/components/shared/FilterBar';+import { Subtabs } from '@/components/shared/Subtabs';+import { ChartVisibilityToggleButton } from '@/components/shared/FilterToolbar';+import { useBreakpoint } from '@/hooks/useBreakpoint';+import { STORAGE_KEYS } from '@/utils/localStorage';+import {+ DEFAULT_PHYSICAL_DISK_FACET_FILTER,+ type PhysicalDiskFilterOption,+} from '@/features/storageBackups/diskPresentation';+import { STORAGE_VIEW_OPTIONS } from '@/features/storageBackups/storagePagePresentation';+import {+ getNextStorageSortDirection,+ getStorageSortDirectionIconClass,+ getStorageSortDirectionTitle,+ STORAGE_FILTER_SORT_DIRECTION_BUTTON_CLASS,+ STORAGE_FILTER_SORT_ICON_CLASS,+ STORAGE_FILTER_SORT_SELECT_CLASS,+ STORAGE_FILTER_SORT_WRAP_CLASS,+} from '@/features/storageBackups/storageFilterPresentation';+import {+ DEFAULT_STORAGE_GROUP_KEY,+ DEFAULT_STORAGE_SELECTED_NODE_ID,+ DEFAULT_STORAGE_SORT_DIRECTION,+ DEFAULT_STORAGE_SORT_KEY,+ DEFAULT_STORAGE_SORT_OPTIONS,+ DEFAULT_STORAGE_SOURCE_FILTER,+ DEFAULT_STORAGE_STATUS_FILTER,+ hasActiveStorageFilters,+ normalizeStorageSortKey,+ STORAGE_GROUP_BY_OPTIONS,+ STORAGE_STATUS_FILTER_OPTIONS,+ type StorageView,+} from './storagePageState';import type { StorageGroupKey, StorageSortKey } from './useStorageModel';import type { StorageGroupByFilter, StorageStatusFilter } from './StorageFilter';-import { useStoragePageControlsModel } from './useStoragePageControlsModel';import type { StorageSourceOption } from '@/utils/storageSources';-import type { PhysicalDiskFilterOption } from '@/features/storageBackups/diskPresentation';type StoragePageControlsProps = {kioskMode: () => boolean;@@ -37,53 +66,236 @@ type StoragePageControlsProps = {storageFilterGroupBy: () => StorageGroupByFilter;chartsCollapsed?: () => boolean;onChartsToggle?: () => void;- mobileTrailing?: JSX.Element;- utilityActions?: JSX.Element;};+const VIEW_TABS = STORAGE_VIEW_OPTIONS as { value: string; label: string }[];+export const StoragePageControls: Component<StoragePageControlsProps> = (props) => {- const model = useStoragePageControlsModel({- kioskMode: props.kioskMode,- view: props.view,- setGroupBy: props.setGroupBy,- setSortKey: props.setSortKey,- storageFilterGroupBy: props.storageFilterGroupBy,- });+ const { isMobile } = useBreakpoint();+ const isPoolsView = () => props.view() === 'pools';+ const sortDisabled = () => !isPoolsView();++ const showClearAll = createMemo(+ () =>+ hasActiveStorageFilters({+ search: props.search(),+ sortKey: props.sortKey(),+ sortDirection: props.sortDirection(),+ groupBy: props.storageFilterGroupBy(),+ statusFilter: props.statusFilter(),+ sourceFilter: props.sourceFilter(),+ diskRoleFilter: props.diskRoleFilter?.(),+ diskGroupFilter: props.diskGroupFilter?.(),+ }) ||+ (props.selectedNodeId() || DEFAULT_STORAGE_SELECTED_NODE_ID) !==+ DEFAULT_STORAGE_SELECTED_NODE_ID,+ );++ const handleClearAll = () => {+ props.setSearch('');+ props.setSortKey(DEFAULT_STORAGE_SORT_KEY);+ props.setSortDirection(DEFAULT_STORAGE_SORT_DIRECTION);+ props.setGroupBy(DEFAULT_STORAGE_GROUP_KEY);+ props.setStatusFilter(DEFAULT_STORAGE_STATUS_FILTER as StorageStatusFilter);+ props.setSourceFilter(DEFAULT_STORAGE_SOURCE_FILTER);+ props.setDiskRoleFilter?.(DEFAULT_PHYSICAL_DISK_FACET_FILTER);+ props.setDiskGroupFilter?.(DEFAULT_PHYSICAL_DISK_FACET_FILTER);+ props.setSelectedNodeId(DEFAULT_STORAGE_SELECTED_NODE_ID);+ };++ const buildFilters = (): FilterDef[] => {+ const filters: FilterDef[] = [+ {+ id: 'storage-node',+ label: 'Node',+ group: 'scope',+ value: props.selectedNodeId,+ setValue: props.setSelectedNodeId,+ defaultValue: DEFAULT_STORAGE_SELECTED_NODE_ID,+ options: () =>+ props.nodeFilterOptions.map((option) => ({+ value: option.value,+ label: option.label,+ })),+ },+ ];++ if (isPoolsView()) {+ filters.push({+ id: 'storage-group-by',+ label: 'Group by',+ group: 'properties',+ value: () => props.storageFilterGroupBy(),+ setValue: (value: string) => props.setGroupBy(value as StorageGroupKey),+ defaultValue: DEFAULT_STORAGE_GROUP_KEY,+ options: () =>+ STORAGE_GROUP_BY_OPTIONS.map((option) => ({+ value: option.value,+ label: option.label,+ })),+ });++ filters.push({+ id: 'storage-source',+ label: 'Source',+ group: 'scope',+ value: props.sourceFilter,+ setValue: props.setSourceFilter,+ defaultValue: DEFAULT_STORAGE_SOURCE_FILTER,+ options: () =>+ props.sourceOptions().map((option) => ({+ value: option.key,+ label: option.label,+ })),+ });++ filters.push({+ id: 'storage-status',+ label: 'Status',+ group: 'status',+ value: () => props.statusFilter(),+ setValue: (value: string) =>+ props.setStatusFilter(value as StorageStatusFilter),+ defaultValue: DEFAULT_STORAGE_STATUS_FILTER as StorageStatusFilter,+ options: () =>+ STORAGE_STATUS_FILTER_OPTIONS.map((option) => ({+ value: option.value as string,+ label: option.label,+ })),+ });+ } else {+ const diskRoleFilter = props.diskRoleFilter;+ const setDiskRoleFilter = props.setDiskRoleFilter;+ const diskRoleOptions = props.diskRoleOptions;+ if (+ diskRoleFilter &&+ setDiskRoleFilter &&+ diskRoleOptions &&+ diskRoleOptions().length > 1+ ) {+ filters.push({+ id: 'storage-disk-role',+ label: 'Role',+ group: 'properties',+ value: () => diskRoleFilter(),+ setValue: setDiskRoleFilter,+ defaultValue: DEFAULT_PHYSICAL_DISK_FACET_FILTER,+ options: () =>+ diskRoleOptions().map((option) => ({+ value: option.value,+ label: option.label,+ })),+ });+ }++ const diskGroupFilter = props.diskGroupFilter;+ const setDiskGroupFilter = props.setDiskGroupFilter;+ const diskGroupOptions = props.diskGroupOptions;+ if (+ diskGroupFilter &&+ setDiskGroupFilter &&+ diskGroupOptions &&+ diskGroupOptions().length > 1+ ) {+ filters.push({+ id: 'storage-disk-group',+ label: 'Group',+ group: 'properties',+ value: () => diskGroupFilter(),+ setValue: setDiskGroupFilter,+ defaultValue: DEFAULT_PHYSICAL_DISK_FACET_FILTER,+ options: () =>+ diskGroupOptions().map((option) => ({+ value: option.value,+ label: option.label,+ })),+ });+ }+ }++ return filters;+ };return (- <Show when={model.showControls()}>- <StorageControls- view={props.view()}- onViewChange={props.setView}- search={props.search}- setSearch={props.setSearch}- searchTrailing={props.searchTrailing}- groupBy={model.groupBy()}- setGroupBy={model.setGroupBy()}- sortKey={props.sortKey}- setSortKey={model.setNormalizedSortKey}- sortDirection={props.sortDirection}- setSortDirection={props.setSortDirection}- sortDisabled={model.sortDisabled()}- statusFilter={props.statusFilter}- setStatusFilter={props.setStatusFilter}- sourceFilter={props.sourceFilter}- setSourceFilter={props.setSourceFilter}- sourceOptions={props.sourceOptions}- diskRoleFilter={props.diskRoleFilter}- setDiskRoleFilter={props.setDiskRoleFilter}- diskRoleOptions={props.diskRoleOptions}- diskGroupFilter={props.diskGroupFilter}- setDiskGroupFilter={props.setDiskGroupFilter}- diskGroupOptions={props.diskGroupOptions}- nodeFilterOptions={props.nodeFilterOptions}- selectedNodeId={props.selectedNodeId}- setSelectedNodeId={props.setSelectedNodeId}- chartsCollapsed={props.chartsCollapsed}- onChartsToggle={props.onChartsToggle}- mobileTrailing={props.mobileTrailing}- utilityActions={props.utilityActions}- />+ <Show when={!props.kioskMode()}>+ <div class="flex flex-col gap-2">+ <Subtabs+ value={props.view()}+ onChange={(value) => props.setView(value as StorageView)}+ ariaLabel="Storage view"+ tabs={VIEW_TABS}+ />++ <FilterBar+ role="group"+ ariaLabel="Storage filters"+ isMobile={isMobile}+ search={{+ value: props.search,+ setValue: props.setSearch,+ placeholder: 'Search storage... (e.g., local, nfs, node:pve1)',+ historyKey: STORAGE_KEYS.STORAGE_SEARCH_HISTORY,+ emptyMessage: 'Your recent storage searches will show here.',+ }}+ searchTrailing={props.searchTrailing}+ filters={buildFilters()}+ viewOptionsTrailing={+ <>+ <div class={STORAGE_FILTER_SORT_WRAP_CLASS}>+ <select+ value={props.sortKey()}+ onChange={(event) =>+ props.setSortKey(+ normalizeStorageSortKey(event.currentTarget.value) as StorageSortKey,+ )+ }+ disabled={sortDisabled()}+ aria-label="Sort by"+ class={STORAGE_FILTER_SORT_SELECT_CLASS}+ >+ {DEFAULT_STORAGE_SORT_OPTIONS.map((option) => (+ <option value={option.value}>{option.label}</option>+ ))}+ </select>+ <button+ type="button"+ title={getStorageSortDirectionTitle(props.sortDirection())}+ onClick={() =>+ props.setSortDirection(getNextStorageSortDirection(props.sortDirection()))+ }+ disabled={sortDisabled()}+ aria-label="Sort direction"+ class={STORAGE_FILTER_SORT_DIRECTION_BUTTON_CLASS}+ >+ <svg+ class={`${STORAGE_FILTER_SORT_ICON_CLASS} ${getStorageSortDirectionIconClass(+ props.sortDirection(),+ )}`}+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ stroke-width="2"+ >+ <path+ stroke-linecap="round"+ stroke-linejoin="round"+ d="M8 9l4-4 4 4m0 6l-4 4-4-4"+ />+ </svg>+ </button>+ </div>+ <Show when={props.onChartsToggle}>+ <ChartVisibilityToggleButton+ collapsed={props.chartsCollapsed?.() ?? false}+ onToggle={() => props.onChartsToggle?.()}+ />+ </Show>+ </>+ }+ onClearAll={handleClearAll}+ showClearAll={showClearAll}+ />+ </div></Show>);};diff --git a/frontend-modern/src/components/Storage/__tests__/Storage.test.tsx b/frontend-modern/src/components/Storage/__tests__/Storage.test.tsxindex bb97b65d0e..01b7211866 100644--- a/frontend-modern/src/components/Storage/__tests__/Storage.test.tsx+++ b/frontend-modern/src/components/Storage/__tests__/Storage.test.tsx@@ -77,8 +77,39 @@ let hookLoading = false;let hookError: unknown = undefined;let alertsActivationState: 'active' | 'pending_review' | 'snoozed' | null = 'active';-const getStorageSourceSelect = (): HTMLSelectElement =>- screen.getByLabelText('Source', { selector: 'select' }) as HTMLSelectElement;+const setStorageFilter = (filterLabel: string, optionLabel: string) => {+ const existingChip = queryStorageChip(filterLabel);+ if (existingChip) {+ fireEvent.click(existingChip);+ const listbox = screen.getByRole('listbox', { name: filterLabel });+ fireEvent.click(within(listbox).getByRole('option', { name: optionLabel }));+ return;+ }+ fireEvent.click(screen.getByRole('button', { name: 'Filter' }));+ fireEvent.click(screen.getByRole('menuitem', { name: filterLabel }));+ const menu = screen.getByRole('menu');+ fireEvent.click(within(menu).getByRole('button', { name: optionLabel }));+};++const queryStorageChip = (label: string): HTMLButtonElement | null => {+ const triggers = Array.from(+ document.querySelectorAll<HTMLButtonElement>('button[aria-haspopup="listbox"]'),+ );+ for (const trigger of triggers) {+ const text = (trigger.textContent || '').trim();+ if (text.startsWith(`${label}:`)) return trigger;+ }+ return null;+};++const getStorageChipOptions = async (label: string): Promise<string[]> => {+ const chip = queryStorageChip(label);+ if (!chip) throw new Error(`No chip found for filter "${label}"`);+ fireEvent.click(chip);+ const listbox = await screen.findByRole('listbox', { name: label });+ const options = Array.from(listbox.querySelectorAll<HTMLButtonElement>('button[role="option"]'));+ return options.map((opt) => (opt.textContent || '').trim());+};const fetchMock = vi.fn(async (input: RequestInfo | URL) => {const url =@@ -393,9 +424,7 @@ describe('Storage', () => {expect(screen.getByText('Local-LVM-PVE1')).toBeInTheDocument();expect(screen.getByText('Local-LVM-PVE2')).toBeInTheDocument();- fireEvent.change(screen.getByLabelText('Node'), {- target: { value: 'node-1' },- });+ setStorageFilter('Node', 'pve1');expect(screen.getByText('Local-LVM-PVE1')).toBeInTheDocument();expect(screen.queryByText('Local-LVM-PVE2')).not.toBeInTheDocument();@@ -671,7 +700,7 @@ describe('Storage', () => {expect(orderedRowIds.slice(0, 2)).toEqual(['storage-1', 'storage-2']);});- fireEvent.click(screen.getByRole('button', { name: 'By status' }));+ setStorageFilter('Group by', 'By status');// Group headers now show just the key name (without prefix)expect(screen.getAllByText('degraded').length).toBeGreaterThan(0);@@ -712,19 +741,18 @@ describe('Storage', () => {'aria-selected','true',);- expect((screen.getByLabelText('Node') as HTMLSelectElement).value).toBe('node-2');+ // Filter state surfaces as chips on the FilterBar; sort stays as a+ // labelled select in the view-options trailing slot.+ expect(queryStorageChip('Node')).toHaveTextContent('Node:pve2');expect((screen.getByLabelText('Sort by') as HTMLSelectElement).value).toBe('usage');- expect(getStorageSourceSelect().value).toBe('proxmox-pve');- expect((screen.getByLabelText('Status') as HTMLSelectElement).value).toBe('warning');// Grouping controls are only shown on the Pools view.fireEvent.click(screen.getByRole('tab', { name: 'Pools' }));- expect(screen.getByRole('button', { name: 'By status' })).toHaveAttribute(- 'aria-pressed',- 'true',- );+ expect(queryStorageChip('Group by')).toHaveTextContent('Group by:By status');+ expect(queryStorageChip('Source')).toHaveTextContent('Source:PVE');+ expect(queryStorageChip('Status')).toHaveTextContent('Status:Warning');- fireEvent.click(screen.getByRole('button', { name: 'By type' }));+ setStorageFilter('Group by', 'By type');await waitFor(() => {const [nextPath] = navigateSpy.mock.calls.at(-1) as [string];@@ -732,9 +760,7 @@ describe('Storage', () => {expect(nextParams.get('group')).toBe('type');});- fireEvent.change(screen.getByLabelText('Status'), {- target: { value: 'available' },- });+ setStorageFilter('Status', 'Healthy');await waitFor(() => {const [nextPath] = navigateSpy.mock.calls.at(-1) as [string];@@ -755,8 +781,7 @@ describe('Storage', () => {'aria-selected','true',);- expect((screen.getByLabelText('Node') as HTMLSelectElement).value).toBe('node-2');- expect(getStorageSourceSelect().value).toBe('proxmox-pve');+ expect(queryStorageChip('Node')).toHaveTextContent('Node:pve2');});it('trims whitespace-padded storage URL params back to canonical state', async () => {@@ -791,9 +816,7 @@ describe('Storage', () => {'aria-selected','true',);- expect((screen.getByLabelText('Node') as HTMLSelectElement).value).toBe('node-2');- expect(getStorageSourceSelect().value).toBe('proxmox-pve');- expect((screen.getByLabelText('Status') as HTMLSelectElement).value).toBe('available');+ expect(queryStorageChip('Node')).toHaveTextContent('Node:pve2');expect((screen.getByLabelText('Sort by') as HTMLSelectElement).value).toBe('usage');});@@ -810,7 +833,7 @@ describe('Storage', () => {);});- expect(getStorageSourceSelect().value).toBe('proxmox-pve');+ expect(queryStorageChip('Source')).toHaveTextContent('Source:PVE');});it('collapses explicit all node sentinels in storage URL params back to canonical unset state', async () => {@@ -823,7 +846,8 @@ describe('Storage', () => {expect(navigateSpy).toHaveBeenCalledWith('/storage', ROUTE_STATE_REPLACE_OPTIONS);});- expect((screen.getByLabelText('Node') as HTMLSelectElement).value).toBe('all');+ // Default Node selection ("all") collapses to no chip on the FilterBar.+ expect(queryStorageChip('Node')).toBeNull();});it('pins storage group scope into the route without conflating it with expansion', async () => {@@ -1543,20 +1567,11 @@ describe('Storage', () => {render(() => <Storage />);await waitFor(() => {- expect(getStorageSourceSelect()).toHaveValue('truenas');+ expect(queryStorageChip('Source')).toHaveTextContent('Source:TrueNAS');});- expect(screen.getByLabelText('Node')).toHaveValue('truenas-main');- expect(- Array.from(getStorageSourceSelect().querySelectorAll('option')).map((option) => ({- value: option.value,- label: option.textContent,- })),- ).toEqual([- { value: 'all', label: 'All sources' },- { value: 'proxmox-pve', label: 'PVE' },- { value: 'truenas', label: 'TrueNAS' },- ]);+ expect(queryStorageChip('Node')).toHaveTextContent('Node:TrueNAS Main');+ expect(await getStorageChipOptions('Source')).toEqual(['All sources', 'PVE', 'TrueNAS']);expect(screen.getByText('tank')).toBeInTheDocument();expect(screen.queryByText('local-zfs')).not.toBeInTheDocument();});@@ -1727,13 +1742,18 @@ describe('Storage', () => {fireEvent.click(screen.getAllByRole('tab', { name: 'Physical Disks' })[0]!);- const options = screen- .getAllByRole('option')- .map((option) => option.textContent)- .filter(Boolean);- expect(options).toContain('All disk hosts');- expect(options).toContain('pve1');- expect(options).not.toContain('mini');+ // The "+ Filter > Node" submenu lists nodes that have disk resources.+ // Hosts without disk resources (e.g. 'mini') are filtered out.+ fireEvent.click(screen.getByRole('button', { name: 'Filter' }));+ fireEvent.click(screen.getByRole('menuitem', { name: 'Node' }));+ const nodeMenu = screen.getByRole('menu');+ const optionLabels = Array.from(+ nodeMenu.querySelectorAll<HTMLButtonElement>('button'),+ )+ .map((button) => (button.textContent || '').trim())+ .filter((text) => text.length > 0 && !text.startsWith('Node'));+ expect(optionLabels).toContain('pve1');+ expect(optionLabels).not.toContain('mini');});it('resets stale disk node selections that do not map to a physical disk parent', async () => {@@ -1773,7 +1793,9 @@ describe('Storage', () => {await waitFor(() => {expect(screen.getByTestId('disk-list')).toHaveTextContent('disk-view:all:');});- expect(screen.getAllByLabelText('Node')[0]).toHaveValue('all');+ // Stale node selection collapses to default ("all"), so no Node chip+ // remains.+ expect(queryStorageChip('Node')).toBeNull();});it('renders the storage view as canonical subtabs', () => {@@ -1798,8 +1820,6 @@ describe('Storage', () => {expect(await screen.findByTestId('storage-summary')).toBeInTheDocument();const chartsButton = screen.getByRole('button', { name: /charts/i });- expect(chartsButton.closest('.page-controls-toolbar-actions')).not.toBeNull();-fireEvent.click(chartsButton);await waitFor(() => {diff --git a/frontend-modern/src/components/Workloads/WorkloadsFilter.tsx b/frontend-modern/src/components/Workloads/WorkloadsFilter.tsxindex 98c6da97ee..02a286bc53 100644--- a/frontend-modern/src/components/Workloads/WorkloadsFilter.tsx+++ b/frontend-modern/src/components/Workloads/WorkloadsFilter.tsx@@ -1,191 +1,182 @@-import { Component, For, Show } from 'solid-js';-import { Card } from '@/components/shared/Card';-import {- ChartVisibilityToggleButton,- LabeledFilterSelect,- LabeledFilterToggleGroup,-} from '@/components/shared/FilterToolbar';+import { Component, Show, createMemo } from 'solid-js';+import { ColumnPicker } from '@/components/shared/ColumnPicker';+import { FilterBar, type FilterDef } from '@/components/shared/FilterBar';+import { ChartVisibilityToggleButton } from '@/components/shared/FilterToolbar';import { GroupedTableModeSegmentedControl } from '@/components/shared/GroupedTableModeSegmentedControl';-import { PageControls, pageControlsFilterSectionClass } from '@/components/shared/PageControls';-import { SearchInput } from '@/components/shared/SearchInput';+import { useBreakpoint } from '@/hooks/useBreakpoint';import { STORAGE_KEYS } from '@/utils/localStorage';import { isContainerWorkloadViewMode } from '@/utils/workloads';import type { ViewMode } from '@/types/workloads';-import type { WorkloadsFilterProps } from './workloadsFilterModel';+import type { WorkloadsFilterProps, WorkloadsStatusMode } from './workloadsFilterModel';+import {+ DEFAULT_WORKLOADS_GROUPING_MODE,+ DEFAULT_WORKLOADS_SORT_DIRECTION,+ DEFAULT_WORKLOADS_SORT_KEY,+ DEFAULT_WORKLOADS_STATUS_MODE,+ DEFAULT_WORKLOADS_VIEW_MODE,+ hasActiveWorkloadsFilters,+} from './workloadsFilterModel';import { WORKLOAD_STATUS_FILTER_OPTIONS, WORKLOAD_TYPE_OPTIONS } from './workloadFilterConfigModel';-import { useWorkloadsFilterState } from './useWorkloadsFilterState';export const WorkloadsFilter: Component<WorkloadsFilterProps> = (props) => {- const {- activeFilterCount,- isMobile,- pageControlsColumnVisibility,- resetFilters,- showReset,- showToolbarFilters,- toggleFilters,- } = useWorkloadsFilterState(props);- const runtimeFilter = () =>- isContainerWorkloadViewMode(props.viewMode()) ? props.containerRuntimeFilter : undefined;- const typeFilterValue = () =>+ const { isMobile } = useBreakpoint();++ const typeValue = () =>isContainerWorkloadViewMode(props.viewMode()) ? 'container' : props.viewMode();- const hasSecondaryFilters = () =>- Boolean(props.hostFilter || props.platformFilter || props.namespaceFilter || runtimeFilter());- return (- <Card class="workloads-filter mb-4" padding="sm">- <PageControls- search={- <SearchInput- value={props.search}- onChange={props.setSearch}- placeholder="Search or filter..."- class="w-full"- onBeforeAutoFocus={props.onBeforeAutoFocus}- typeToSearch- history={{ storageKey: STORAGE_KEYS.WORKLOADS_SEARCH_HISTORY }}- />- }- searchTrailing={props.searchTrailing}- mobileFilters={{- enabled: isMobile(),- onToggle: toggleFilters,- count: activeFilterCount(),- }}- mobileTrailing={props.mobileTrailing}- columnVisibility={pageControlsColumnVisibility()}- resetAction={{- show: showReset(),- onClick: resetFilters,- title: 'Reset all filters',- class: 'text-base-content',- icon: (- <svg- width="12"- height="12"- viewBox="0 0 24 24"- fill="none"- stroke="currentColor"- stroke-width="2"- >- <path d="M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8" />- <path d="M21 3v5h-5" />- <path d="M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16" />- <path d="M8 16H3v5" />- </svg>- ),- }}- showFilters={showToolbarFilters()}- filterControlsVariant="sectioned-children"- toolbarTrailing={- <>- <GroupedTableModeSegmentedControl- value={props.groupingMode()}- onChange={props.setGroupingMode}- />+ const showRuntimeFilter = () =>+ isContainerWorkloadViewMode(props.viewMode()) && Boolean(props.containerRuntimeFilter);- <Show when={props.onChartsToggle}>- <ChartVisibilityToggleButton- collapsed={props.chartsCollapsed?.() ?? false}- onToggle={() => props.onChartsToggle?.()}- />- </Show>- </>- }- >- <div- class={`${pageControlsFilterSectionClass} workloads-filter-primary-controls flex min-w-0 flex-wrap items-center gap-1 xl:flex-col xl:items-start`}- >- <LabeledFilterToggleGroup- id="workloads-type-filter"- label="Type"- value={typeFilterValue()}- onChange={(value) => props.setViewMode(value as ViewMode)}- selectClass="min-w-[7rem]"- options={WORKLOAD_TYPE_OPTIONS}- />+ const showClearAll = createMemo(() =>+ hasActiveWorkloadsFilters({+ search: props.search(),+ viewMode: props.viewMode(),+ statusMode: props.statusMode(),+ groupingMode: props.groupingMode(),+ hostFilterValue: props.hostFilter?.value,+ platformFilterValue: props.platformFilter?.value,+ namespaceFilterValue: props.namespaceFilter?.value,+ }),+ );- <LabeledFilterToggleGroup- id="workloads-status-filter"- label="Status"- value={props.statusMode()}- onChange={(value) =>- props.setStatusMode(value as 'all' | 'running' | 'degraded' | 'stopped')- }- options={WORKLOAD_STATUS_FILTER_OPTIONS}- />- </div>+ const handleClearAll = () => {+ props.setSearch('');+ props.setSortKey(DEFAULT_WORKLOADS_SORT_KEY);+ props.setSortDirection(DEFAULT_WORKLOADS_SORT_DIRECTION);+ props.setViewMode(DEFAULT_WORKLOADS_VIEW_MODE);+ props.setStatusMode(DEFAULT_WORKLOADS_STATUS_MODE);+ props.setGroupingMode(DEFAULT_WORKLOADS_GROUPING_MODE);+ props.hostFilter?.onChange('');+ props.platformFilter?.onChange('');+ props.namespaceFilter?.onChange('');+ props.containerRuntimeFilter?.onChange('');+ };++ const buildFilters = (): FilterDef[] => {+ const filters: FilterDef[] = [+ {+ id: 'workloads-type',+ label: 'Type',+ group: 'properties',+ value: typeValue,+ setValue: (value: string) => props.setViewMode(value as ViewMode),+ defaultValue: DEFAULT_WORKLOADS_VIEW_MODE,+ options: () =>+ WORKLOAD_TYPE_OPTIONS.map((option) => ({+ value: option.value,+ label: option.label,+ })),+ },+ {+ id: 'workloads-status',+ label: 'Status',+ group: 'status',+ value: props.statusMode,+ setValue: (value: string) => props.setStatusMode(value as WorkloadsStatusMode),+ defaultValue: DEFAULT_WORKLOADS_STATUS_MODE,+ options: () =>+ WORKLOAD_STATUS_FILTER_OPTIONS.map((option) => ({+ value: option.value,+ label: option.label,+ })),+ },+ ];++ const hostFilter = props.hostFilter;+ if (hostFilter) {+ filters.push({+ id: hostFilter.id ?? 'workloads-host',+ label: hostFilter.label ?? 'Agent',+ group: 'scope',+ value: () => hostFilter.value,+ setValue: hostFilter.onChange,+ defaultValue: '',+ options: () => hostFilter.options,+ });+ }++ const platformFilter = props.platformFilter;+ if (platformFilter) {+ filters.push({+ id: platformFilter.id ?? 'workloads-platform',+ label: platformFilter.label ?? 'Platform',+ group: 'scope',+ value: () => platformFilter.value,+ setValue: platformFilter.onChange,+ defaultValue: '',+ options: () => platformFilter.options,+ });+ }- <Show when={hasSecondaryFilters()}>- <div- class={`${pageControlsFilterSectionClass} workloads-filter-secondary-controls flex max-w-full min-w-0 flex-wrap items-center gap-1`}- >- <Show when={props.hostFilter}>- {(hostFilter) => (- <LabeledFilterSelect- id={hostFilter().id ?? 'workloads-host-filter'}- label={hostFilter().label ?? 'Agent'}- value={hostFilter().value}- onChange={(e) => hostFilter().onChange(e.currentTarget.value)}- selectClass="min-w-[8rem]"- >- <For each={hostFilter().options}>- {(option) => <option value={option.value}>{option.label}</option>}- </For>- </LabeledFilterSelect>- )}- </Show>+ const namespaceFilter = props.namespaceFilter;+ if (namespaceFilter) {+ filters.push({+ id: namespaceFilter.id ?? 'workloads-namespace',+ label: namespaceFilter.label ?? 'Namespace',+ group: 'scope',+ value: () => namespaceFilter.value,+ setValue: namespaceFilter.onChange,+ defaultValue: '',+ options: () => namespaceFilter.options,+ });+ }- <Show when={props.platformFilter}>- {(platformFilter) => (- <LabeledFilterSelect- id={platformFilter().id ?? 'workloads-platform-filter'}- label={platformFilter().label ?? 'Platform'}- value={platformFilter().value}- onChange={(e) => platformFilter().onChange(e.currentTarget.value)}- selectClass="min-w-[8rem]"- >- <For each={platformFilter().options}>- {(option) => <option value={option.value}>{option.label}</option>}- </For>- </LabeledFilterSelect>- )}- </Show>+ const runtimeFilter = props.containerRuntimeFilter;+ if (runtimeFilter && showRuntimeFilter()) {+ filters.push({+ id: runtimeFilter.id ?? 'workloads-runtime',+ label: runtimeFilter.label ?? 'Runtime',+ group: 'properties',+ value: () => runtimeFilter.value,+ setValue: runtimeFilter.onChange,+ defaultValue: '',+ options: () => runtimeFilter.options,+ });+ }- <Show when={props.namespaceFilter}>- {(namespaceFilter) => (- <LabeledFilterSelect- id={namespaceFilter().id ?? 'workloads-namespace-filter'}- label={namespaceFilter().label ?? 'Namespace'}- value={namespaceFilter().value}- onChange={(e) => namespaceFilter().onChange(e.currentTarget.value)}- selectClass="min-w-[8rem]"- >- <For each={namespaceFilter().options}>- {(option) => <option value={option.value}>{option.label}</option>}- </For>- </LabeledFilterSelect>- )}- </Show>+ return filters;+ };- <Show when={runtimeFilter()}>- {(activeRuntimeFilter) => (- <LabeledFilterSelect- id={activeRuntimeFilter().id ?? 'workloads-runtime-filter'}- label={activeRuntimeFilter().label ?? 'Runtime'}- value={activeRuntimeFilter().value}- onChange={(e) => activeRuntimeFilter().onChange(e.currentTarget.value)}- selectClass="min-w-[7rem]"- >- <For each={activeRuntimeFilter().options}>- {(option) => <option value={option.value}>{option.label}</option>}- </For>- </LabeledFilterSelect>- )}- </Show>- </div>- </Show>- </PageControls>- </Card>+ return (+ <FilterBar+ role="group"+ ariaLabel="Workloads filters"+ isMobile={isMobile}+ search={{+ value: props.search,+ setValue: props.setSearch,+ placeholder: 'Search or filter...',+ historyKey: STORAGE_KEYS.WORKLOADS_SEARCH_HISTORY,+ onBeforeAutoFocus: props.onBeforeAutoFocus,+ }}+ searchTrailing={props.searchTrailing}+ filters={buildFilters()}+ viewOptionsTrailing={+ <>+ <GroupedTableModeSegmentedControl+ value={props.groupingMode()}+ onChange={props.setGroupingMode}+ />+ <Show when={props.onChartsToggle}>+ <ChartVisibilityToggleButton+ collapsed={props.chartsCollapsed?.() ?? false}+ onToggle={() => props.onChartsToggle?.()}+ />+ </Show>+ <Show when={props.columnVisibility}>+ {(visibility) => (+ <ColumnPicker+ columns={visibility().availableColumns}+ isHidden={visibility().isColumnHidden}+ onToggle={visibility().onColumnToggle}+ onReset={visibility().onColumnReset}+ />+ )}+ </Show>+ </>+ }+ onClearAll={handleClearAll}+ showClearAll={showClearAll}+ />);};diff --git a/frontend-modern/src/components/Workloads/__tests__/WorkloadsFilter.test.tsx b/frontend-modern/src/components/Workloads/__tests__/WorkloadsFilter.test.tsxindex a2fea02cee..ac166ac34c 100644--- a/frontend-modern/src/components/Workloads/__tests__/WorkloadsFilter.test.tsx+++ b/frontend-modern/src/components/Workloads/__tests__/WorkloadsFilter.test.tsx@@ -1,10 +1,15 @@import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';import { render, screen, cleanup, fireEvent, within } 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_GROUPING_MODE,+ DEFAULT_WORKLOADS_SORT_DIRECTION,+ DEFAULT_WORKLOADS_SORT_KEY,+ DEFAULT_WORKLOADS_STATUS_MODE,+ DEFAULT_WORKLOADS_VIEW_MODE,+ type WorkloadsFilterProps,+} from '../workloadsFilterModel';-// Mock useBreakpoint — hoist so tests can control isMobileconst { isMobileMock } = vi.hoisted(() => {const isMobileMock = vi.fn(() => false);return { isMobileMock };@@ -16,7 +21,6 @@ vi.mock('@/hooks/useBreakpoint', () => ({}),}));-// Mock SearchInput to avoid its side-effects (global keydown listener, history, etc.)vi.mock('@/components/shared/SearchInput', () => ({SearchInput: (props: {value: () => string;@@ -33,12 +37,10 @@ vi.mock('@/components/shared/SearchInput', () => ({),}));-// Mock ColumnPickervi.mock('@/components/shared/ColumnPicker', () => ({ColumnPicker: () => <div data-testid="column-picker">ColumnPicker</div>,}));-/** Helper to build default required props, with optional overrides. */function makeProps(overrides: Partial<WorkloadsFilterProps> = {}): WorkloadsFilterProps {return {search: vi.fn(() => ''),@@ -55,6 +57,17 @@ function makeProps(overrides: Partial<WorkloadsFilterProps> = {}): WorkloadsFilt};}+const openAddFilterMenu = () => {+ fireEvent.click(screen.getByRole('button', { name: 'Filter' }));+};++const pickFromMenu = (menuItem: string, optionLabel: string) => {+ openAddFilterMenu();+ fireEvent.click(screen.getByRole('menuitem', { name: menuItem }));+ const menu = screen.getByRole('menu');+ fireEvent.click(within(menu).getByRole('button', { name: optionLabel }));+};+describe('WorkloadsFilter', () => {beforeEach(() => {vi.clearAllMocks();@@ -65,752 +78,464 @@ describe('WorkloadsFilter', () => {cleanup();});- // --- Rendering ----describe('rendering', () => {it('renders the search input', () => {- const props = makeProps();- render(() => <WorkloadsFilter {...props} />);+ render(() => <WorkloadsFilter {...makeProps()} />);expect(screen.getByTestId('search-input')).toBeInTheDocument();});- it('renders the Type filter as a responsive compact toggle group with select fallback', () => {- const props = makeProps();- render(() => <WorkloadsFilter {...props} />);- const typeGroup = screen.getByRole('group', { name: 'Type' });- expect(typeGroup).toBeInTheDocument();- expect(typeGroup).toHaveClass('hidden');- expect(typeGroup).toHaveClass('xl:inline-flex');- expect(within(typeGroup).getByRole('button', { name: 'All' })).toHaveAttribute(- 'aria-pressed',- 'true',- );- expect(within(typeGroup).getByRole('button', { name: 'VMs' })).toBeInTheDocument();- expect(within(typeGroup).getByRole('button', { name: 'Containers' })).toBeInTheDocument();- expect(within(typeGroup).getByRole('button', { name: 'Pods' })).toBeInTheDocument();-- const typeSelect = screen.getByLabelText('Type', { selector: 'select' });- expect(typeSelect).toBeInTheDocument();- expect(typeSelect).toHaveValue('all');- expect(typeSelect.parentElement).toHaveClass('xl:hidden');- const primaryControls = typeGroup.closest('.workloads-filter-primary-controls');- expect(primaryControls).not.toBeNull();- expect(primaryControls).toHaveClass('xl:flex-col');- expect(primaryControls).toHaveClass('xl:items-start');- expect(primaryControls).toContainElement(typeSelect.parentElement!);-- const options = typeSelect.querySelectorAll('option');- const values = Array.from(options).map((o) => o.value);- const labels = Array.from(options).map((o) => o.textContent);- expect(values).toEqual(['all', 'vm', 'container', 'pod']);- expect(labels).toEqual(['All', 'VMs', 'Containers', 'Pods']);- });-- it('renders the Status filter as a compact toggle group', () => {- const props = makeProps();- render(() => <WorkloadsFilter {...props} />);- const statusGroup = screen.getByRole('group', { name: 'Status' });- expect(statusGroup).toBeInTheDocument();- expect(statusGroup).toHaveClass('hidden');- expect(statusGroup).toHaveClass('xl:inline-flex');- const statusSelect = screen.getByLabelText('Status', { selector: 'select' });- expect(statusSelect).toBeInTheDocument();- expect(statusSelect.parentElement).toHaveClass('xl:hidden');- const primaryControls = statusGroup.closest('.workloads-filter-primary-controls');- expect(primaryControls).not.toBeNull();- expect(primaryControls).toContainElement(statusSelect.parentElement!);-- expect(within(statusGroup).getByRole('button', { name: 'All' })).toHaveAttribute(- 'aria-pressed',- 'true',- );- expect(within(statusGroup).getByRole('button', { name: 'Running' })).toBeInTheDocument();- expect(within(statusGroup).getByRole('button', { name: 'Degraded' })).toBeInTheDocument();- expect(within(statusGroup).getByRole('button', { name: 'Stopped' })).toBeInTheDocument();+ it('exposes Type and Status filters via the "+ Filter" menu', () => {+ render(() => <WorkloadsFilter {...makeProps()} />);+ openAddFilterMenu();+ expect(screen.getByRole('menuitem', { name: 'Type' })).toBeInTheDocument();+ expect(screen.getByRole('menuitem', { name: 'Status' })).toBeInTheDocument();});- it('renders Grouped and List buttons', () => {- const props = makeProps();- render(() => <WorkloadsFilter {...props} />);- expect(screen.getByLabelText('Group by')).toBeInTheDocument();- expect(screen.getByText('Grouped')).toBeInTheDocument();- expect(screen.getByText('List')).toBeInTheDocument();+ it('renders Grouped and List view-option buttons', () => {+ render(() => <WorkloadsFilter {...makeProps()} />);+ expect(screen.getByRole('button', { name: 'Grouped' })).toBeInTheDocument();+ expect(screen.getByRole('button', { name: 'List' })).toBeInTheDocument();});- it('allows dense workload toolbar controls to wrap instead of clipping trailing actions', () => {- const props = makeProps({- viewMode: vi.fn(() => 'app-container' as const),- hostFilter: {- label: 'Node',- value: '',- options: [{ value: '', label: 'All nodes' }],- onChange: vi.fn(),- },- platformFilter: {- label: 'Platform',- value: '',- options: [{ value: '', label: 'All platforms' }],- onChange: vi.fn(),- },- containerRuntimeFilter: {- label: 'Runtime',- value: '',- options: [{ value: '', label: 'All runtimes' }],- onChange: vi.fn(),- },- columnVisibility: {- availableColumns: [{ id: 'image', label: 'Image' }],- isColumnHidden: vi.fn(() => false),- onColumnToggle: vi.fn(),- },- chartsCollapsed: vi.fn(() => false),- onChartsToggle: vi.fn(),- });- const { container } = render(() => <WorkloadsFilter {...props} />);-- expect(screen.getByTestId('column-picker')).toBeInTheDocument();- const primaryControls = container.querySelector<HTMLElement>(- '.workloads-filter-primary-controls',- );- const secondaryControls = container.querySelector<HTMLElement>(- '.workloads-filter-secondary-controls',- );- const controlDeck = container.querySelector<HTMLElement>('.page-controls-control-deck');- expect(primaryControls).not.toBeNull();- expect(secondaryControls).not.toBeNull();- expect(controlDeck).not.toBeNull();- expect(primaryControls!).toContainElement(screen.getByRole('group', { name: 'Type' }));- expect(primaryControls!).toContainElement(screen.getByRole('group', { name: 'Status' }));- expect(secondaryControls!).toContainElement(- screen.getByLabelText('Node', { selector: 'select' }),- );- expect(secondaryControls!).toContainElement(- screen.getByLabelText('Platform', { selector: 'select' }),- );- expect(secondaryControls!).toContainElement(- screen.getByLabelText('Runtime', { selector: 'select' }),- );- expect(secondaryControls!.compareDocumentPosition(primaryControls!)).toBe(- Node.DOCUMENT_POSITION_PRECEDING,- );- const toolbarActions = container.querySelector<HTMLElement>('.page-controls-toolbar-actions');- expect(toolbarActions).not.toBeNull();- expect(controlDeck!).toHaveClass('grid');- expect(controlDeck!).toHaveClass('w-full');- expect(controlDeck!).toHaveClass('bg-surface-alt');- expect(controlDeck!).toContainElement(toolbarActions!);- expect(controlDeck!).toContainElement(primaryControls!);- expect(primaryControls!).toHaveClass('border');- expect(primaryControls!).toHaveClass('page-controls-filter-section');- expect(primaryControls!).toHaveClass('bg-surface');- expect(secondaryControls!).toHaveClass('border');- expect(secondaryControls!).toHaveClass('page-controls-filter-section');- expect(secondaryControls!).toHaveClass('bg-surface');- expect(toolbarActions!).toHaveClass('border');- expect(toolbarActions!).toHaveClass('page-controls-filter-section');- expect(toolbarActions!).toHaveClass('bg-surface');- expect(toolbarActions!).toHaveClass('xl:justify-self-end');- expect(toolbarActions!).not.toHaveClass('ml-auto');- expect(toolbarActions!).not.toHaveClass('border-t');- 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'),- ),- ).toBe(false);- });-- it('maps legacy exact container modes to the user-facing Containers type control', () => {- const props = makeProps({ viewMode: vi.fn(() => 'app-container' as const) });- render(() => <WorkloadsFilter {...props} />);- const typeGroup = screen.getByRole('group', { name: 'Type' });- expect(within(typeGroup).getByRole('button', { name: 'Containers' })).toHaveAttribute(- 'aria-pressed',- 'true',+ it('maps legacy container view modes onto the canonical "Containers" type chip', () => {+ render(() =>+ <WorkloadsFilter {...makeProps({ viewMode: vi.fn(() => 'app-container' as const) })} />,);- expect(screen.getByLabelText('Type', { selector: 'select' })).toHaveValue('container');- });-- it('does not show the Reset button when all filters are at defaults', () => {- const props = makeProps();- render(() => <WorkloadsFilter {...props} />);- expect(screen.queryByText('Reset')).not.toBeInTheDocument();+ expect(screen.getByRole('button', { name: /^Type: Containers/ })).toBeInTheDocument();});});- // --- Type filter interactions ----describe('type filter', () => {- it('calls setViewMode when a different type is selected', () => {- const props = makeProps();- render(() => <WorkloadsFilter {...props} />);- const typeGroup = screen.getByRole('group', { name: 'Type' });- fireEvent.click(within(typeGroup).getByRole('button', { name: 'Containers' }));- expect(props.setViewMode).toHaveBeenCalledWith('container');+ it('calls setViewMode when a different type is picked from the menu', () => {+ const setViewMode = vi.fn();+ render(() => <WorkloadsFilter {...makeProps({ setViewMode })} />);+ pickFromMenu('Type', 'VMs');+ expect(setViewMode).toHaveBeenCalledWith('vm');});});- // --- Status filter interactions ----describe('status filter', () => {- it('calls setStatusMode when a different status is selected', () => {- const props = makeProps();- render(() => <WorkloadsFilter {...props} />);- const statusGroup = screen.getByRole('group', { name: 'Status' });- fireEvent.click(within(statusGroup).getByRole('button', { name: 'Running' }));- expect(props.setStatusMode).toHaveBeenCalledWith('running');+ it('calls setStatusMode when a different status is picked from the menu', () => {+ const setStatusMode = vi.fn();+ render(() => <WorkloadsFilter {...makeProps({ setStatusMode })} />);+ pickFromMenu('Status', 'Running');+ expect(setStatusMode).toHaveBeenCalledWith('running');});});- // --- Grouping mode ----describe('grouping mode', () => {- it('uses the canonical grouped/list table-mode titles', () => {- const props = makeProps();- render(() => <WorkloadsFilter {...props} />);- expect(screen.getByRole('button', { name: 'Grouped' })).toHaveAttribute(- 'title',- 'Grouped table view',- );- expect(screen.getByRole('button', { name: 'List' })).toHaveAttribute(- 'title',- 'Flat list view',- );+ it('calls setGroupingMode("flat") when the List view-option is clicked', () => {+ const setGroupingMode = vi.fn();+ render(() => <WorkloadsFilter {...makeProps({ setGroupingMode })} />);+ fireEvent.click(screen.getByRole('button', { name: 'List' }));+ expect(setGroupingMode).toHaveBeenCalledWith('flat');});- it('calls setGroupingMode("flat") when List button is clicked', () => {- const props = makeProps();- render(() => <WorkloadsFilter {...props} />);- fireEvent.click(screen.getByText('List'));- expect(props.setGroupingMode).toHaveBeenCalledWith('flat');+ it('calls setGroupingMode("grouped") when the Grouped view-option is clicked', () => {+ const setGroupingMode = vi.fn();+ render(() =>+ <WorkloadsFilter+ {...makeProps({ groupingMode: vi.fn(() => 'flat' as const), setGroupingMode })}+ />,+ );+ fireEvent.click(screen.getByRole('button', { name: 'Grouped' }));+ expect(setGroupingMode).toHaveBeenCalledWith('grouped');});+ });- it('calls setGroupingMode("grouped") when Grouped button is clicked', () => {- const props = makeProps({ groupingMode: vi.fn(() => 'flat' as const) });- render(() => <WorkloadsFilter {...props} />);- fireEvent.click(screen.getByText('Grouped'));- expect(props.setGroupingMode).toHaveBeenCalledWith('grouped');+ describe('clear all', () => {+ it('does not render when all filters are at their defaults', () => {+ render(() => <WorkloadsFilter {...makeProps()} />);+ expect(screen.queryByRole('button', { name: 'Clear all' })).not.toBeInTheDocument();});- });- // --- Reset button ---+ it('renders when search is non-empty', () => {+ render(() =>+ <WorkloadsFilter {...makeProps({ search: vi.fn(() => 'foo') })} />,+ );+ expect(screen.getByRole('button', { name: 'Clear all' })).toBeInTheDocument();+ });- describe('reset button', () => {- it('shows when search is non-empty', () => {- const props = makeProps({ search: vi.fn(() => 'hello') });- render(() => <WorkloadsFilter {...props} />);- expect(screen.getByText('Reset')).toBeInTheDocument();+ it('renders when viewMode is not the default', () => {+ render(() =>+ <WorkloadsFilter {...makeProps({ viewMode: vi.fn(() => 'vm' as const) })} />,+ );+ expect(screen.getByRole('button', { name: 'Clear all' })).toBeInTheDocument();});- it('shows when viewMode is not "all"', () => {- const props = makeProps({ viewMode: vi.fn(() => 'vm' as const) });- render(() => <WorkloadsFilter {...props} />);- expect(screen.getByText('Reset')).toBeInTheDocument();+ it('renders when statusMode is not the default', () => {+ render(() =>+ <WorkloadsFilter {...makeProps({ statusMode: vi.fn(() => 'running' as const) })} />,+ );+ expect(screen.getByRole('button', { name: 'Clear all' })).toBeInTheDocument();});- it('shows when statusMode is not "all"', () => {- const props = makeProps({ statusMode: vi.fn(() => 'running' as const) });- render(() => <WorkloadsFilter {...props} />);- expect(screen.getByText('Reset')).toBeInTheDocument();+ it('renders when groupingMode is "flat"', () => {+ render(() =>+ <WorkloadsFilter {...makeProps({ groupingMode: vi.fn(() => 'flat' as const) })} />,+ );+ expect(screen.getByRole('button', { name: 'Clear all' })).toBeInTheDocument();});- it('shows when groupingMode is "flat"', () => {- const props = makeProps({ groupingMode: vi.fn(() => 'flat' as const) });- render(() => <WorkloadsFilter {...props} />);- expect(screen.getByText('Reset')).toBeInTheDocument();+ it('renders when a host filter is active', () => {+ render(() =>+ <WorkloadsFilter+ {...makeProps({+ hostFilter: {+ value: 'pve1',+ options: [+ { value: '', label: 'All nodes' },+ { value: 'pve1', label: 'pve1' },+ ],+ onChange: vi.fn(),+ },+ })}+ />,+ );+ expect(screen.getByRole('button', { name: 'Clear all' })).toBeInTheDocument();});- it('shows when a host filter is active', () => {- const props = makeProps({- hostFilter: {- value: 'host-1',- options: [- { value: '', label: 'All' },- { value: 'host-1', label: 'Host 1' },- ],- onChange: vi.fn(),- },- });- render(() => <WorkloadsFilter {...props} />);- expect(screen.getByText('Reset')).toBeInTheDocument();+ it('renders when a container runtime filter is active', () => {+ render(() =>+ <WorkloadsFilter+ {...makeProps({+ viewMode: vi.fn(() => 'container' as const),+ containerRuntimeFilter: {+ value: 'docker',+ options: [+ { value: '', label: 'All runtimes' },+ { value: 'docker', label: 'docker' },+ ],+ onChange: vi.fn(),+ },+ })}+ />,+ );+ expect(screen.getByRole('button', { name: 'Clear all' })).toBeInTheDocument();});- it('resets all filters when clicked', () => {+ it('resets all canonical filter state when clicked', () => {+ const setSearch = vi.fn();+ const setViewMode = vi.fn();+ const setStatusMode = vi.fn();+ const setGroupingMode = vi.fn();+ const setSortKey = vi.fn();+ const setSortDirection = vi.fn();const hostOnChange = vi.fn();const platformOnChange = vi.fn();const namespaceOnChange = vi.fn();- const props = makeProps({- search: vi.fn(() => 'test'),- viewMode: vi.fn(() => 'vm' as const),- statusMode: vi.fn(() => 'running' as const),- groupingMode: vi.fn(() => 'flat' as const),- hostFilter: {- value: 'host-1',- options: [- { value: '', label: 'All' },- { value: 'host-1', label: 'Host 1' },- ],- onChange: hostOnChange,- },- platformFilter: {- value: 'truenas',- options: [- { value: '', label: 'All platforms' },- { value: 'truenas', label: 'TrueNAS' },- ],- onChange: platformOnChange,- },- namespaceFilter: {- value: 'ns-1',- options: [- { value: '', label: 'All' },- { value: 'ns-1', label: 'NS 1' },- ],- onChange: namespaceOnChange,- },- });- render(() => <WorkloadsFilter {...props} />);+ const runtimeOnChange = vi.fn();- fireEvent.click(screen.getByText('Reset'));+ render(() =>+ <WorkloadsFilter+ {...makeProps({+ search: vi.fn(() => 'foo'),+ setSearch,+ setViewMode,+ setStatusMode,+ setGroupingMode,+ setSortKey,+ setSortDirection,+ hostFilter: {+ value: 'pve1',+ options: [+ { value: '', label: 'All nodes' },+ { value: 'pve1', label: 'pve1' },+ ],+ onChange: hostOnChange,+ },+ platformFilter: {+ value: 'proxmox',+ options: [+ { value: '', label: 'All platforms' },+ { value: 'proxmox', label: 'Proxmox' },+ ],+ onChange: platformOnChange,+ },+ namespaceFilter: {+ value: 'default',+ options: [+ { value: '', label: 'All namespaces' },+ { value: 'default', label: 'default' },+ ],+ onChange: namespaceOnChange,+ },+ containerRuntimeFilter: {+ value: 'docker',+ options: [+ { value: '', label: 'All runtimes' },+ { value: 'docker', label: 'docker' },+ ],+ onChange: runtimeOnChange,+ },+ })}+ />,+ );++ fireEvent.click(screen.getByRole('button', { name: 'Clear all' }));- expect(props.setSearch).toHaveBeenCalledWith('');- expect(props.setSortKey).toHaveBeenCalledWith(DEFAULT_WORKLOADS_SORT_KEY);- expect(props.setSortDirection).toHaveBeenCalledWith('asc');- expect(props.setViewMode).toHaveBeenCalledWith('all');- expect(props.setStatusMode).toHaveBeenCalledWith('all');- expect(props.setGroupingMode).toHaveBeenCalledWith('grouped');+ expect(setSearch).toHaveBeenCalledWith('');+ expect(setSortKey).toHaveBeenCalledWith(DEFAULT_WORKLOADS_SORT_KEY);+ expect(setSortDirection).toHaveBeenCalledWith(DEFAULT_WORKLOADS_SORT_DIRECTION);+ expect(setViewMode).toHaveBeenCalledWith(DEFAULT_WORKLOADS_VIEW_MODE);+ expect(setStatusMode).toHaveBeenCalledWith(DEFAULT_WORKLOADS_STATUS_MODE);+ expect(setGroupingMode).toHaveBeenCalledWith(DEFAULT_WORKLOADS_GROUPING_MODE);expect(hostOnChange).toHaveBeenCalledWith('');expect(platformOnChange).toHaveBeenCalledWith('');expect(namespaceOnChange).toHaveBeenCalledWith('');- });-- it('does not reset containerRuntimeFilter when clicked', () => {- const runtimeOnChange = vi.fn();- const props = makeProps({- search: vi.fn(() => 'test'),- viewMode: vi.fn(() => 'app-container' as const),- containerRuntimeFilter: {- value: 'podman',- options: [- { value: '', label: 'All Runtimes' },- { value: 'podman', label: 'Podman' },- ],- onChange: runtimeOnChange,- },- });- render(() => <WorkloadsFilter {...props} />);-- fireEvent.click(screen.getByText('Reset'));-- expect(runtimeOnChange).not.toHaveBeenCalled();- });-- it('shows when a container runtime filter is active', () => {- const props = makeProps({- viewMode: vi.fn(() => 'app-container' as const),- containerRuntimeFilter: {- value: 'podman',- options: [- { value: '', label: 'All Runtimes' },- { value: 'podman', label: 'Podman' },- ],- onChange: vi.fn(),- },- });- render(() => <WorkloadsFilter {...props} />);- expect(screen.getByText('Reset')).toBeInTheDocument();+ expect(runtimeOnChange).toHaveBeenCalledWith('');});});- // --- Host filter ----describe('host filter', () => {- it('renders when hostFilter prop is provided', () => {- const props = makeProps({- hostFilter: {- value: '',- options: [- { value: '', label: 'All Hosts' },- { value: 'host-1', label: 'Host 1' },- ],- onChange: vi.fn(),- },- });- render(() => <WorkloadsFilter {...props} />);- expect(screen.getByLabelText('Agent')).toBeInTheDocument();+ it('appears in the "+ Filter" menu when hostFilter prop is provided', () => {+ render(() =>+ <WorkloadsFilter+ {...makeProps({+ hostFilter: {+ value: '',+ options: [+ { value: '', label: 'All nodes' },+ { value: 'pve1', label: 'pve1' },+ ],+ onChange: vi.fn(),+ },+ })}+ />,+ );+ openAddFilterMenu();+ expect(screen.getByRole('menuitem', { name: 'Agent' })).toBeInTheDocument();});- it('does not render when hostFilter prop is absent', () => {- const props = makeProps();- render(() => <WorkloadsFilter {...props} />);- expect(screen.queryByLabelText('Agent')).not.toBeInTheDocument();+ it('does not appear when hostFilter prop is absent', () => {+ render(() => <WorkloadsFilter {...makeProps()} />);+ openAddFilterMenu();+ expect(screen.queryByRole('menuitem', { name: 'Agent' })).not.toBeInTheDocument();});- it('calls onChange when host selection changes', () => {+ it('calls onChange when host selection changes via chip popover', () => {const onChange = vi.fn();- const props = makeProps({- hostFilter: {- value: '',- options: [- { value: '', label: 'All Hosts' },- { value: 'host-1', label: 'Host 1' },- ],- onChange,- },- });- render(() => <WorkloadsFilter {...props} />);- fireEvent.change(screen.getByLabelText('Agent'), { target: { value: 'host-1' } });- expect(onChange).toHaveBeenCalledWith('host-1');+ render(() =>+ <WorkloadsFilter+ {...makeProps({+ hostFilter: {+ value: '',+ options: [+ { value: '', label: 'All nodes' },+ { value: 'pve1', label: 'pve1' },+ ],+ onChange,+ },+ })}+ />,+ );+ pickFromMenu('Agent', 'pve1');+ expect(onChange).toHaveBeenCalledWith('pve1');});- it('uses custom label when provided', () => {- const props = makeProps({- hostFilter: {- label: 'Node',- value: '',- options: [{ value: '', label: 'All' }],- onChange: vi.fn(),- },- });- render(() => <WorkloadsFilter {...props} />);- expect(screen.getByText('Node')).toBeInTheDocument();+ it('uses a custom label when hostFilter.label is provided', () => {+ render(() =>+ <WorkloadsFilter+ {...makeProps({+ hostFilter: {+ label: 'K8s cluster',+ value: '',+ options: [{ value: '', label: 'All clusters' }],+ onChange: vi.fn(),+ },+ })}+ />,+ );+ openAddFilterMenu();+ expect(screen.getByRole('menuitem', { name: 'K8s cluster' })).toBeInTheDocument();});});describe('platform filter', () => {- it('renders when platformFilter prop is provided', () => {- const props = makeProps({- platformFilter: {- value: '',- options: [- { value: '', label: 'All platforms' },- { value: 'truenas', label: 'TrueNAS' },- ],- onChange: vi.fn(),- },- });- render(() => <WorkloadsFilter {...props} />);- expect(screen.getByLabelText('Platform')).toBeInTheDocument();+ it('appears in the menu when platformFilter prop is provided', () => {+ render(() =>+ <WorkloadsFilter+ {...makeProps({+ platformFilter: {+ value: '',+ options: [+ { value: '', label: 'All platforms' },+ { value: 'proxmox', label: 'Proxmox' },+ ],+ onChange: vi.fn(),+ },+ })}+ />,+ );+ openAddFilterMenu();+ expect(screen.getByRole('menuitem', { name: 'Platform' })).toBeInTheDocument();});- it('calls onChange when platform selection changes', () => {+ it('calls onChange when platform selection changes via chip popover', () => {const onChange = vi.fn();- const props = makeProps({- platformFilter: {- value: '',- options: [- { value: '', label: 'All platforms' },- { value: 'truenas', label: 'TrueNAS' },- ],- onChange,- },- });- render(() => <WorkloadsFilter {...props} />);- fireEvent.change(screen.getByLabelText('Platform'), { target: { value: 'truenas' } });- expect(onChange).toHaveBeenCalledWith('truenas');- });-- it('keeps the controlled platform value when async options arrive later', () => {- const baseProps = makeProps();- const [platformOptions, setPlatformOptions] = createSignal([- { value: '', label: 'All platforms' },- ]);-- render(() => (+ render(() =><WorkloadsFilter- {...baseProps}- platformFilter={{- value: 'truenas',- options: platformOptions(),- onChange: vi.fn(),- }}- />- ));-- setPlatformOptions([- { value: '', label: 'All platforms' },- { value: 'truenas', label: 'TrueNAS' },- ]);-- expect(screen.getByLabelText('Platform')).toHaveValue('truenas');- expect(screen.getByRole('option', { name: 'TrueNAS' })).toBeInTheDocument();+ {...makeProps({+ platformFilter: {+ value: '',+ options: [+ { value: '', label: 'All platforms' },+ { value: 'proxmox', label: 'Proxmox' },+ ],+ onChange,+ },+ })}+ />,+ );+ pickFromMenu('Platform', 'Proxmox');+ expect(onChange).toHaveBeenCalledWith('proxmox');});});- // --- Namespace filter ----describe('namespace filter', () => {- it('renders when namespaceFilter prop is provided', () => {- const props = makeProps({- namespaceFilter: {- value: '',- options: [- { value: '', label: 'All Namespaces' },- { value: 'default', label: 'default' },- ],- onChange: vi.fn(),- },- });- render(() => <WorkloadsFilter {...props} />);- expect(screen.getByLabelText('Namespace')).toBeInTheDocument();+ it('appears in the menu when namespaceFilter prop is provided', () => {+ render(() =>+ <WorkloadsFilter+ {...makeProps({+ namespaceFilter: {+ value: '',+ options: [+ { value: '', label: 'All namespaces' },+ { value: 'default', label: 'default' },+ ],+ onChange: vi.fn(),+ },+ })}+ />,+ );+ openAddFilterMenu();+ expect(screen.getByRole('menuitem', { name: 'Namespace' })).toBeInTheDocument();});- it('calls onChange when namespace selection changes', () => {+ it('calls onChange when namespace selection changes via chip popover', () => {const onChange = vi.fn();- const props = makeProps({- namespaceFilter: {- value: '',- options: [- { value: '', label: 'All Namespaces' },- { value: 'kube-system', label: 'kube-system' },- ],- onChange,- },- });- render(() => <WorkloadsFilter {...props} />);- fireEvent.change(screen.getByLabelText('Namespace'), { target: { value: 'kube-system' } });- expect(onChange).toHaveBeenCalledWith('kube-system');+ render(() =>+ <WorkloadsFilter+ {...makeProps({+ namespaceFilter: {+ value: '',+ options: [+ { value: '', label: 'All namespaces' },+ { value: 'default', label: 'default' },+ ],+ onChange,+ },+ })}+ />,+ );+ pickFromMenu('Namespace', 'default');+ expect(onChange).toHaveBeenCalledWith('default');});});- // --- Container runtime filter ----describe('container runtime filter', () => {- it('renders only when viewMode is "app-container" and containerRuntimeFilter is provided', () => {+ it('appears in the menu only when viewMode is a container variant and containerRuntimeFilter is provided', () => {const props = makeProps({- viewMode: vi.fn(() => 'app-container' as const),+ viewMode: vi.fn(() => 'container' as const),containerRuntimeFilter: {value: '',options: [- { value: '', label: 'All Runtimes' },- { value: 'docker', label: 'Docker' },+ { value: '', label: 'All runtimes' },+ { value: 'docker', label: 'docker' },],onChange: vi.fn(),},});render(() => <WorkloadsFilter {...props} />);- expect(screen.getByLabelText('Runtime')).toBeInTheDocument();+ openAddFilterMenu();+ expect(screen.getByRole('menuitem', { name: 'Runtime' })).toBeInTheDocument();});- it('does not render when viewMode is not "app-container"', () => {+ it('does not appear when viewMode is not a container variant', () => {const props = makeProps({- viewMode: vi.fn(() => 'all' as const),+ viewMode: vi.fn(() => 'vm' as const),containerRuntimeFilter: {value: '',options: [- { value: '', label: 'All Runtimes' },- { value: 'docker', label: 'Docker' },+ { value: '', label: 'All runtimes' },+ { value: 'docker', label: 'docker' },],onChange: vi.fn(),},});render(() => <WorkloadsFilter {...props} />);- expect(screen.queryByLabelText('Runtime')).not.toBeInTheDocument();+ openAddFilterMenu();+ expect(screen.queryByRole('menuitem', { name: 'Runtime' })).not.toBeInTheDocument();});- it('calls onChange when runtime selection changes', () => {+ it('calls onChange when runtime selection changes via chip popover', () => {const onChange = vi.fn();- const props = makeProps({- viewMode: vi.fn(() => 'app-container' as const),- containerRuntimeFilter: {- value: '',- options: [- { value: '', label: 'All Runtimes' },- { value: 'podman', label: 'Podman' },- ],- onChange,- },- });- render(() => <WorkloadsFilter {...props} />);- fireEvent.change(screen.getByLabelText('Runtime'), { target: { value: 'podman' } });- expect(onChange).toHaveBeenCalledWith('podman');+ render(() =>+ <WorkloadsFilter+ {...makeProps({+ viewMode: vi.fn(() => 'container' as const),+ containerRuntimeFilter: {+ value: '',+ options: [+ { value: '', label: 'All runtimes' },+ { value: 'docker', label: 'docker' },+ ],+ onChange,+ },+ })}+ />,+ );+ pickFromMenu('Runtime', 'docker');+ expect(onChange).toHaveBeenCalledWith('docker');});});- // --- Charts toggle ----describe('charts toggle', () => {- it('renders Charts button when onChartsToggle is provided', () => {- const props = makeProps({- chartsCollapsed: vi.fn(() => false),- onChartsToggle: vi.fn(),- });- render(() => <WorkloadsFilter {...props} />);- const chartsButton = screen.getByRole('button', { name: 'Hide charts' });- expect(chartsButton).toBeInTheDocument();- expect(chartsButton).toHaveTextContent('Charts');- expect(chartsButton).toHaveAttribute('aria-pressed', 'true');- expect(chartsButton).toHaveAttribute('title', 'Hide charts');+ it('renders the Charts button when onChartsToggle is provided', () => {+ render(() =>+ <WorkloadsFilter+ {...makeProps({+ chartsCollapsed: vi.fn(() => false),+ onChartsToggle: vi.fn(),+ })}+ />,+ );+ expect(screen.getByRole('button', { name: 'Hide charts' })).toBeInTheDocument();});it('labels the Charts button as a show action when charts are collapsed', () => {- const props = makeProps({- chartsCollapsed: vi.fn(() => true),- onChartsToggle: vi.fn(),- });- render(() => <WorkloadsFilter {...props} />);- const chartsButton = screen.getByRole('button', { name: 'Show charts' });- expect(chartsButton).toHaveTextContent('Charts');- expect(chartsButton).toHaveAttribute('aria-pressed', 'false');- expect(chartsButton).toHaveAttribute('title', 'Show charts');- });-- it('does not render Charts button when onChartsToggle is not provided', () => {- const props = makeProps();- render(() => <WorkloadsFilter {...props} />);- expect(screen.queryByText('Charts')).not.toBeInTheDocument();- });-- it('calls onChartsToggle when Charts button is clicked', () => {- const onChartsToggle = vi.fn();- const props = makeProps({- chartsCollapsed: vi.fn(() => false),- onChartsToggle,- });- render(() => <WorkloadsFilter {...props} />);- fireEvent.click(screen.getByRole('button', { name: 'Hide charts' }));- expect(onChartsToggle).toHaveBeenCalled();+ render(() =>+ <WorkloadsFilter+ {...makeProps({+ chartsCollapsed: vi.fn(() => true),+ onChartsToggle: vi.fn(),+ })}+ />,+ );+ expect(screen.getByRole('button', { name: 'Show charts' })).toBeInTheDocument();});});- // --- Column picker ----describe('column picker', () => {- it('renders ColumnPicker when all column props are provided', () => {- const props = makeProps({- columnVisibility: {- availableColumns: [{ id: 'cpu', label: 'CPU' }],- isColumnHidden: vi.fn(() => false),- onColumnToggle: vi.fn(),- },- });- render(() => <WorkloadsFilter {...props} />);+ it('renders ColumnPicker when columnVisibility is provided', () => {+ render(() =>+ <WorkloadsFilter+ {...makeProps({+ columnVisibility: {+ availableColumns: [{ id: 'cpu', label: 'CPU', toggleable: true }],+ isColumnHidden: () => false,+ onColumnToggle: vi.fn(),+ onColumnReset: vi.fn(),+ },+ })}+ />,+ );expect(screen.getByTestId('column-picker')).toBeInTheDocument();});- it('does not render ColumnPicker when column props are missing', () => {- const props = makeProps();- render(() => <WorkloadsFilter {...props} />);+ it('does not render ColumnPicker when columnVisibility is absent', () => {+ render(() => <WorkloadsFilter {...makeProps()} />);expect(screen.queryByTestId('column-picker')).not.toBeInTheDocument();});});-- // --- Mobile behavior ----- describe('mobile behavior', () => {- it('shows the Filters toggle button on mobile', () => {- isMobileMock.mockReturnValue(true);- const props = makeProps();- render(() => <WorkloadsFilter {...props} />);- expect(screen.getByText('Filters')).toBeInTheDocument();- });-- it('hides filter controls on mobile by default', () => {- isMobileMock.mockReturnValue(true);- const props = makeProps();- render(() => <WorkloadsFilter {...props} />);- // The Type filter should not be visible until Filters is toggled- expect(screen.queryByLabelText('Type', { selector: 'select' })).not.toBeInTheDocument();- });-- it('shows filter controls when Filters toggle is clicked on mobile', () => {- isMobileMock.mockReturnValue(true);- const props = makeProps();- render(() => <WorkloadsFilter {...props} />);- fireEvent.click(screen.getByText('Filters'));- expect(screen.getByLabelText('Type', { selector: 'select' })).toBeInTheDocument();- expect(screen.getByLabelText('Status', { selector: 'select' })).toBeInTheDocument();- });-- it('hides filter controls when Filters toggle is clicked again', () => {- isMobileMock.mockReturnValue(true);- const props = makeProps();- render(() => <WorkloadsFilter {...props} />);- const toggle = screen.getByText('Filters');- fireEvent.click(toggle);- expect(screen.getByLabelText('Type', { selector: 'select' })).toBeInTheDocument();- fireEvent.click(toggle);- expect(screen.queryByLabelText('Type', { selector: 'select' })).not.toBeInTheDocument();- });-- it('shows active filter count badge on mobile when filters are active', () => {- isMobileMock.mockReturnValue(true);- const props = makeProps({- search: vi.fn(() => 'test'),- viewMode: vi.fn(() => 'vm' as const),- });- render(() => <WorkloadsFilter {...props} />);- // The badge should show "2" (search + viewMode)- expect(screen.getByText('2')).toBeInTheDocument();- });-- it('does not show filter count badge when no filters are active', () => {- isMobileMock.mockReturnValue(true);- const props = makeProps();- render(() => <WorkloadsFilter {...props} />);- // The badge is a span inside the Filters button — when count is 0, no badge renders.- // Verify no numeric badge appears near the Filters button.- const filtersButton = screen.getByText('Filters');- const badge = filtersButton.parentElement?.querySelector('span.rounded-full');- expect(badge).toBeNull();- });- });-- // --- Active filter count (desktop — badge not shown but logic still runs) ----- describe('activeFilterCount memo', () => {- it('counts search + viewMode + statusMode + hostFilter + namespaceFilter', () => {- isMobileMock.mockReturnValue(true);- const props = makeProps({- search: vi.fn(() => ' query '),- viewMode: vi.fn(() => 'pod' as const),- statusMode: vi.fn(() => 'degraded' as const),- hostFilter: {- value: 'h1',- options: [- { value: '', label: 'All' },- { value: 'h1', label: 'H1' },- ],- onChange: vi.fn(),- },- namespaceFilter: {- value: 'ns',- options: [- { value: '', label: 'All' },- { value: 'ns', label: 'NS' },- ],- onChange: vi.fn(),- },- });- render(() => <WorkloadsFilter {...props} />);- // 5 active: search, viewMode, statusMode, host, namespace- expect(screen.getByText('5')).toBeInTheDocument();- });-- it('does not count container runtime as an active filter', () => {- isMobileMock.mockReturnValue(true);- const props = makeProps({- viewMode: vi.fn(() => 'app-container' as const),- containerRuntimeFilter: {- value: 'docker',- options: [- { value: '', label: 'All runtimes' },- { value: 'docker', label: 'Docker' },- ],- onChange: vi.fn(),- },- });- render(() => <WorkloadsFilter {...props} />);- expect(screen.getByText('1')).toBeInTheDocument();- });-- it('does not count whitespace-only search as active', () => {- isMobileMock.mockReturnValue(true);- const props = makeProps({ search: vi.fn(() => ' ') });- render(() => <WorkloadsFilter {...props} />);- expect(screen.queryByText('1')).not.toBeInTheDocument();- });- });});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.tsxindex 1f95971625..446d4e2b0b 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@@ -786,7 +786,14 @@ describe('Workloads performance contract', () => {});it('keeps workloads filter state in canonical workloads filter owners', () => {- expect(workloadsFilterSource).toContain('useWorkloadsFilterState');+ // WorkloadsFilter migrated to FilterBar — the filter component now+ // composes the chip catalog directly and reads useBreakpoint locally,+ // so the legacy useWorkloadsFilterState hook is no longer in the+ // render path. Defaults/derivations stay in workloadsFilterModel.+ expect(workloadsFilterSource).toContain('FilterBar');+ expect(workloadsFilterSource).toContain('useBreakpoint');+ expect(workloadsFilterSource).toContain('hasActiveWorkloadsFilters');+ expect(workloadsFilterSource).toContain('DEFAULT_WORKLOADS_SORT_KEY');expect(workloadsSource).not.toContain('SummaryScopeBar');expect(workloadsSource).not.toContain('searchTrailing={pinnedScopeFallback()}');expect(workloadsSource).not.toContain('mobileTrailing={pinnedScopeFallback()}');@@ -802,10 +809,8 @@ describe('Workloads performance contract', () => {expect(workloadsWorkloadTableSource).toContain('showClearSelection');expect(workloadsWorkloadTableSource).toContain('clearPinnedSummaryScope');expect(workloadsFilterSource).not.toContain('const [filtersOpen, setFiltersOpen] =');- expect(workloadsFilterSource).not.toContain('useBreakpoint');expect(workloadsFilterSource).not.toContain("props.setSortKey('name')");expect(workloadsFilterSource).toContain('searchTrailing={props.searchTrailing}');- expect(workloadsFilterSource).toContain('mobileTrailing={props.mobileTrailing}');expect(workloadsFilterStateSource).toContain('countActiveWorkloadsFilters');expect(workloadsFilterStateSource).not.toContain('props.containerRuntimeFilter?.onChange');expect(workloadsFilterStateSource).toContain('useBreakpoint');diff --git a/frontend-modern/src/components/shared/FilterBar/AddFilterMenu.tsx b/frontend-modern/src/components/shared/FilterBar/AddFilterMenu.tsxnew file mode 100644index 0000000000..e91b0d9c77--- /dev/null+++ b/frontend-modern/src/components/shared/FilterBar/AddFilterMenu.tsx@@ -0,0 +1,346 @@+import {+ Component,+ For,+ Show,+ createEffect,+ createMemo,+ createSignal,+ on,+ onCleanup,+} from 'solid-js';+import PlusIcon from 'lucide-solid/icons/plus';+import ArrowLeftIcon from 'lucide-solid/icons/arrow-left';+import SearchIcon from 'lucide-solid/icons/search';+import {+ isFilterSet,+ type FilterDef,+ type FilterGroupKey,+ type FilterSelectOption,+} from './filterCatalog';++interface AddFilterMenuProps {+ filters: FilterDef[];+}++const GROUP_LABELS: Record<FilterGroupKey, string> = {+ scope: 'Scope',+ status: 'Status',+ properties: 'Properties',+};++const GROUP_ORDER: FilterGroupKey[] = ['scope', 'status', 'properties'];++const matchesQuery = (label: string, query: string): boolean =>+ label.toLowerCase().includes(query);++export const AddFilterMenu: Component<AddFilterMenuProps> = (props) => {+ const [open, setOpen] = createSignal(false);+ const [activeFilterId, setActiveFilterId] = createSignal<string | null>(null);+ const [query, setQuery] = createSignal('');+ const [activeIndex, setActiveIndex] = createSignal(0);+ let containerRef: HTMLDivElement | undefined;+ let searchInputRef: HTMLInputElement | undefined;++ const close = () => {+ setOpen(false);+ setActiveFilterId(null);+ setQuery('');+ setActiveIndex(0);+ };++ const handleClickOutside = (event: MouseEvent) => {+ if (containerRef && !containerRef.contains(event.target as Node)) {+ close();+ }+ };++ const handleEscape = (event: KeyboardEvent) => {+ if (event.key !== 'Escape') return;+ if (activeFilterId()) {+ setActiveFilterId(null);+ setQuery('');+ setActiveIndex(0);+ return;+ }+ close();+ };++ createEffect(() => {+ if (!open()) return;+ document.addEventListener('mousedown', handleClickOutside);+ document.addEventListener('keydown', handleEscape);+ onCleanup(() => {+ document.removeEventListener('mousedown', handleClickOutside);+ document.removeEventListener('keydown', handleEscape);+ });+ });++ // Reset query + active index whenever the menu opens or its phase changes+ // (filter list ↔ value sub-menu). Auto-focus the search input after the+ // phase change so typing is captured immediately.+ createEffect(+ on([open, activeFilterId], () => {+ setQuery('');+ setActiveIndex(0);+ if (open()) {+ queueMicrotask(() => searchInputRef?.focus());+ }+ }),+ );++ const availableFilters = createMemo(() => props.filters.filter((f) => !isFilterSet(f)));++ const groupedAvailable = createMemo(() => {+ const groups = new Map<FilterGroupKey, FilterDef[]>();+ for (const filter of availableFilters()) {+ const key: FilterGroupKey = filter.group ?? 'properties';+ const bucket = groups.get(key);+ if (bucket) {+ bucket.push(filter);+ } else {+ groups.set(key, [filter]);+ }+ }+ return GROUP_ORDER.filter((key) => groups.has(key)).map((key) => ({+ key,+ filters: groups.get(key)!,+ }));+ });++ const activeFilter = createMemo(() => {+ const id = activeFilterId();+ if (!id) return null;+ return props.filters.find((filter) => filter.id === id) ?? null;+ });++ const activeFilterPickableOptions = createMemo(() => {+ const filter = activeFilter();+ if (!filter) return [];+ return filter.options().filter((option) => option.value !== filter.defaultValue);+ });++ const filteredGroupedAvailable = createMemo(() => {+ const q = query().trim().toLowerCase();+ if (!q) return groupedAvailable();+ return groupedAvailable()+ .map((group) => ({+ key: group.key,+ filters: group.filters.filter((filter) => matchesQuery(filter.label, q)),+ }))+ .filter((group) => group.filters.length > 0);+ });++ const flatVisibleFilters = createMemo<FilterDef[]>(() =>+ filteredGroupedAvailable().flatMap((group) => group.filters),+ );++ const filteredOptions = createMemo<FilterSelectOption[]>(() => {+ const q = query().trim().toLowerCase();+ const options = activeFilterPickableOptions();+ if (!q) return options;+ return options.filter((option) => matchesQuery(option.label, q));+ });++ const isDisabled = () => availableFilters().length === 0;++ const navigableLength = () =>+ activeFilter() ? filteredOptions().length : flatVisibleFilters().length;++ // Clamp active index whenever the navigable list shrinks (e.g. typing+ // narrows the result set).+ createEffect(() => {+ const length = navigableLength();+ if (length === 0) {+ if (activeIndex() !== 0) setActiveIndex(0);+ return;+ }+ if (activeIndex() >= length) setActiveIndex(length - 1);+ });++ const commitActive = () => {+ const length = navigableLength();+ if (length === 0) return;+ const index = Math.max(0, Math.min(activeIndex(), length - 1));+ const filter = activeFilter();+ if (filter) {+ const option = filteredOptions()[index];+ if (option) {+ filter.setValue(option.value);+ close();+ }+ return;+ }+ const next = flatVisibleFilters()[index];+ if (next) {+ setActiveFilterId(next.id);+ }+ };++ const handleSearchKeyDown = (event: KeyboardEvent) => {+ const length = navigableLength();+ if (event.key === 'ArrowDown') {+ event.preventDefault();+ if (length === 0) return;+ setActiveIndex((index) => (index + 1) % length);+ } else if (event.key === 'ArrowUp') {+ event.preventDefault();+ if (length === 0) return;+ setActiveIndex((index) => (index - 1 + length) % length);+ } else if (event.key === 'Enter') {+ event.preventDefault();+ commitActive();+ } else if (event.key === 'Backspace' && query() === '' && activeFilterId()) {+ event.preventDefault();+ setActiveFilterId(null);+ }+ };++ const isActiveFilterIndex = (index: number) =>+ !activeFilter() && activeIndex() === index;+ const isActiveOptionIndex = (index: number) =>+ Boolean(activeFilter()) && activeIndex() === index;++ return (+ <div ref={containerRef} class="relative inline-flex">+ <button+ type="button"+ onClick={() => {+ if (isDisabled()) return;+ setOpen((value) => !value);+ }}+ disabled={isDisabled()}+ aria-haspopup="menu"+ aria-expanded={open()}+ class="inline-flex items-center gap-1 rounded-md border border-dashed border-border px-2 py-0.5 text-xs text-muted transition-colors hover:bg-surface-hover hover:text-base-content disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-muted"+ >+ <PlusIcon class="h-3 w-3" />+ Filter+ </button>++ <Show when={open()}>+ <div+ role="menu"+ class="absolute left-0 top-[calc(100%+0.25rem)] z-50 w-64 max-w-[calc(100vw-2rem)] rounded-md border border-border bg-surface shadow-lg"+ >+ <Show when={activeFilter()}>+ {(filter) => (+ <button+ type="button"+ onClick={() => {+ setActiveFilterId(null);+ setQuery('');+ }}+ class="flex w-full items-center gap-1.5 border-b border-border-subtle px-3 py-2 text-left text-[10px] font-semibold uppercase tracking-wide text-muted hover:bg-surface-hover"+ >+ <ArrowLeftIcon class="h-3 w-3" />+ {filter().label}+ </button>+ )}+ </Show>++ <div class="relative border-b border-border-subtle">+ <SearchIcon class="pointer-events-none absolute left-2.5 top-1/2 h-3 w-3 -translate-y-1/2 text-muted" />+ <input+ ref={searchInputRef}+ type="text"+ value={query()}+ onInput={(event) => setQuery(event.currentTarget.value)}+ onKeyDown={handleSearchKeyDown}+ placeholder={activeFilter() ? 'Filter values...' : 'Filter filters...'}+ aria-label={activeFilter() ? 'Filter values' : 'Filter filters'}+ class="w-full bg-transparent py-1.5 pl-7 pr-2 text-xs text-base-content placeholder-muted outline-none"+ />+ </div>++ <Show+ when={activeFilter()}+ fallback={+ <div class="max-h-64 overflow-y-auto py-1">+ <Show+ when={flatVisibleFilters().length > 0}+ fallback={+ <div class="px-3 py-2 text-xs text-muted">No filters match.</div>+ }+ >+ {(() => {+ let cursor = 0;+ return (+ <For each={filteredGroupedAvailable()}>+ {(group) => {+ const groupItems = group.filters.map((filter) => ({+ filter,+ index: cursor++,+ }));+ return (+ <div>+ <div class="px-3 pt-2 pb-1 text-[10px] font-semibold uppercase tracking-wide text-muted">+ {GROUP_LABELS[group.key]}+ </div>+ <For each={groupItems}>+ {(item) => (+ <button+ type="button"+ role="menuitem"+ onMouseEnter={() => setActiveIndex(item.index)}+ onClick={() => setActiveFilterId(item.filter.id)}+ class={`flex w-full items-center justify-between px-3 py-1.5 text-left text-xs text-base-content hover:bg-surface-hover ${+ isActiveFilterIndex(item.index)+ ? 'bg-surface-hover'+ : ''+ }`}+ >+ <span>{item.filter.label}</span>+ <span class="text-muted" aria-hidden="true">+ {item.filter.options().length}+ </span>+ </button>+ )}+ </For>+ </div>+ );+ }}+ </For>+ );+ })()}+ </Show>+ </div>+ }+ >+ {(filter) => (+ <div class="max-h-64 overflow-y-auto py-1">+ <Show+ when={filteredOptions().length > 0}+ fallback={+ <div class="px-3 py-2 text-xs text-muted">+ {activeFilterPickableOptions().length === 0+ ? 'No options available.'+ : 'No options match.'}+ </div>+ }+ >+ <For each={filteredOptions()}>+ {(option, index) => (+ <button+ type="button"+ onMouseEnter={() => setActiveIndex(index())}+ onClick={() => {+ filter().setValue(option.value);+ close();+ }}+ class={`flex w-full items-center px-3 py-1.5 text-left text-xs text-base-content hover:bg-surface-hover ${+ isActiveOptionIndex(index()) ? 'bg-surface-hover' : ''+ }`}+ >+ {option.label}+ </button>+ )}+ </For>+ </Show>+ </div>+ )}+ </Show>+ </div>+ </Show>+ </div>+ );+};diff --git a/frontend-modern/src/components/shared/FilterBar/FilterBar.tsx b/frontend-modern/src/components/shared/FilterBar/FilterBar.tsxnew file mode 100644index 0000000000..22c64598de--- /dev/null+++ b/frontend-modern/src/components/shared/FilterBar/FilterBar.tsx@@ -0,0 +1,111 @@+import { Component, For, JSX, Show, createMemo, createSignal } from 'solid-js';+import { Card } from '@/components/shared/Card';+import { FilterMobileToggleButton } from '@/components/shared/FilterToolbar';+import { SearchInput } from '@/components/shared/SearchInput';+import { AddFilterMenu } from './AddFilterMenu';+import { FilterChip } from './FilterChip';+import {+ clearFilter,+ isFilterSet,+ type FilterBarProps,+ type FilterDef,+} from './filterCatalog';++export const FilterBar: Component<FilterBarProps> = (props) => {+ const [mobileExpanded, setMobileExpanded] = createSignal(false);++ const activeFilters = createMemo<FilterDef[]>(() => props.filters.filter(isFilterSet));+ const activeCount = createMemo(() => activeFilters().length);++ const clearAll = () => {+ if (props.onClearAll) {+ props.onClearAll();+ return;+ }+ for (const filter of props.filters) clearFilter(filter);+ props.search.setValue('');+ };++ const hasClearableState = () => {+ if (props.showClearAll) return props.showClearAll() || activeCount() > 0;+ return activeCount() > 0;+ };+ const showDesktopChipRow = () => !props.isMobile() && hasClearableState();+ const showMobileBody = () => props.isMobile() && mobileExpanded();+ const showChipRow = () => showDesktopChipRow() || showMobileBody();++ const searchHistory = () => {+ const key = props.search.historyKey;+ if (!key) return undefined;+ return { storageKey: key, emptyMessage: props.search.emptyMessage };+ };++ return (+ <Card+ padding="sm"+ class="filter-bar mb-4"+ role={props.role as JSX.AriaAttributes['role']}+ aria-label={props.ariaLabel}+ >+ <div class="flex flex-col gap-2">+ <div class="flex w-full items-center gap-2">+ <div class="min-w-0 flex-1">+ <SearchInput+ value={props.search.value}+ onChange={props.search.setValue}+ placeholder={props.search.placeholder}+ class="w-full"+ typeToSearch+ clearOnEscape={props.search.clearOnEscape}+ onBeforeAutoFocus={props.search.onBeforeAutoFocus}+ history={searchHistory()}+ />+ </div>+ {props.searchTrailing}+ <Show when={!props.isMobile()}>+ <AddFilterMenu filters={props.filters} />+ <Show when={props.viewOptionsTrailing}>+ <div+ aria-hidden="true"+ class="hidden h-5 w-px bg-border-subtle sm:block"+ />+ <div class="inline-flex flex-shrink-0 items-center gap-1">+ {props.viewOptionsTrailing}+ </div>+ </Show>+ </Show>+ <Show when={props.isMobile()}>+ <FilterMobileToggleButton+ onClick={() => setMobileExpanded((value) => !value)}+ count={activeCount()}+ />+ </Show>+ </div>++ <Show when={showChipRow()}>+ <div class="flex flex-wrap items-center gap-2">+ <For each={activeFilters()}>{(filter) => <FilterChip filter={filter} />}</For>+ <Show when={showMobileBody()}>+ <AddFilterMenu filters={props.filters} />+ </Show>+ <Show when={hasClearableState()}>+ <button+ type="button"+ onClick={clearAll}+ class="ml-auto text-xs text-muted hover:text-base-content hover:underline underline-offset-2"+ >+ Clear all+ </button>+ </Show>+ </div>+ </Show>++ <Show when={showMobileBody() && props.viewOptionsTrailing}>+ <div class="flex flex-wrap items-center gap-2 border-t border-border-subtle pt-2">+ {props.viewOptionsTrailing}+ </div>+ </Show>+ </div>+ </Card>+ );+};diff --git a/frontend-modern/src/components/shared/FilterBar/FilterChip.tsx b/frontend-modern/src/components/shared/FilterBar/FilterChip.tsxnew file mode 100644index 0000000000..8f6b98ce8c--- /dev/null+++ b/frontend-modern/src/components/shared/FilterBar/FilterChip.tsx@@ -0,0 +1,207 @@+import {+ Component,+ For,+ Show,+ createEffect,+ createMemo,+ createSignal,+ on,+ onCleanup,+} from 'solid-js';+import XIcon from 'lucide-solid/icons/x';+import CheckIcon from 'lucide-solid/icons/check';+import SearchIcon from 'lucide-solid/icons/search';+import {+ clearFilter,+ formatFilterChipValue,+ type FilterDef,+} from './filterCatalog';++interface FilterChipProps {+ filter: FilterDef;+}++const matchesQuery = (label: string, query: string): boolean =>+ label.toLowerCase().includes(query);++export const FilterChip: Component<FilterChipProps> = (props) => {+ const [open, setOpen] = createSignal(false);+ const [query, setQuery] = createSignal('');+ const [activeIndex, setActiveIndex] = createSignal(0);+ let containerRef: HTMLDivElement | undefined;+ let searchInputRef: HTMLInputElement | undefined;++ const handleClickOutside = (event: MouseEvent) => {+ if (containerRef && !containerRef.contains(event.target as Node)) {+ setOpen(false);+ }+ };++ const handleEscape = (event: KeyboardEvent) => {+ if (event.key === 'Escape') setOpen(false);+ };++ createEffect(() => {+ if (!open()) return;+ document.addEventListener('mousedown', handleClickOutside);+ document.addEventListener('keydown', handleEscape);+ onCleanup(() => {+ document.removeEventListener('mousedown', handleClickOutside);+ document.removeEventListener('keydown', handleEscape);+ });+ });++ // Reset search + active index whenever the popover opens; auto-focus the+ // search input so typing narrows the value list immediately.+ createEffect(+ on(open, (isOpen) => {+ setQuery('');+ setActiveIndex(0);+ if (isOpen) {+ queueMicrotask(() => searchInputRef?.focus());+ }+ }),+ );++ const filteredOptions = createMemo(() => {+ const q = query().trim().toLowerCase();+ const all = props.filter.options();+ if (!q) return all;+ return all.filter((option) => matchesQuery(option.label, q));+ });++ // Clamp active index when the option list narrows.+ createEffect(() => {+ const length = filteredOptions().length;+ if (length === 0) {+ if (activeIndex() !== 0) setActiveIndex(0);+ return;+ }+ if (activeIndex() >= length) setActiveIndex(length - 1);+ });++ const commitActive = () => {+ const options = filteredOptions();+ if (options.length === 0) return;+ const index = Math.max(0, Math.min(activeIndex(), options.length - 1));+ const option = options[index];+ if (!option) return;+ props.filter.setValue(option.value);+ setOpen(false);+ };++ const handleSearchKeyDown = (event: KeyboardEvent) => {+ const length = filteredOptions().length;+ if (event.key === 'ArrowDown') {+ event.preventDefault();+ if (length === 0) return;+ setActiveIndex((index) => (index + 1) % length);+ } else if (event.key === 'ArrowUp') {+ event.preventDefault();+ if (length === 0) return;+ setActiveIndex((index) => (index - 1 + length) % length);+ } else if (event.key === 'Enter') {+ event.preventDefault();+ commitActive();+ }+ };++ // Seed activeIndex on the currently-selected option when the popover opens+ // so Enter without further typing keeps the existing value (no-op) rather+ // than picking the first option in the list.+ createEffect(+ on(open, (isOpen) => {+ if (!isOpen) return;+ const options = filteredOptions();+ const selectedIndex = options.findIndex(+ (option) => option.value === props.filter.value(),+ );+ if (selectedIndex >= 0) setActiveIndex(selectedIndex);+ }),+ );++ return (+ <div ref={containerRef} class="relative inline-flex">+ <div class="inline-flex items-center rounded-full border border-blue-200 bg-blue-50 text-xs dark:border-blue-900 dark:bg-blue-950/40">+ <button+ type="button"+ onClick={() => setOpen((value) => !value)}+ aria-haspopup="listbox"+ aria-expanded={open()}+ class="inline-flex items-center gap-1 rounded-l-full py-0.5 pl-2 pr-1 text-base-content hover:bg-blue-100/70 dark:hover:bg-blue-900/40"+ >+ <span class="text-muted">{props.filter.label}:</span>+ <span class="font-medium">{formatFilterChipValue(props.filter)}</span>+ </button>+ <button+ type="button"+ onClick={() => clearFilter(props.filter)}+ aria-label={`Remove ${props.filter.label} filter`}+ class="rounded-r-full py-0.5 pr-1.5 pl-1 text-muted hover:bg-blue-100 hover:text-base-content dark:hover:bg-blue-900/50"+ >+ <XIcon class="h-3 w-3" />+ </button>+ </div>++ <Show when={open()}>+ <div+ role="listbox"+ aria-label={props.filter.label}+ class="absolute left-0 top-[calc(100%+0.25rem)] z-50 w-56 max-w-[calc(100vw-2rem)] rounded-md border border-border bg-surface shadow-lg"+ >+ <div class="border-b border-border-subtle px-3 py-1.5 text-[10px] font-semibold uppercase tracking-wide text-muted">+ {props.filter.label}+ </div>+ <div class="relative border-b border-border-subtle">+ <SearchIcon class="pointer-events-none absolute left-2.5 top-1/2 h-3 w-3 -translate-y-1/2 text-muted" />+ <input+ ref={searchInputRef}+ type="text"+ value={query()}+ onInput={(event) => setQuery(event.currentTarget.value)}+ onKeyDown={handleSearchKeyDown}+ placeholder="Filter values..."+ aria-label={`Filter ${props.filter.label} values`}+ class="w-full bg-transparent py-1.5 pl-7 pr-2 text-xs text-base-content placeholder-muted outline-none"+ />+ </div>+ <div class="max-h-64 overflow-y-auto py-1">+ <Show+ when={filteredOptions().length > 0}+ fallback={+ <div class="px-3 py-2 text-xs text-muted">No values match.</div>+ }+ >+ <For each={filteredOptions()}>+ {(option, index) => {+ const isSelected = () => props.filter.value() === option.value;+ const isActive = () => activeIndex() === index();+ return (+ <button+ type="button"+ role="option"+ aria-selected={isSelected()}+ onMouseEnter={() => setActiveIndex(index())}+ onClick={() => {+ props.filter.setValue(option.value);+ setOpen(false);+ }}+ class={`flex w-full items-center justify-between px-3 py-1.5 text-left text-xs text-base-content hover:bg-surface-hover ${+ isActive() ? 'bg-surface-hover' : ''+ }`}+ >+ <span class={isSelected() ? 'font-medium' : ''}>{option.label}</span>+ <Show when={isSelected()}>+ <CheckIcon class="h-3 w-3 text-blue-600 dark:text-blue-400" />+ </Show>+ </button>+ );+ }}+ </For>+ </Show>+ </div>+ </div>+ </Show>+ </div>+ );+};diff --git a/frontend-modern/src/components/shared/FilterBar/filterCatalog.ts b/frontend-modern/src/components/shared/FilterBar/filterCatalog.tsnew file mode 100644index 0000000000..bf3dbf0cab--- /dev/null+++ b/frontend-modern/src/components/shared/FilterBar/filterCatalog.ts@@ -0,0 +1,57 @@+import type { Accessor, JSX } from 'solid-js';++export interface FilterSelectOption {+ value: string;+ label: string;+ count?: number;+}++export type FilterGroupKey = 'scope' | 'status' | 'properties';++export interface FilterDef {+ id: string;+ label: string;+ group?: FilterGroupKey;+ options: Accessor<FilterSelectOption[]>;+ value: Accessor<string>;+ setValue: (value: string) => void;+ defaultValue: string;+ formatChipValue?: (value: string, options: FilterSelectOption[]) => string;+}++export interface FilterBarSearch {+ value: Accessor<string>;+ setValue: (value: string) => void;+ placeholder: string;+ historyKey?: string;+ emptyMessage?: string;+ clearOnEscape?: boolean;+ onBeforeAutoFocus?: () => boolean;+}++export interface FilterBarProps {+ search: FilterBarSearch;+ filters: FilterDef[];+ viewOptionsTrailing?: JSX.Element;+ searchTrailing?: JSX.Element;+ isMobile: Accessor<boolean>;+ role?: string;+ ariaLabel?: string;+ onClearAll?: () => void;+ showClearAll?: Accessor<boolean>;+}++export const isFilterSet = (filter: FilterDef): boolean =>+ filter.value() !== filter.defaultValue;++export const clearFilter = (filter: FilterDef): void => {+ filter.setValue(filter.defaultValue);+};++export const formatFilterChipValue = (filter: FilterDef): string => {+ const value = filter.value();+ const options = filter.options();+ if (filter.formatChipValue) return filter.formatChipValue(value, options);+ const match = options.find((option) => option.value === value);+ return match?.label ?? value;+};diff --git a/frontend-modern/src/components/shared/FilterBar/index.ts b/frontend-modern/src/components/shared/FilterBar/index.tsnew file mode 100644index 0000000000..27f0a97567--- /dev/null+++ b/frontend-modern/src/components/shared/FilterBar/index.ts@@ -0,0 +1,15 @@+export { FilterBar } from './FilterBar';+export { FilterChip } from './FilterChip';+export { AddFilterMenu } from './AddFilterMenu';+export {+ clearFilter,+ formatFilterChipValue,+ isFilterSet,+} from './filterCatalog';+export type {+ FilterBarProps,+ FilterBarSearch,+ FilterDef,+ FilterGroupKey,+ FilterSelectOption,+} from './filterCatalog';diff --git a/frontend-modern/src/components/shared/PageControls.guardrails.test.ts b/frontend-modern/src/components/shared/PageControls.guardrails.test.tsindex 8da5af2d8b..055466359b 100644--- a/frontend-modern/src/components/shared/PageControls.guardrails.test.ts+++ b/frontend-modern/src/components/shared/PageControls.guardrails.test.ts@@ -41,23 +41,27 @@ describe('page controls guardrails', () => {'searchAccessory={activeSearchTrailing() ?? mobileSearchAccessory()}',);- expect(workloadsFilterSource).toContain('PageControls');+ // WorkloadsFilter migrated to FilterBar; defensive guards remain. The+ // <ColumnPicker> tag now appears in WorkloadsFilter via the FilterBar+ // viewOptionsTrailing slot, so the regression guard is the more specific+ // FilterHeader check.expect(workloadsFilterSource).not.toContain('<FilterHeader');- expect(workloadsFilterSource).not.toContain('<ColumnPicker');expect(storageFilterSource).toContain('PageControls');expect(storageFilterSource).not.toContain('<FilterHeader');expect(storageFilterSource).not.toContain('<ColumnPicker');- expect(recoveryProtectedInventorySectionSource).toContain('PageControls');+ // RecoveryProtectedInventorySection migrated to FilterBar; defensive+ // assertions remain to catch any regression that reintroduces FilterHeader+ // / ColumnPicker forks here.expect(recoveryProtectedInventorySectionSource).not.toContain('<FilterHeader');expect(recoveryProtectedInventorySectionSource).not.toContain('<ColumnPicker');- expect(recoveryHistorySectionSource).toContain('PageControls');+ // RecoveryHistorySection migrated to FilterBar; defensive guards remain.expect(recoveryHistorySectionSource).not.toContain('<FilterHeader');- expect(recoveryHistorySectionSource).not.toContain('<ColumnPicker');- expect(infrastructurePageSurfaceSource).toContain('PageControls');+ // InfrastructurePageSurface migrated to FilterBar; the FilterHeader+ // assertion stays as a regression guard.expect(infrastructurePageSurfaceSource).not.toContain('<FilterHeader');});@@ -97,13 +101,32 @@ describe('page controls guardrails', () => {expect(filterHeaderUsers).toEqual(['./PageControls.tsx']);- expect(sharedToolbarImportUsers).toEqual(['./PageControls.tsx']);-- expect(columnPickerUsers).toEqual(['./PageControls.tsx']);-- expect(columnPickerImportUsers).toEqual(['./PageControls.tsx']);-- expect(mobileToggleUsers).toEqual(['./PageControls.tsx']);+ // FilterBar.tsx imports FilterMobileToggleButton from FilterToolbar so it+ // shows up in the shared-toolbar import allowlist alongside PageControls.+ expect(sharedToolbarImportUsers).toEqual([+ './FilterBar/FilterBar.tsx',+ './PageControls.tsx',+ ]);++ // RecoveryHistorySection and WorkloadsFilter compose ColumnPicker via+ // FilterBar's viewOptionsTrailing slot; PageControls plus those two+ // surfaces are the canonical ColumnPicker consumers.+ expect(columnPickerUsers).toEqual([+ '../Recovery/RecoveryHistorySection.tsx',+ '../Workloads/WorkloadsFilter.tsx',+ './PageControls.tsx',+ ]);++ expect(columnPickerImportUsers).toEqual([+ '../Recovery/RecoveryHistorySection.tsx',+ '../Workloads/WorkloadsFilter.tsx',+ './PageControls.tsx',+ ]);++ expect(mobileToggleUsers).toEqual([+ './FilterBar/FilterBar.tsx',+ './PageControls.tsx',+ ]);});it('keeps search-row leading content routed through PageControls rather than local FilterHeader forks', () => {@@ -119,7 +142,9 @@ describe('page controls guardrails', () => {});it('keeps display controls and utility actions on the shared toolbar rail', () => {- expect(workloadsFilterSource).toContain('toolbarTrailing={');+ // WorkloadsFilter migrated to FilterBar's viewOptionsTrailing slot; the+ // toolbarTrailing PageControls prop is no longer used. ChartVisibilityToggleButton+ // and the no-aria-label-Charts regression guard still apply.expect(storageFilterSource).toContain('toolbarTrailing={');expect(workloadsFilterSource).toContain('ChartVisibilityToggleButton');expect(storageFilterSource).toContain('ChartVisibilityToggleButton');@@ -151,38 +176,28 @@ describe('page controls guardrails', () => {expect(filterToolbarSource).toContain('COMPACT_FILTER_TOGGLE_MAX_OPTIONS = 5');expect(filterToolbarSource).toContain("class={local.toggleClass ?? 'hidden xl:inline-flex'}");expect(filterToolbarSource).toContain("groupClass={local.selectGroupClass ?? 'xl:hidden'}");- expect(workloadsFilterSource).toContain('LabeledFilterToggleGroup');- expect(workloadsFilterSource).toContain('WORKLOAD_TYPE_OPTIONS');- expect(workloadsFilterSource).toContain('WORKLOAD_STATUS_FILTER_OPTIONS');- expect(workloadsFilterSource).toContain('workloads-filter-primary-controls');- expect(workloadsFilterSource).toContain('workloads-filter-secondary-controls');- expect(workloadsFilterSource).toContain('pageControlsFilterSectionClass');- expect(workloadsFilterSource).toContain('filterControlsVariant="sectioned-children"');- expect(workloadsFilterSource).not.toContain('workloads-filter-control-deck');- expect(workloadsFilterSource).not.toContain('controlDeckClass=');expect(pageControlsSource).toContain('border border-border bg-surface-alt');expect(pageControlsSource).toContain('border border-border-subtle bg-surface');expect(pageControlsSource).toContain('xl:grid-cols-[minmax(0,1fr)_auto]');- expect(workloadsFilterSource).not.toContain('xl:grid-cols-[max-content_minmax(16rem,1fr)]');- expect(workloadsFilterSource).not.toContain('actionsLayout="stacked"');- expect(workloadsFilterSource).not.toContain('page-controls-toolbar-actions inline-flex');- expect(workloadsFilterSource).toContain('xl:flex-col xl:items-start');- expect(workloadsFilterSource).not.toContain(- '<LabeledFilterSelect\n id="workloads-type-filter"',- );- expect(workloadsFilterSource).not.toContain(- '<LabeledFilterSelect\n id="workloads-status-filter"',- );- expect(recoveryHistorySectionSource).toContain('LabeledFilterToggleGroup');- expect(recoveryHistorySectionSource).not.toContain(- '<LabeledFilterSelect\n id="recovery-status-filter"',- );+ // WorkloadsFilter migrated to FilterBar — the LabeledFilterToggleGroup+ // segmented Type/Status pair retired in favour of catalog chips, so the+ // remaining assertions are regression guards against re-introducing the+ // legacy primitives.+ expect(workloadsFilterSource).not.toContain('LabeledFilterToggleGroup');+ expect(workloadsFilterSource).not.toContain('LabeledFilterSelect');+ expect(workloadsFilterSource).not.toContain('pageControlsFilterSectionClass');+ expect(workloadsFilterSource).not.toContain('filterControlsVariant');+ expect(workloadsFilterSource).not.toContain('xl:flex-col xl:items-start');+ // RecoveryHistorySection migrated to FilterBar; LabeledFilterToggleGroup+ // / LabeledFilterSelect no longer rendered.+ expect(recoveryHistorySectionSource).not.toContain('LabeledFilterToggleGroup');+ expect(recoveryHistorySectionSource).not.toContain('LabeledFilterSelect');expect(storageFilterSource).toContain('<LabeledFilterSelect\n id="storage-status-filter"',);- expect(infrastructurePageSurfaceSource).toContain(- '<LabeledFilterSelect\n id="infra-status-filter"',- );+ // Infrastructure migrated to FilterBar; chip popover replaces the labelled+ // select. Regression guard ensures the legacy primitive stays out.+ expect(infrastructurePageSurfaceSource).not.toContain('<LabeledFilterSelect');});it('keeps embedded workspace tabs on the canonical shared subtabs class pattern', () => {diff --git a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.tsindex 5ee38ed3a5..946843dc3f 100644--- a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts+++ b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts@@ -174,6 +174,12 @@ import reportingPanelSource from '@/components/Settings/ReportingPanel.tsx?raw';import rolesPanelSource from '@/components/Settings/RolesPanel.tsx?raw';import updatesSettingsPanelSource from '@/components/Settings/UpdatesSettingsPanel.tsx?raw';import userAssignmentsPanelSource from '@/components/Settings/UserAssignmentsPanel.tsx?raw';+import filterBarSource from '@/components/shared/FilterBar/FilterBar.tsx?raw';+import filterChipSource from '@/components/shared/FilterBar/FilterChip.tsx?raw';+import addFilterMenuSource from '@/components/shared/FilterBar/AddFilterMenu.tsx?raw';+import filterCatalogSource from '@/components/shared/FilterBar/filterCatalog.ts?raw';+import filterBarIndexSource from '@/components/shared/FilterBar/index.ts?raw';+import storagePageControlsSource from '@/components/Storage/StoragePageControls.tsx?raw';const sharedSources = import.meta.glob(['./*.tsx', './cards/*.tsx', './responsive/*.tsx'], {query: '?raw',@@ -1517,4 +1523,190 @@ describe('shared primitive guardrails', () => {expect(collapsibleSearchInputModelSource).toContain('getCollapsibleSearchRootClass');expect(collapsibleSearchInputModelSource).toContain('order-last basis-full w-full');});++ it('keeps the chip-based FilterBar on a catalog descriptor with shell, chip, and add-menu owners', () => {+ expect(filterBarIndexSource).toContain("export { FilterBar } from './FilterBar';");+ expect(filterBarIndexSource).toContain("export { FilterChip } from './FilterChip';");+ expect(filterBarIndexSource).toContain("export { AddFilterMenu } from './AddFilterMenu';");+ expect(filterBarIndexSource).toContain('isFilterSet');+ expect(filterBarIndexSource).toContain('clearFilter');+ expect(filterBarIndexSource).toContain('formatFilterChipValue');++ expect(filterCatalogSource).toContain('export interface FilterDef');+ expect(filterCatalogSource).toContain('defaultValue: string');+ expect(filterCatalogSource).toContain(+ 'export const isFilterSet = (filter: FilterDef): boolean =>',+ );+ expect(filterCatalogSource).toContain('export const clearFilter = (filter: FilterDef): void =>');+ expect(filterCatalogSource).toContain("filter.value() !== filter.defaultValue");++ expect(filterBarSource).toContain(+ "import { Card } from '@/components/shared/Card';",+ );+ expect(filterBarSource).toContain(+ "import { SearchInput } from '@/components/shared/SearchInput';",+ );+ expect(filterBarSource).toContain(+ "import { FilterMobileToggleButton } from '@/components/shared/FilterToolbar';",+ );+ expect(filterBarSource).toContain("import { AddFilterMenu } from './AddFilterMenu';");+ expect(filterBarSource).toContain("import { FilterChip } from './FilterChip';");+ expect(filterBarSource).toContain('props.filters.filter(isFilterSet)');+ expect(filterBarSource).toContain('activeCount() > 0');+ expect(filterBarSource).not.toContain("import { PageControls }");+ expect(filterBarSource).not.toContain('LabeledFilterSelect');+ expect(filterBarSource).not.toContain('LabeledFilterToggleGroup');+ expect(filterBarSource).not.toContain('filterControlsVariant');++ expect(filterChipSource).toContain("clearFilter,");+ expect(filterChipSource).toContain("formatFilterChipValue,");+ expect(filterChipSource).toContain("from './filterCatalog';");+ expect(filterChipSource).toContain('aria-haspopup="listbox"');+ expect(filterChipSource).toContain('aria-label={`Remove ${props.filter.label} filter`}');+ expect(filterChipSource).toContain('onClick={() => clearFilter(props.filter)}');+ expect(filterChipSource).toContain("event.key === 'Escape'");+ expect(filterChipSource).not.toContain('MutationObserver');+ // Type-ahead parity with AddFilterMenu: chip popover has its own search+ // input + arrow nav + Enter-to-commit, with activeIndex seeded on the+ // currently-selected value so Enter without typing is a no-op.+ expect(filterChipSource).toContain('aria-label={`Filter ${props.filter.label} values`}');+ expect(filterChipSource).toContain('filteredOptions');+ expect(filterChipSource).toContain('handleSearchKeyDown');+ expect(filterChipSource).toContain("event.key === 'ArrowDown'");+ expect(filterChipSource).toContain("event.key === 'ArrowUp'");+ expect(filterChipSource).toContain("event.key === 'Enter'");+ expect(filterChipSource).toContain('commitActive');+ expect(filterChipSource).toContain('queueMicrotask(() => searchInputRef?.focus())');++ expect(addFilterMenuSource).toContain("isFilterSet,");+ expect(addFilterMenuSource).toContain('type FilterDef,');+ expect(addFilterMenuSource).toContain("from './filterCatalog';");+ expect(addFilterMenuSource).toContain('availableFilters');+ expect(addFilterMenuSource).toContain('option.value !== filter.defaultValue');+ expect(addFilterMenuSource).toContain('GROUP_ORDER');+ expect(addFilterMenuSource).toContain('aria-haspopup="menu"');+ expect(addFilterMenuSource).not.toContain('LabeledFilterSelect');+ // Type-ahead: a search input narrows the visible filter (or value) list+ // and Enter commits the active item, so power users can pick a filter+ // with one click + a few keystrokes instead of three clicks.+ expect(addFilterMenuSource).toContain("aria-label={activeFilter() ? 'Filter values' : 'Filter filters'}");+ expect(addFilterMenuSource).toContain('filteredGroupedAvailable');+ expect(addFilterMenuSource).toContain('flatVisibleFilters');+ expect(addFilterMenuSource).toContain('filteredOptions');+ expect(addFilterMenuSource).toContain('handleSearchKeyDown');+ expect(addFilterMenuSource).toContain("event.key === 'ArrowDown'");+ expect(addFilterMenuSource).toContain("event.key === 'ArrowUp'");+ expect(addFilterMenuSource).toContain("event.key === 'Enter'");+ expect(addFilterMenuSource).toContain('commitActive');+ expect(addFilterMenuSource).toContain('queueMicrotask(() => searchInputRef?.focus())');++ // FilterBar consumers — each migrated page should declare a catalog of+ // FilterDef entries rather than rendering the labelled-select row from+ // PageControls. Guards against regression to the old layout-per-page+ // pattern.+ expect(recoveryProtectedInventorySectionSource).toContain(+ "import { FilterBar, type FilterDef } from '@/components/shared/FilterBar';",+ );+ expect(recoveryProtectedInventorySectionSource).toContain('<FilterBar');+ expect(recoveryProtectedInventorySectionSource).toContain("id: 'item-type'");+ expect(recoveryProtectedInventorySectionSource).toContain("id: 'platform'");+ expect(recoveryProtectedInventorySectionSource).toContain("id: 'protected-state'");+ expect(recoveryProtectedInventorySectionSource).toContain('role="group"');+ expect(recoveryProtectedInventorySectionSource).toContain(+ 'ariaLabel="Protected items controls"',+ );+ expect(recoveryProtectedInventorySectionSource).not.toContain('PageControls');+ expect(recoveryProtectedInventorySectionSource).not.toContain('LabeledFilterSelect');+ expect(recoveryProtectedInventorySectionSource).not.toContain('protectedFiltersOpen');++ // Recovery events sub-tab — every advanced filter folds into the catalog+ // (scope, method, verification, cluster, node, namespace) so the+ // dedicated "Filter" popover panel and FilterToolbarPanel-based advanced+ // panel are no longer rendered.+ expect(recoveryHistorySectionSource).toContain(+ "import { FilterBar, type FilterDef } from '@/components/shared/FilterBar';",+ );+ expect(recoveryHistorySectionSource).toContain('<FilterBar');+ expect(recoveryHistorySectionSource).toContain(+ 'ariaLabel="Recovery events controls"',+ );+ expect(recoveryHistorySectionSource).toContain("id: 'item-type'");+ expect(recoveryHistorySectionSource).toContain("id: 'platform'");+ expect(recoveryHistorySectionSource).toContain("id: 'outcome'");+ expect(recoveryHistorySectionSource).toContain("id: 'scope'");+ expect(recoveryHistorySectionSource).toContain("id: 'method'");+ expect(recoveryHistorySectionSource).toContain("id: 'verification'");+ expect(recoveryHistorySectionSource).toContain("id: 'cluster'");+ expect(recoveryHistorySectionSource).toContain("id: 'node'");+ expect(recoveryHistorySectionSource).toContain("id: 'namespace'");+ expect(recoveryHistorySectionSource).toContain('searchTrailing={');+ expect(recoveryHistorySectionSource).toContain('<RecoveryHistoryItemFilter');+ expect(recoveryHistorySectionSource).toContain('<ColumnPicker');+ expect(recoveryHistorySectionSource).toContain('onClearAll={');+ expect(recoveryHistorySectionSource).toContain(+ 'showClearAll={props.hasActiveArtifactFilters}',+ );+ expect(recoveryHistorySectionSource).not.toContain('PageControls');+ expect(recoveryHistorySectionSource).not.toContain('FilterActionButton');+ expect(recoveryHistorySectionSource).not.toContain('FilterToolbarPanel');+ expect(recoveryHistorySectionSource).not.toContain('moreFiltersOpen');+ expect(recoveryHistorySectionSource).not.toContain('historyFiltersOpen');++ // WorkloadsFilter — Type/Status/Node/Platform/Namespace/Runtime are all+ // catalog chips. The xl-breakpoint segmented↔select swap retires here.+ expect(workloadsFilterSource).toContain(+ "import { FilterBar, type FilterDef } from '@/components/shared/FilterBar';",+ );+ expect(workloadsFilterSource).toContain('<FilterBar');+ expect(workloadsFilterSource).toContain('ariaLabel="Workloads filters"');+ expect(workloadsFilterSource).toContain("id: 'workloads-type'");+ expect(workloadsFilterSource).toContain("id: 'workloads-status'");+ expect(workloadsFilterSource).toContain('viewOptionsTrailing={');+ expect(workloadsFilterSource).toContain('GroupedTableModeSegmentedControl');+ expect(workloadsFilterSource).toContain('ChartVisibilityToggleButton');+ expect(workloadsFilterSource).toContain('<ColumnPicker');+ expect(workloadsFilterSource).toContain('onClearAll={handleClearAll}');+ expect(workloadsFilterSource).toContain('showClearAll={showClearAll}');+ expect(workloadsFilterSource).not.toContain('PageControls');+ expect(workloadsFilterSource).not.toContain('LabeledFilterToggleGroup');+ expect(workloadsFilterSource).not.toContain('LabeledFilterSelect');+ expect(workloadsFilterSource).not.toContain('useWorkloadsFilterState');++ // StoragePageControls — Subtabs sit above the FilterBar; sort key/sort+ // direction live in viewOptionsTrailing as raw view-options (not chips).+ // Per-view catalog filters (Group by, Source, Status on Pools; Role/Group+ // on Physical Disks) flow through the FilterBar catalog. The legacy+ // 3-layer indirection (StoragePageControls → StorageControls →+ // StorageFilter) collapses to one component.+ expect(storagePageControlsSource).toContain(+ "import { FilterBar, type FilterDef } from '@/components/shared/FilterBar';",+ );+ expect(storagePageControlsSource).toContain('<FilterBar');+ expect(storagePageControlsSource).toContain('<Subtabs');+ expect(storagePageControlsSource).toContain('ariaLabel="Storage filters"');+ expect(storagePageControlsSource).toContain("id: 'storage-node'");+ expect(storagePageControlsSource).toContain("id: 'storage-group-by'");+ expect(storagePageControlsSource).toContain("id: 'storage-source'");+ expect(storagePageControlsSource).toContain("id: 'storage-status'");+ expect(storagePageControlsSource).toContain("id: 'storage-disk-role'");+ expect(storagePageControlsSource).toContain("id: 'storage-disk-group'");+ expect(storagePageControlsSource).toContain('viewOptionsTrailing={');+ expect(storagePageControlsSource).toContain('aria-label="Sort by"');+ expect(storagePageControlsSource).toContain('aria-label="Sort direction"');+ expect(storagePageControlsSource).toContain('ChartVisibilityToggleButton');+ expect(storagePageControlsSource).toContain('onClearAll={handleClearAll}');+ expect(storagePageControlsSource).toContain('showClearAll={showClearAll}');+ // The component name is StoragePageControls but it must not import or+ // render the legacy PageControls primitive, the StorageControls /+ // StorageFilter intermediates, or any LabeledFilterSelect /+ // FilterSegmentedControl forks.+ expect(storagePageControlsSource).not.toContain(+ "from '@/components/shared/PageControls'",+ );+ expect(storagePageControlsSource).not.toContain('<PageControls');+ expect(storagePageControlsSource).not.toContain('<StorageControls');+ expect(storagePageControlsSource).not.toContain('<StorageFilter');+ expect(storagePageControlsSource).not.toContain('LabeledFilterSelect');+ expect(storagePageControlsSource).not.toContain('FilterSegmentedControl');+ });});diff --git a/frontend-modern/src/features/infrastructure/InfrastructurePageSurface.tsx b/frontend-modern/src/features/infrastructure/InfrastructurePageSurface.tsxindex 391be5a44d..9d16588fa8 100644--- a/frontend-modern/src/features/infrastructure/InfrastructurePageSurface.tsx+++ b/frontend-modern/src/features/infrastructure/InfrastructurePageSurface.tsx@@ -1,16 +1,12 @@-import { For, Show } from 'solid-js';+import { Show } from 'solid-js';import { useNavigate } from '@solidjs/router';import { buildInfrastructureOnboardingPath } from '@/components/Settings/infrastructureWorkspaceModel';import { EmptyState } from '@/components/shared/EmptyState';import { Card } from '@/components/shared/Card';-import {- ChartVisibilityToggleButton,- LabeledFilterSelect,-} from '@/components/shared/FilterToolbar';+import { FilterBar, type FilterDef } from '@/components/shared/FilterBar';+import { ChartVisibilityToggleButton } from '@/components/shared/FilterToolbar';import { GroupedTableModeSegmentedControl } from '@/components/shared/GroupedTableModeSegmentedControl';-import { PageControls } from '@/components/shared/PageControls';import { PageHeader } from '@/components/shared/PageHeader';-import { SearchInput } from '@/components/shared/SearchInput';import { StickySummarySection } from '@/components/shared/StickySummarySection';import { UnifiedResourceTable } from '@/components/Infrastructure/UnifiedResourceTable';import { InfrastructureSummary } from '@/components/Infrastructure/InfrastructureSummary';@@ -65,9 +61,6 @@ export function InfrastructurePageSurface() {jumpToActiveResourceRow,deployCluster,setDeployCluster,- filtersOpen,- setFiltersOpen,- activeFilterCount,kioskMode,clearPinnedSummaryScope,sourceOptions,@@ -178,72 +171,62 @@ export function InfrastructurePageSurface() {<div class="space-y-3" data-testid="infrastructure-interaction-surface"><Show when={!kioskMode()}><div data-summary-clear-ignore>- <Card padding="sm" class="mb-4">- <PageControls- search={- <SearchInput- value={searchQuery}- onChange={setSearchQuery}- placeholder="Search resources, IDs, IPs, or tags..."- class="w-full"- typeToSearch- history={{- storageKey: STORAGE_KEYS.RESOURCES_SEARCH_HISTORY,- emptyMessage: 'Recent infrastructure searches appear here.',- }}+ <FilterBar+ isMobile={isMobile}+ search={{+ value: searchQuery,+ setValue: setSearchQuery,+ placeholder: 'Search resources, IDs, IPs, or tags...',+ historyKey: STORAGE_KEYS.RESOURCES_SEARCH_HISTORY,+ emptyMessage: 'Recent infrastructure searches appear here.',+ }}+ filters={+ [+ {+ id: 'platform',+ label: 'Platform',+ group: 'scope',+ value: selectedSource,+ setValue: setSelectedSource,+ defaultValue: '',+ options: () => [+ { value: '', label: 'All' },+ ...sourceOptions().map((source) => ({+ value: source.key,+ label: source.label,+ })),+ ],+ },+ {+ id: 'status',+ label: 'Status',+ group: 'status',+ value: selectedStatus,+ setValue: setSelectedStatus,+ defaultValue: '',+ options: () => [+ { value: '', label: 'All' },+ ...statusOptions().map((status) => ({+ value: status.key,+ label: status.label,+ })),+ ],+ },+ ] as FilterDef[]+ }+ viewOptionsTrailing={+ <>+ <GroupedTableModeSegmentedControl+ value={groupingMode()}+ onChange={(value) => setGroupingMode(value as GroupingMode)}/>- }- mobileFilters={{- enabled: isMobile(),- onToggle: () => setFiltersOpen((o) => !o),- count: activeFilterCount(),- }}- resetAction={{- show: hasActiveFilters(),- onClick: clearFilters,- label: 'Clear',- class: 'ml-auto text-base-content',- }}- showFilters={!isMobile() || filtersOpen()}- toolbarClass="lg:flex-nowrap"- >- <LabeledFilterSelect- id="infra-source-filter"- label="Platform"- value={selectedSource()}- onChange={(e) => setSelectedSource(e.currentTarget.value)}- selectClass="min-w-[8rem]"- >- <option value="">All</option>- <For each={sourceOptions()}>- {(source) => <option value={source.key}>{source.label}</option>}- </For>- </LabeledFilterSelect>-- <LabeledFilterSelect- id="infra-status-filter"- label="Status"- value={selectedStatus()}- onChange={(e) => setSelectedStatus(e.currentTarget.value)}- selectClass="min-w-[7rem]"- >- <option value="">All</option>- <For each={statusOptions()}>- {(status) => <option value={status.key}>{status.label}</option>}- </For>- </LabeledFilterSelect>-- <GroupedTableModeSegmentedControl- value={groupingMode()}- onChange={(value) => setGroupingMode(value as GroupingMode)}- />-- <ChartVisibilityToggleButton- collapsed={summaryCollapsed()}- onToggle={() => setSummaryCollapsed((collapsed) => !collapsed)}- />- </PageControls>- </Card>+ <ChartVisibilityToggleButton+ collapsed={summaryCollapsed()}+ onToggle={() => setSummaryCollapsed((collapsed) => !collapsed)}+ />+ </>+ }+ /></div></Show>diff --git a/frontend-modern/src/features/infrastructure/__tests__/InfrastructurePageSurface.guardrails.test.ts b/frontend-modern/src/features/infrastructure/__tests__/InfrastructurePageSurface.guardrails.test.tsindex e4ea68b4dc..e48b81220d 100644--- a/frontend-modern/src/features/infrastructure/__tests__/InfrastructurePageSurface.guardrails.test.ts+++ b/frontend-modern/src/features/infrastructure/__tests__/InfrastructurePageSurface.guardrails.test.ts@@ -124,6 +124,25 @@ describe('InfrastructurePageSurface guardrails', () => {expect(infrastructurePageRouteStateSource).not.toContain('createRouteStateSearchSignal');});+ it('routes the page filter section through the chip-based FilterBar primitive', () => {+ expect(infrastructurePageSurfaceSource).toContain(+ "import { FilterBar, type FilterDef } from '@/components/shared/FilterBar';",+ );+ expect(infrastructurePageSurfaceSource).toContain('<FilterBar');+ expect(infrastructurePageSurfaceSource).toContain('isMobile={isMobile}');+ expect(infrastructurePageSurfaceSource).toContain("id: 'platform'");+ expect(infrastructurePageSurfaceSource).toContain("id: 'status'");+ expect(infrastructurePageSurfaceSource).toContain("group: 'scope'");+ expect(infrastructurePageSurfaceSource).toContain("group: 'status'");+ expect(infrastructurePageSurfaceSource).toContain('viewOptionsTrailing={');+ expect(infrastructurePageSurfaceSource).not.toContain('PageControls');+ expect(infrastructurePageSurfaceSource).not.toContain('LabeledFilterSelect');+ expect(infrastructurePageSurfaceSource).not.toContain('mobileFilters={');+ expect(infrastructurePageSurfaceSource).not.toContain('resetAction={');+ expect(infrastructurePageSurfaceSource).not.toContain('showFilters={!isMobile()');+ expect(infrastructurePageSurfaceSource).not.toContain('toolbarClass="lg:flex-nowrap"');+ });+it('keeps inline-detail reveal out of infrastructure viewport sync helpers', () => {expect(unifiedResourceTableStateSource).toContain('useUnifiedResourceTableViewportSync');expect(unifiedResourceTableStateSource).not.toContain('scrollIntoView');