Skip to content

armgit / Pulse

Public Imported from GitHub
0

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

Fix filter toolbar control inconsistencies

rcourtmanb109c1230f3e
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index 263af63ef0..c69cb3650c 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -3910,6 +3910,18 @@ has a persistent label, and destructive view controls remain visibly
discoverable at narrow touch viewports instead of depending on hover. The
panel remains end-anchored to its trigger so its management actions cannot run
past the viewport edge on the expanded mobile filter rail.
+Saved Views and View are peer filter-bar popovers and must compose the shared
+`FilterPopoverTrigger`; the shared trigger owns their matching text emphasis,
+icon geometry, disclosure chevron, active state, and button alignment instead
+of allowing each popup wrapper to restyle that contract independently.
+The Add filter select and adjacent action/popover triggers share the canonical
+`filterToolbarControlClass` height. When the Add filter label is visually
+hidden, its `FormSelect` must also omit the labelled group's outer padded/ring
+shell so the native select does not become a double-framed, oversized control;
+its extra width remains intentional space for dynamic filter-value labels. The
+visible `Add filter` value is a disabled, hidden placeholder, not an actionable
+option repeated at the top of the opened native list; only real filter values
+belong in that choice list.
Counts or orientation strips presented as part of a filtered resource table
must derive from that table's canonical filtered collection as well. They must
not continue showing page-wide inventory totals after FilterBar state, saved
diff --git a/frontend-modern/browser-verification.json b/frontend-modern/browser-verification.json
index 41a0830268..5d91184678 100644
--- a/frontend-modern/browser-verification.json
+++ b/frontend-modern/browser-verification.json
@@ -1,13 +1,19 @@
{
"version": 1,
- "base_sha": "09b6de599ef2613309d2d021b6d090891ce478bc",
- "verified_at": "2026-08-02T22:02:49Z",
+ "base_sha": "3e3839022df46c9c13c478bafd3fa18da27f4320",
+ "verified_at": "2026-08-02T22:32:51Z",
"result": "passed",
"changed_paths": [
- "frontend-modern/src/components/shared/FilterBar/SavedViewsMenu.tsx"
+ "frontend-modern/src/components/shared/FilterToolbar.tsx",
+ "frontend-modern/src/components/shared/FilterBar/AddFilterMenu.tsx",
+ "frontend-modern/src/components/shared/FilterBar/SavedViewsMenu.tsx",
+ "frontend-modern/src/components/shared/FilterBar/ViewOptionsMenu.tsx"
],
"content_sha256": {
- "frontend-modern/src/components/shared/FilterBar/SavedViewsMenu.tsx": "9490a292a06872a06baffb04cb9bbe7faa74189acff1b526d9002e2363619202"
+ "frontend-modern/src/components/shared/FilterToolbar.tsx": "edd710a295605fee5fc1611b31e52fe7eb848f981b1f366d573666b48d9fed07",
+ "frontend-modern/src/components/shared/FilterBar/AddFilterMenu.tsx": "41b928014dbfeb768c1fb5ca035e88aac3912169083abfaf5cbd1bf8b3bed4c9",
+ "frontend-modern/src/components/shared/FilterBar/SavedViewsMenu.tsx": "84d3e93bcaf8104cf2c58415ef226503d09cc8407a2d3ae127660c36ba037ba1",
+ "frontend-modern/src/components/shared/FilterBar/ViewOptionsMenu.tsx": "6a39c1878e722bd0c5f5c8422158cb3c2d6e1659daf6feee359fb32c84bdcb3d"
},
"routes": [
"/proxmox/overview"
@@ -23,22 +29,16 @@
}
],
"states": [
- "Desktop saved-views dialog with an existing view and all management actions",
- "Desktop empty saved-views dialog and inline naming form",
- "Desktop saved Stopped view applied to the filtered workload table",
- "Desktop save-form Escape state and closed-dialog trigger focus state",
- "Phone-width expanded filter rail with the saved-views dialog open",
- "Phone-width saved-view row with visible default and remove actions",
- "Neutral Grouped, Bars, Guest, All-status state after cleanup and reload"
+ "Desktop filter toolbar with Add filter, Saved, and View controls closed",
+ "Phone-width expanded filter rail with aligned Add filter, Saved, and View controls",
+ "Phone-width Saved views dialog open and end-anchored inside the viewport",
+ "Phone-width View preferences dialog open inside the viewport"
],
"interactions": [
- "Created a Stopped saved view, applied it, and confirmed the table summary narrowed to 5 stopped workloads",
- "Set the saved view as default, reloaded the page, confirmed the default marker persisted, and then unset it",
- "Pressed Escape in the naming form and confirmed focus returned to Save current view as, then pressed Escape again and confirmed focus returned to the trigger",
- "Clicked the search field outside the dialog and confirmed the dialog closed without stealing search focus",
- "Dismissed a populated naming draft with the trigger, reopened the dialog, and confirmed the draft and form state were reset",
- "Inspected the end-anchored dialog at 390 pixels and confirmed the default and remove controls remained visible inside the viewport",
- "Removed the temporary saved view on the phone layout and confirmed focus returned to Save current view as",
- "Restored Grouped, Bars, Guest, All-status defaults and reloaded before finishing verification"
+ "Confirmed the hidden disabled Add filter placeholder is absent from the accessible native option list and only real Node values are actionable",
+ "Selected Node pve4, confirmed the filter chip appeared and the Add filter control was exhausted, then removed the chip to restore the neutral state",
+ "Opened and dismissed Saved views at phone width and confirmed trigger alignment, chevron state, and viewport-safe panel placement",
+ "Opened and dismissed View preferences at phone width and confirmed matching trigger geometry and viewport-safe panel placement",
+ "Confirmed the browser console reported no errors during the final desktop and phone-width pass"
]
}
diff --git a/frontend-modern/src/components/shared/FilterBar/AddFilterMenu.tsx b/frontend-modern/src/components/shared/FilterBar/AddFilterMenu.tsx
index 6d1c6fa7ff..5e221944ee 100644
--- a/frontend-modern/src/components/shared/FilterBar/AddFilterMenu.tsx
+++ b/frontend-modern/src/components/shared/FilterBar/AddFilterMenu.tsx
@@ -1,5 +1,9 @@
import { Component, For, Show, createMemo, createUniqueId } from 'solid-js';
-import { filterGroupClass, filterLabelClass } from '@/components/shared/FilterToolbar';
+import {
+ filterGroupClass,
+ filterLabelClass,
+ filterToolbarControlClass,
+} from '@/components/shared/FilterToolbar';
import { FormSelect } from '@/components/shared/FormSelect';
import {
isFilterSet,
@@ -90,6 +94,8 @@ export const AddFilterMenu: Component<AddFilterMenuProps> = (props) => {
});
const isDisabled = () => selectableByToken().size === 0;
+ const fieldBaseClass = () =>
+ props.showLabel === false ? 'flex-shrink-0' : `${filterGroupClass} flex-shrink-0`;
const handleChange = (event: Event) => {
const select = event.currentTarget as HTMLSelectElement;
@@ -104,15 +110,17 @@ export const AddFilterMenu: Component<AddFilterMenuProps> = (props) => {
<FormSelect
id={selectId}
label="Filter"
- fieldBaseClass={`${filterGroupClass} flex-shrink-0`}
+ fieldBaseClass={fieldBaseClass()}
labelClass={props.showLabel === false ? 'sr-only' : filterLabelClass}
- selectBaseClass="rounded-md border border-transparent bg-surface-hover px-2 py-1 text-xs font-medium text-muted outline-none ring-1 ring-border-subtle transition-colors hover:bg-surface hover:text-base-content focus:border-blue-500"
+ selectBaseClass={`${filterToolbarControlClass} border border-transparent bg-surface-hover px-2 text-muted outline-none ring-1 ring-border-subtle transition-colors hover:bg-surface hover:text-base-content focus:border-blue-500`}
selectClass="min-w-[7.5rem]"
value=""
onChange={handleChange}
aria-label="Filter"
>
- <option value="">Add filter</option>
+ <option value="" disabled hidden>
+ Add filter
+ </option>
<For each={selectableGroups()}>
{(group) => (
<optgroup label={GROUP_LABELS[group.key]}>
diff --git a/frontend-modern/src/components/shared/FilterBar/FilterBar.test.tsx b/frontend-modern/src/components/shared/FilterBar/FilterBar.test.tsx
index 3fcce4dbbe..4a11bf3ce7 100644
--- a/frontend-modern/src/components/shared/FilterBar/FilterBar.test.tsx
+++ b/frontend-modern/src/components/shared/FilterBar/FilterBar.test.tsx
@@ -69,7 +69,10 @@ describe('FilterBar', () => {
expect(setType).toHaveBeenCalledWith('vm');
const filterSelect = screen.getByRole('combobox', { name: 'Filter' });
expect(filterSelect).toHaveValue('');
- expect(within(filterSelect).getByRole('option', { name: 'Add filter' })).toBeEnabled();
+ const placeholder = filterSelect.querySelector('option[value=""]');
+ expect(placeholder).toHaveTextContent('Add filter');
+ expect(placeholder).toBeDisabled();
+ expect(placeholder).toHaveAttribute('hidden');
expect(
within(filterSelect).queryByRole('option', { name: 'Type: VMs' }),
).not.toBeInTheDocument();
@@ -194,5 +197,7 @@ describe('FilterBar', () => {
const select = screen.getByRole('combobox', { name: 'Filter' });
const label = document.querySelector(`label[for="${select.id}"]`);
expect(label).toHaveClass('sr-only');
+ expect(select).toHaveClass('h-7');
+ expect(select.parentElement).not.toHaveClass('p-0.5');
});
});
diff --git a/frontend-modern/src/components/shared/FilterBar/SavedViewsMenu.tsx b/frontend-modern/src/components/shared/FilterBar/SavedViewsMenu.tsx
index cfa9c05346..3c3c75cd54 100644
--- a/frontend-modern/src/components/shared/FilterBar/SavedViewsMenu.tsx
+++ b/frontend-modern/src/components/shared/FilterBar/SavedViewsMenu.tsx
@@ -11,7 +11,7 @@ import BookmarkIcon from 'lucide-solid/icons/bookmark';
import PlusIcon from 'lucide-solid/icons/plus';
import StarIcon from 'lucide-solid/icons/star';
import XIcon from 'lucide-solid/icons/x';
-import { FilterActionButton, FilterToolbarPanel } from '@/components/shared/FilterToolbar';
+import { FilterPopoverTrigger, FilterToolbarPanel } from '@/components/shared/FilterToolbar';
import { useSavedViews, type SavedView } from './useSavedViews';
interface SavedViewsMenuProps {
@@ -99,24 +99,24 @@ export const SavedViewsMenu: Component<SavedViewsMenuProps> = (props) => {
};
return (
- <div ref={containerRef} class="relative inline-flex">
- <FilterActionButton
+ <div ref={containerRef} class="relative shrink-0">
+ <FilterPopoverTrigger
ref={triggerRef}
- active={open()}
+ open={open()}
onClick={() => (open() ? close() : setOpen(true))}
aria-haspopup="dialog"
aria-expanded={open()}
aria-controls={open() ? panelId : undefined}
aria-label="Saved views"
>
- <BookmarkIcon class="h-3 w-3" />
+ <BookmarkIcon class="h-3.5 w-3.5" aria-hidden="true" />
Saved
<Show when={views().length > 0}>
<span class="ml-0.5 rounded-full bg-surface-hover px-1.5 py-px text-[10px] font-medium text-base-content">
{views().length}
</span>
</Show>
- </FilterActionButton>
+ </FilterPopoverTrigger>
<Show when={open()}>
<FilterToolbarPanel
diff --git a/frontend-modern/src/components/shared/FilterBar/ViewOptionsMenu.tsx b/frontend-modern/src/components/shared/FilterBar/ViewOptionsMenu.tsx
index ac06d59108..8a675bb9e3 100644
--- a/frontend-modern/src/components/shared/FilterBar/ViewOptionsMenu.tsx
+++ b/frontend-modern/src/components/shared/FilterBar/ViewOptionsMenu.tsx
@@ -8,9 +8,8 @@ import {
onCleanup,
} from 'solid-js';
import SlidersHorizontalIcon from 'lucide-solid/icons/sliders-horizontal';
-import ChevronDownIcon from 'lucide-solid/icons/chevron-down';
-import { FilterActionButton, FilterToolbarPanel } from '@/components/shared/FilterToolbar';
+import { FilterPopoverTrigger, FilterToolbarPanel } from '@/components/shared/FilterToolbar';
interface ViewOptionsMenuProps {
children: JSX.Element;
@@ -51,23 +50,18 @@ export const ViewOptionsMenu: Component<ViewOptionsMenuProps> = (props) => {
return (
<div ref={containerRef} class="relative shrink-0">
- <FilterActionButton
+ <FilterPopoverTrigger
ref={triggerRef}
- active={open()}
+ open={open()}
onClick={() => setOpen((value) => !value)}
aria-haspopup="dialog"
aria-expanded={open()}
aria-controls={open() ? panelId : undefined}
title="Change table presentation"
- class="text-base-content"
>
<SlidersHorizontalIcon class="h-3.5 w-3.5" aria-hidden="true" />
View
- <ChevronDownIcon
- class={`h-3.5 w-3.5 transition-transform ${open() ? 'rotate-180' : ''}`}
- aria-hidden="true"
- />
- </FilterActionButton>
+ </FilterPopoverTrigger>
<Show when={open()}>
<FilterToolbarPanel
diff --git a/frontend-modern/src/components/shared/FilterToolbar.test.tsx b/frontend-modern/src/components/shared/FilterToolbar.test.tsx
index 9bd38b8cf1..2992149cdd 100644
--- a/frontend-modern/src/components/shared/FilterToolbar.test.tsx
+++ b/frontend-modern/src/components/shared/FilterToolbar.test.tsx
@@ -4,6 +4,7 @@ import { afterEach, describe, expect, it, vi } from 'vitest';
import {
ChartVisibilityToggleButton,
FilterHeader,
+ FilterPopoverTrigger,
FilterToolbarPanel,
FilterSegmentedControl,
LabeledFilterSelect,
@@ -258,6 +259,31 @@ describe('FilterHeader', () => {
expect(filterToolbarSource).toContain("'flex min-h-10 items-center gap-1.5");
});
+ it('keeps peer popover triggers aligned and exposes their disclosure state', () => {
+ const [open, setOpen] = createSignal(false);
+ render(() => (
+ <FilterPopoverTrigger
+ open={open()}
+ onClick={() => setOpen((current) => !current)}
+ aria-expanded={open()}
+ >
+ Saved
+ </FilterPopoverTrigger>
+ ));
+
+ const trigger = screen.getByRole('button', { name: 'Saved' });
+ const chevron = trigger.querySelector('svg');
+ expect(trigger).toHaveClass('h-7');
+ expect(trigger).toHaveClass('text-base-content');
+ expect(trigger).toHaveAttribute('aria-expanded', 'false');
+ expect(chevron).not.toHaveClass('rotate-180');
+
+ trigger.click();
+
+ expect(trigger).toHaveAttribute('aria-expanded', 'true');
+ expect(chevron).toHaveClass('rotate-180');
+ });
+
it('allows narrow shared popovers to opt out of the default wide panel width', () => {
render(() => (
<FilterToolbarPanel widthClass="w-56 max-w-[calc(100vw-2rem)]" data-testid="panel">
diff --git a/frontend-modern/src/components/shared/FilterToolbar.tsx b/frontend-modern/src/components/shared/FilterToolbar.tsx
index ee364707bc..e77c57db67 100644
--- a/frontend-modern/src/components/shared/FilterToolbar.tsx
+++ b/frontend-modern/src/components/shared/FilterToolbar.tsx
@@ -1,5 +1,6 @@
import { Component, For, JSX, Show, splitProps } from 'solid-js';
import BarChartIcon from 'lucide-solid/icons/bar-chart';
+import ChevronDownIcon from 'lucide-solid/icons/chevron-down';
import ListFilterIcon from 'lucide-solid/icons/list-filter';
import { FormSelect } from './FormSelect';
import {
@@ -16,11 +17,10 @@ export const filterGroupClass =
'inline-flex items-center gap-1 rounded-md bg-surface-hover p-0.5 ring-1 ring-border-subtle';
export const filterLabelClass =
'px-1.5 text-[9px] font-semibold uppercase tracking-wide text-muted';
-export const filterActionButtonClass =
- 'inline-flex items-center gap-1.5 rounded-md bg-surface-hover px-2.5 py-1 text-xs font-medium text-muted ring-1 ring-border-subtle transition-colors hover:bg-surface hover:text-base-content';
+export const filterToolbarControlClass = 'h-7 rounded-md text-xs font-medium';
+export const filterActionButtonClass = `inline-flex items-center gap-1.5 ${filterToolbarControlClass} bg-surface-hover px-2.5 text-muted ring-1 ring-border-subtle transition-colors hover:bg-surface hover:text-base-content`;
export const filterActionButtonActiveClass = 'bg-surface text-base-content shadow-sm';
-export const filterSelectClass =
- 'rounded-md border border-border bg-surface px-2 py-1 text-xs font-medium text-base-content outline-none focus:border-blue-500';
+export const filterSelectClass = `${filterToolbarControlClass} border border-border bg-surface px-2 text-base-content outline-none focus:border-blue-500`;
export const filterDividerClass = 'hidden h-5 w-px bg-surface-hover sm:block';
export const filterPanelClass =
'absolute right-0 top-[calc(100%+0.5rem)] z-[80] rounded-md border border-border bg-surface p-3 shadow-lg';
@@ -387,6 +387,27 @@ export const FilterActionButton: Component<FilterActionButtonProps> = (props) =>
);
};
+interface FilterPopoverTriggerProps extends Omit<FilterActionButtonProps, 'active'> {
+ open: boolean;
+}
+
+export const FilterPopoverTrigger: Component<FilterPopoverTriggerProps> = (props) => {
+ const [local, buttonProps] = splitProps(props, ['open', 'children', 'class']);
+ return (
+ <FilterActionButton
+ {...buttonProps}
+ active={local.open}
+ class={`text-base-content ${local.class ?? ''}`.trim()}
+ >
+ {local.children}
+ <ChevronDownIcon
+ class={`h-3.5 w-3.5 transition-transform ${local.open ? 'rotate-180' : ''}`}
+ aria-hidden="true"
+ />
+ </FilterActionButton>
+ );
+};
+
interface ChartVisibilityToggleButtonProps extends Omit<
JSX.ButtonHTMLAttributes<HTMLButtonElement>,
'aria-label' | 'aria-pressed' | 'children' | 'onClick' | 'title'
diff --git a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
index 115b13cadb..95d9a2fd99 100644
--- a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
+++ b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
@@ -295,6 +295,7 @@ import filterCatalogSource from '@/components/shared/FilterBar/filterCatalog.ts?
import filterBarOptionPresentationSource from '@/components/shared/FilterBar/filterOptionPresentation.tsx?raw';
import filterBarIndexSource from '@/components/shared/FilterBar/index.ts?raw';
import savedViewsMenuSource from '@/components/shared/FilterBar/SavedViewsMenu.tsx?raw';
+import viewOptionsMenuSource from '@/components/shared/FilterBar/ViewOptionsMenu.tsx?raw';
import useSavedViewsSource from '@/components/shared/FilterBar/useSavedViews.ts?raw';
import storagePageControlsSource from '@/components/Storage/StoragePageControls.tsx?raw';
import orgSwitcherSource from '@/components/OrgSwitcher.tsx?raw';
@@ -8179,6 +8180,10 @@ describe('shared primitive guardrails', () => {
expect(addFilterMenuSource).toContain('bg-surface-hover');
expect(addFilterMenuSource).toContain('ring-border-subtle');
expect(addFilterMenuSource).toContain('aria-label="Filter"');
+ expect(addFilterMenuSource).toContain('filterToolbarControlClass');
+ expect(addFilterMenuSource).toContain(
+ "props.showLabel === false ? 'flex-shrink-0' : `${filterGroupClass} flex-shrink-0`",
+ );
expect(addFilterMenuSource).not.toContain('LabeledFilterSelect');
// Add-filter selection is intentionally direct: the shared primitive
// exposes a single native select grouped by filter category instead of a
@@ -8190,7 +8195,7 @@ describe('shared primitive guardrails', () => {
expect(addFilterMenuSource).toContain('{filter.filter.label}: {option.option.label}');
expect(addFilterMenuSource).toContain('selected.filter.setValue(selected.option.value)');
expect(addFilterMenuSource).toContain('<Show when={!isDisabled()}>');
- expect(addFilterMenuSource).toContain('<option value="">Add filter</option>');
+ expect(addFilterMenuSource).toContain('<option value="" disabled hidden>');
expect(addFilterMenuSource).not.toContain('No filters');
expect(addFilterMenuSource).not.toContain('Search filters');
expect(addFilterMenuSource).not.toContain('Search values');
@@ -8220,6 +8225,12 @@ describe('shared primitive guardrails', () => {
expect(useSavedViewsSource).toContain("window.location.search.replace(/^\\?/, '')");
expect(savedViewsMenuSource).toContain("from './useSavedViews';");
+ expect(filterToolbarSource).toContain('export const FilterPopoverTrigger');
+ expect(filterToolbarSource).toContain("filterToolbarControlClass = 'h-7");
+ expect(viewOptionsMenuSource).toContain('<FilterPopoverTrigger');
+ expect(savedViewsMenuSource).toContain('<FilterPopoverTrigger');
+ expect(savedViewsMenuSource).toContain('class="relative shrink-0"');
+ expect(savedViewsMenuSource).toContain('class="h-3.5 w-3.5"');
expect(savedViewsMenuSource).toContain('aria-label="Saved views"');
expect(savedViewsMenuSource).toContain('aria-haspopup="dialog"');
expect(savedViewsMenuSource).toContain('role="dialog"');