Skip to content

fix(dashboard): adds dependent filters select first value fixes #34137

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

ObservabilityTeam
Copy link
Contributor

@ObservabilityTeam ObservabilityTeam commented Jul 11, 2025

Commit message:

  • adds a fix for correctly selecting first value of a dependent filter
  • adds a fix for automatically selecting the correct dependent filter value on changing parent filter value
  • adds dependent filters fix support for time range filter

SUMMARY

These fixes address issues with dependent filters using the "Select first filter value by default" option:

  • FilterValue.tsx: Prevents child filters from requesting data before their parent values are set. The request is now delayed until all parent filter data is available, ensuring correct first value selection.

  • SelectFilterPlugin: Ensures the first value is correctly updated when parent filter values change. A post-check hook verifies external data changes and selects the appropriate default.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

BEFORE

Dependent-filters-before

AFTER

Dependent-filters-after

TESTING INSTRUCTIONS

  1. Create a dashboard with two filters and some charts these filters are applied to.
  2. Make both filters required and "Select first filter value as default".
  3. Make one of the filters dependent (child) on the other.
  4. Make sure the first value of the dependent filter is not available with the first value of the other filter.
  5. Load dashboard in UI.
  6. First value of the dependent (child) filter is NOT chosen based on it's parent filter(s)
  7. If you change the value of the parent filter(s), the first value of the child does not change which should not be the case because it should reflect changes based on it's parent(s) value.

ADDITIONAL INFORMATION

  • Has associated issue: Fixes #22979
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@dosubot dosubot bot added dashboard Namespace | Anything related to the Dashboard dashboard:native-filters Related to the native filters of the Dashboard labels Jul 11, 2025
Copy link

@korbit-ai korbit-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review by Korbit AI

Korbit automatically attempts to detect when you fix issues in new commits.
Category Issue Status
Documentation Improve cascade filter check comment ▹ view 🧠 Not in standard
Functionality Parent Filter Value Count Uses Default Instead of Current State ▹ view 🧠 Not in scope
Performance Inefficient JSON.stringify in Dependency Array ▹ view 🧠 Not in scope
Functionality Filter state not updating after parent filter changes ▹ view 🧠 Not in scope
Functionality Incomplete data change detection ▹ view 🧠 Incorrect
Functionality Inaccurate Time Range Dependency Counting ▹ view 🧠 Incorrect
Files scanned
File Path Reviewed
superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterValue.tsx
superset-frontend/src/filters/components/Select/SelectFilterPlugin.tsx

Explore our documentation to understand the languages and file types we support and the files we ignore.

Check out our docs on how you can make Korbit work best for you and your team.

Loving Korbit!? Share us on LinkedIn Reddit and X

Muhammad Musfir added 2 commits July 14, 2025 09:21
* adds a fix for correctly selecting first value of a dependent filter
* adds a fix for automatically selecting the correct dependent filter value on changing parent filter value
* adds dependent filters fix support for time range filter
@ObservabilityTeam ObservabilityTeam force-pushed the fix/dependent-filter-select-first-fix branch from da85911 to 6e2dba4 Compare July 14, 2025 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dashboard:native-filters Related to the native filters of the Dashboard dashboard Namespace | Anything related to the Dashboard size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant