fix(ui): centralize default muted findings filter on finding groups#10818
Merged
Conversation
- add `applyDefaultMutedFilter` helper + `MUTED_FILTER` constant in `ui/lib/findings-filters.ts` - wire helper into the findings SSR page and the finding-group resource drill-down so muted findings stay hidden unless the "include muted" checkbox is opted in - cover the helper with unit tests (default injection, opt-in preserved, explicit `false` preserved, no mutation) and extend source-level assertions on page.tsx and use-finding-group-resource-state.ts
Contributor
|
✅ Conflict Markers Resolved All conflict markers have been successfully resolved in this pull request. |
Contributor
|
✅ All necessary |
Contributor
🔒 Container Security ScanImage: ✅ No Vulnerabilities DetectedThe container image passed all security checks. No known CVEs were found.📋 Resources:
|
jfagoagas
reviewed
Apr 21, 2026
jfagoagas
reviewed
Apr 21, 2026
Co-authored-by: Pepe Fagoaga <pepe@prowler.com>
jfagoagas
approved these changes
Apr 21, 2026
Collaborator
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation and see the Github Action logs for details |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
The "include muted findings" checkbox default was enforced inline on the findings SSR page but not on the finding-group resource drill-down, so a user without the toggle could still see muted findings when expanding a group. This PR centralizes the default behind a shared helper and wires both surfaces through it.
This is the minimal standalone fix for the muted-filter regression. The broader filter/sort refactor (shared
composeSort,splitCsvFilterValues, overview widgets migration, etc.) remains in #10803.Description
ui/lib/findings-filters.tswithMUTED_FILTER(const object) andapplyDefaultMutedFilter<T>(filters: T): T. The helper spreadsfilter[muted]=falseBEFORE the caller filters so any explicit value ("false"or the\"include\"opt-in from the checkbox) wins and never gets silently overwritten.ui/lib/index.ts.applyDefaultMutedFilterintoui/app/(prowler)/findings/page.tsxby wrapping the result ofresolveFindingScanDateFiltersso metadata, fetch, and table all receive the same defaulted filters.applyDefaultMutedFilterintoui/hooks/use-finding-group-resource-state.tsvia a derivedeffectiveFiltersconst passed touseFindingGroupResources, so the drill-down honors the same default as the top-level page.\"false\"preserved, no input mutation, empty input).page.test.tsanduse-finding-group-resource-state.test.tsto lock in the wiring.[1.25.0]→🐞 Fixedinui/CHANGELOG.md.Steps to review
ui/lib/findings-filters.tsandui/lib/findings-filters.test.tsto confirm the spread order (default first, caller last) guarantees opt-in wins.ui/app/(prowler)/findings/page.tsx, verify thatfiltersWithScanDatesis now the result ofapplyDefaultMutedFilter(await resolveFindingScanDateFilters(...))so every downstream consumer (metadata info, fetch finding groups, client table) receives the defaulted value.ui/hooks/use-finding-group-resource-state.ts, verify thateffectiveFilters = applyDefaultMutedFilter(filters)is derived once and passed touseFindingGroupResources. The hardcodedincludeMutedInOtherFindings: truefor the drawer is intentionally unchanged (pre-existing behavior for the "Other Findings for this resource" tab)./findingslocally without the muted checkbox toggled: confirm no muted rows appear in either the top-level list or inside any expanded group.Checklist
Community Checklist
SDK/CLI
UI
API
License
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.