Repository navigation
Conversation
…des rows A checkbox (SET) filter only counted as active while fewer values were selected than the column has. Hide Empty Types removes the blank-name rows, so a selection still holding the blank value matched that count and the filter silently stopped applying. Activeness is now a membership check. Selections keep values that leave the data, so they keep their checked state when those rows return. The check is O(distinct values), so active filters are resolved once per column instead of per row.
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The reset condition can silently reselect excluded values after data shrinks or becomes empty and then returns.
1 open issue
What changed in this PR
Fixes shared-grid SET filters becoming inactive when Deploy Metadata’s Hide Empty Types removes selected values.
Changes:
- Detects active SET filters using membership rather than counts.
- Computes active filters once per column instead of per row.
- Adds shared-grid and Deploy Metadata regression tests.
| File | Description |
|---|---|
| libs/ui/src/lib/data-table/grid/grid-filters.ts | Adds membership-based filter detection. |
| libs/ui/src/lib/data-table/grid/filters/HeaderFilters.tsx | Updates filter indicator checks. |
| libs/ui/src/lib/data-table/grid/filterFns.ts | Uses precomputed active filters. |
| libs/ui/src/lib/data-table/grid/core/useJetstreamTable.ts | Updates selection reset and filter construction. |
| libs/ui/src/lib/data-table/grid/__tests__/useJetstreamTable.spec.tsx | Tests selection retention across data changes. |
| libs/ui/src/lib/data-table/grid/__tests__/grid-filters.spec.ts | Tests stale selected values. |
| libs/features/deploy/src/__tests__/DeployMetadataDeploymentTable.spec.tsx | Tests filtering while toggling empty types. |
Review effort: Balanced
…and returns Coverage alone treated a selection as "all selected" once the data shrank to values it still covered, so restoring the data reselected values the user had excluded. The reset now also requires matching length, which the old check used and which still catches stale selected values.
Comparing a selection with the previous distinct values could not tell a narrowed filter from an untouched one once the data shrank to exactly the selected values, so restoring the data reselected the rest. Deselecting the blank Name and toggling Hide Empty Types on and off brought the empty types back. The reducer now records which columns the user narrowed.
This branch has not been deployed
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.

On Deploy Metadata, checking Hide Empty Types made the column filters stop applying. For example, deselecting
LoggerCorein the Name filter still showedLoggerCore.Cause
The shared grid counted a checkbox (SET) filter as active only while
selected.length < distinctValues.length. Hide Empty Types removes the blank-name rows, but the saved selection still holds the blank value. In the reported case that made the counts equal ([blank, apexEmailNotifications]vs[apexEmailNotifications, LoggerCore]), so the filter silently switched off while the popover still showedLoggerCoreunchecked. The same thing happens in any grid whose data loses a selected value, e.g. once loading rows finish.Fix
isSetFilterNarrowing): it is active if any current value is deselected. The "was everything selected" check that runs when data changes uses the same test, so it no longer resets a customized filter by mistake.columnFiltersis built, not on every row insidejetstreamColumnFilterFn.Tests
useJetstreamTable.spec: a SET filter keeps narrowing when the data drops a selected value, and that value is still selected when it returns.DeployMetadataDeploymentTable.spec: Name filter → Hide Empty Types on → still filtered → off → empty type returns. Confirmed this fails without the fix.grid-filters.spec: updated to the newisFilterActivesignature, plus stale-value cases.ui+features-deploytypecheck and tests pass.RecordDownloadModal.specfailed once during the fulluirun and passed 3 out of 3 times on its own; it is unrelated to this change.