From 93ba6108926fdd91eec13462008ebf8a95e5119d Mon Sep 17 00:00:00 2001 From: rcourtman Date: Wed, 20 May 2026 17:15:00 +0100 Subject: [PATCH] Hide Reset on storage filter row when source is externally forced MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit StoragePageControls.showClearAll fed the actual sourceFilter() into hasActiveStorageFilters even when the parent forced the scope via suppressSourceFilter (e.g. Proxmox/Storage mounts StorageSurface with forcedSourceFilter='proxmox-pve'). Because 'proxmox-pve' is not the global DEFAULT_STORAGE_SOURCE_FILTER ('all'), the active-filter check returned true on first paint and the Reset button showed unconditionally — even though no user-controllable filter had been changed. Treat the source filter as DEFAULT_STORAGE_SOURCE_FILTER inside the active check when suppressSourceFilter is set; the user can't change that filter on a scoped storage tab, so it must not surface Reset. suppressNodeFilter was already handled symmetrically; this aligns sourceFilter with that contract. --- .../src/components/Storage/StoragePageControls.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend-modern/src/components/Storage/StoragePageControls.tsx b/frontend-modern/src/components/Storage/StoragePageControls.tsx index f00ba0a3dd..80204d9ba8 100644 --- a/frontend-modern/src/components/Storage/StoragePageControls.tsx +++ b/frontend-modern/src/components/Storage/StoragePageControls.tsx @@ -116,7 +116,13 @@ export const StoragePageControls: Component = (props) sortDirection: props.sortDirection(), groupBy: props.storageFilterGroupBy(), statusFilter: props.statusFilter(), - sourceFilter: props.sourceFilter(), + // When the Source filter is suppressed (a platform page like + // Proxmox/Storage forces it to its own scope via + // `forcedSourceFilter`), the user cannot change it — so it must not + // count as an "active filter" that surfaces the Reset button. + sourceFilter: props.suppressSourceFilter + ? DEFAULT_STORAGE_SOURCE_FILTER + : props.sourceFilter(), diskRoleFilter: props.diskRoleFilter?.(), diskGroupFilter: props.diskGroupFilter?.(), }) ||