Skip to content

fix(filters): keep facet options that appear after a filter change - #402

Open
grzelaka-roche wants to merge 2 commits into
uc-cdis:masterfrom
grzelaka-roche:fix/facet-drop-upstream
Open

grzelaka-roche wants to merge 2 commits into
uc-cdis:masterfrom
grzelaka-roche:fix/facet-drop-upstream

Conversation

@grzelaka-roche

@grzelaka-roche grzelaka-roche commented Aug 26, 2026

Copy link
Copy Markdown

BUG - If guppy/explorer starts with some initial filters and then we drop those filters - the values that didn't exist before in other facets never get displayed.

To reproduce:

  • start data-portal with enabled explorerStoreFilterInURL option and some filter in the URL.
  • drop that facet filter in the UI
  • other facets do not update beyond what was loaded upfront with filter applied

updateCountsInInitialTabsOptions built its output by walking only the frozen initialTabsOptions baseline. When the explorer mounts with a default filter applied, that baseline is captured from an already-filtered aggregation, so bucket keys that surface after an interactive filter change (present in the current response but absent from the baseline) were silently dropped from the UI and could not be displayed or selected.

Build the option universe as the union of the current (processed) response and the frozen baseline: emit all current options first, then re-add baseline-only keys at count 0 to preserve the option-stability feature. The range-filter branch and selectedValues re-add block are unchanged.

Note: this is a partial fix — a companion PR in gen3-ui-component is also required.

This bug has two independent causes in two packages, and both must be fixed for
the facets to display correctly end-to-end:

  1. guppy (this PR): updateCountsInInitialTabsOptions dropped bucket keys
    that were absent from the frozen baseline. Fixed here.
  2. gen3-ui-component: FilterSection seeds its optionsVisibleStatus
    visibility map only in the constructor and has no getDerivedStateFromProps/
    componentDidUpdate. When props.options grows after an interactive filter
    change (without a remount), options missing from that map are filtered out at
    render time — so even with this guppy fix delivering the full histogram, the
    UI still re-caps the list at the initially-loaded count.

With only this guppy PR, the correct/full option set now reaches the render
layer (verified via logging: the full histogram is passed to the filter
component), but gen3-ui-component then re-drops the newly-arrived options at
render time. The companion fix adds a getDerivedStateFromProps to
FilterSection so options arriving via props after mount become visible while
preserving search-box narrowing.

Companion PR: uc-cdis/gen3-ui-component#248

Link to JIRA ticket if there is one:

New Features

Breaking Changes

Bug Fixes

  • Fix explorer facets dropping values that appear only after an interactive filter change. updateCountsInInitialTabsOptions now builds the option list as the union of the current aggregation response and the frozen baseline, instead of restricting output to baseline keys. Note: full end-to-end display also requires the companion gen3-ui-component fix

Improvements

Dependency updates

Deployment changes

Andrzej Grzelak and others added 2 commits August 26, 2026 09:12
updateCountsInInitialTabsOptions built its output by walking only the
frozen initialTabsOptions baseline. When the explorer mounts with a
default filter applied, that baseline is captured from an already-filtered
aggregation, so bucket keys that surface after an interactive filter
change (present in the current response but absent from the baseline)
were silently dropped from the UI and could not be displayed or selected.

Build the option universe as the union of the current (processed) response
and the frozen baseline: emit all current options first, then re-add
baseline-only keys at count 0 to preserve the option-stability feature.
The range-filter branch and selectedValues re-add block are unchanged.

Co-authored-by: Codex <noreply@openai.com>

Co-authored-by: Ona <no-reply@ona.com>
@jbarno

jbarno commented Sep 16, 2026

Copy link
Copy Markdown

pushed update branch to test out image build push changes are happy.

@grzelaka-roche
grzelaka-roche marked this pull request as ready for review September 17, 2026 09:48
@grzelaka-roche

Copy link
Copy Markdown
Author

I added gen3-ui-component fix too
uc-cdis/gen3-ui-component#248

This is now ready.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants