You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat: update facet selectors based on current selection - #182
Filter menus on the diagnostics catalog, figure gallery and explorer now only offer values that still return results given the filters already applied, and figure-gallery and explorer filter choices are kept in the URL so the view can be shared as a link. The figure gallery can also filter by the dimensions each figure is tagged with, such as the region and variable of the Regional Historical Timeseries plots.
Summary by CodeRabbit
New Features
Filter menus now show option counts and prioritise choices that return results with the other active filters applied.
Figure galleries support text and dimension-based filters, including an “Unknown” option for missing dimensions. Filter choices can persist in the URL.
Explorer filters now cascade based on earlier selections and persist in the URL.
Execution results now include their dimensions.
Scalar and series filters accept multiple values, matching any selected value. Repeated query parameters support filtering values that contain commas.
Bug Fixes
Changing filters clears invalid selections and resets gallery pagination when the filter changes.
Selected options remain removable even when unavailable under the current filters.
This repository does not receive automatic reviews because it has fewer than 10 stars.
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 3eb49cf0-c76a-42c1-9b01-cdfeb3068976
Walkthrough
The API and frontend now support repeated dimension filters, counted facet options, and figure filtering by output dimensions. Figure gallery and explorer filters can persist in URL search parameters.
Changes: Faceted filtering and URL state
Layer / File(s)
Summary
API dimensions and multi-value filters backend/openapi.json, backend/src/ref_backend/core/reader_values.py, backend/src/ref_backend/models/executions.py, frontend/src/client/types.gen.ts, backend/tests/*, changelog/182.fix.md
Execution outputs include tagged dimensions. The backend parser accepts repeated dimension parameters, removes duplicate values, and returns multiple distinct values as a tuple.
Shared helpers match facet selections, count available values, preserve unavailable selections, and encode comma-containing values. URL helpers parse and write namespaced filters and convert facet parameters for API queries.
Diagnostic filter options now include counts based on the active filters and search. The filter UI displays counts and retains selected values that are no longer available.
The gallery filters figures by tagged dimensions and group selectors. Missing values appear as “Unknown”. Text filtering is debounced, and controlled filter state is supported.
Explorer URL filter cascade frontend/src/components/explorer/*, frontend/src/routes/_app/diagnostics.$providerSlug.$diagnosticSlug/explorer.tsx, frontend/src/routes/_app/explorer/themes.tsx, frontend/src/components/explorer/thematicContent.tsx
Explorer cards receive unique URL namespaces. Their controls resolve sequentially using facet options, and filter selections persist in route search parameters. Theme changes remove card- search parameters.
The dataset filter popover validates the selected facet and value before enabling Add, then clears the value after adding or changing facets. Execution filter tests cover availability of additional facets.
Sequence Diagram(s)
sequenceDiagram
participant ExplorerThemeLayout
participant ExplorerCardContent
participant useFilterControls
participant useFacetedFilter
participant QueryClient
ExplorerThemeLayout->>ExplorerCardContent: Passes each card content search namespace
ExplorerCardContent->>useFilterControls: Passes the namespace to metric-value controls
useFilterControls->>useFacetedFilter: Reads and updates namespaced URL selections
useFilterControls->>QueryClient: Fetches facets for resolved preceding control values
QueryClient-->>useFilterControls: Returns facet options
Loading
Change: Feature
Merge Risk: Low · previous review b4b2a
Filter and facet changes work as described. In the figure gallery, switching filters and then going back can land on an old page instead of the first page. This is a minor annoyance that does not block merging.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title names a feature that is present in the changeset. The raw summary shows facet selectors that offer only values with results under the current filters, computed through the new facet helpers …
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names a feature that is present in the changeset. The raw summary shows facet selectors that offer only values with results under the current filters, computed through the new facet helpers in the frontend and the diagnostics filter options. The title is short and specific enough to convey the primary change, though it does not mention the URL persistence, dimension filtering, or the API changes.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
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
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.
Filter menus on the diagnostics catalog, figure gallery and explorer now only offer values that still return results given the filters already applied, and figure-gallery and explorer filter choices are kept in the URL so the view can be shared as a link. The figure gallery can also filter by the dimensions each figure is tagged with, such as the region and variable of the Regional Historical Timeseries plots.
Summary by CodeRabbit
New Features
Bug Fixes