Skip to content

feat(dashboard-filters): Enable "Select All" for dynamic search filters#37479

Open
ramiroaquinoromero wants to merge 2 commits into
apache:masterfrom
ramiroaquinoromero:ramiro.aquino.romero/sc-97113/select-all-for-dynamically-search-filter
Open

feat(dashboard-filters): Enable "Select All" for dynamic search filters#37479
ramiroaquinoromero wants to merge 2 commits into
apache:masterfrom
ramiroaquinoromero:ramiro.aquino.romero/sc-97113/select-all-for-dynamically-search-filter

Conversation

@ramiroaquinoromero
Copy link
Copy Markdown
Contributor

@ramiroaquinoromero ramiroaquinoromero commented Jan 27, 2026

SUMMARY

Enables the "Select All" button for dashboard native filters when "Dynamically search all filter values" is enabled.

The Change

// Before
allowSelectAll={!searchAllOptions}  // Disabled when dynamic search was on

// After
allowSelectAll={multiSelect}  // Enabled for all multi-select filters

Why This Works

The Select component already handles "Select All" intelligently:

  • When you search and click "Select All" → it selects only the visible/filtered results
  • When you don't search and click "Select All" → it selects all available options

This works the same way whether the filter uses dynamic search (backend filtering) or static search (frontend filtering). The component already had this logic - we just needed to stop disabling the button.

BEFORE/AFTER

BEFORE: No "Select All"/"Deselect All" buttons when "Dynamically search all filter values" enabled

select-all-for-dynamically-search-filter-before.mp4

AFTER: Buttons visible and functional for all multi-select filters

select-all-for-dynamically-search-filter-after.mp4

TESTING INSTRUCTIONS

  1. Create a dashboard filter with "Dynamically search all filter values" enabled
  2. Open the filter dropdown → Verify "Select All" button appears
  3. Type a search term → Click "Select All" → Verify only matching values are selected
  4. Deselect one value → Verify it's removed
  5. Click "Deselect All" → Verify all cleared
  6. Test non-dynamic filter → Verify "Select All" still works (regression check)

@ramiroaquinoromero ramiroaquinoromero marked this pull request as ready for review January 27, 2026 08:02
@dosubot dosubot Bot added the dashboard:native-filters Related to the native filters of the Dashboard label Jan 27, 2026
@bito-code-review
Copy link
Copy Markdown
Contributor

bito-code-review Bot commented Jan 27, 2026

Code Review Agent Run #34b145

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: f8dee5d..f8dee5d
    • superset-frontend/src/filters/components/Select/SelectFilterPlugin.tsx
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@msyavuz msyavuz self-requested a review January 27, 2026 09:30
Copy link
Copy Markdown
Member

@msyavuz msyavuz left a comment

Choose a reason for hiding this comment

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

This becomes a problem after 1k rows on the select. Before and after doesn't show that but if you have more than 1k rows 'Select all' would display the 1000 after a while.

Image

@ramiroaquinoromero
Copy link
Copy Markdown
Contributor Author

ramiroaquinoromero commented Jan 27, 2026

This becomes a problem after 1k rows on the select. Before and after doesn't show that but if you have more than 1k rows 'Select all' would display the 1000 after a while.

Thanks for catching this @msyavuz! You're absolutely right, I didn't consider the case where there are more than 1,000 rows. Currently, clicking "Select all" would only select the first 1,000 visible options, which is misleading.
I see two potential approaches to fix this:

  • Option 1: Disable "Select All" when data is truncated
    We could hide the "Select All" button when searchAllOptions is enabled and we've hit the 1,000 row limit. This would prevent users from thinking they're selecting all values when they're only getting a subset. It's the safest approach but less functional - users lose the convenience of selecting all visible options.

  • Option 2: Leverage inverse selection mode
    Since we already have inverse selection support (inverseSelection), we could make "Select All" with dynamic search automatically switch to inverse mode. This would work like:

    • User clicks "Select All" → switches to "all values EXCEPT..." mode
    • User can then deselect specific values they don't want
    • The query would use NOT IN instead of IN, so it truly selects all possible values

    This approach is more powerful but requires careful UX consideration, we'd need to make it clear that the mode switched, maybe with a toast notification or visual indicator.

What do you think? I'm leaning toward Option 1 for simplicity and to avoid confusion, but Option 2 would be more feature-complete. Happy to implement whichever approach the team prefers.

@bito-code-review
Copy link
Copy Markdown
Contributor

bito-code-review Bot commented Jan 27, 2026

Code Review Agent Run #397b14

Actionable Suggestions - 0
Additional Suggestions - 3
  • superset-frontend/src/filters/components/Select/SelectFilterPlugin.test.tsx - 3
    • Misleading test name · Line 684-684
      The test name claims 'allowSelectAll is enabled when searchAllOptions is enabled for multi-select', but the code sets allowSelectAll={multiSelect} regardless of searchAllOptions. The test checks for .ant-select-multiple (multiple mode), which is correct for multiSelect=true, but the name misleads about allowSelectAll's dependency.
    • Inconsistent test naming · Line 694-694
      Similar to the first test, this name suggests allowSelectAll is disabled for single-select, which is correct, but the test verifies the mode class absence, not allowSelectAll specifically. Rename for clarity.
    • Inaccurate test comment · Line 709-709
      The comment says 'Select first option' but the code clicks 'girl', which is not the first option in the data (['boy', 'girl', null]). This could confuse readers about which option is being selected.
Review Details
  • Files reviewed - 2 · Commit Range: f8dee5d..cc0c988
    • superset-frontend/src/filters/components/Select/SelectFilterPlugin.test.tsx
    • superset-frontend/src/filters/components/Select/SelectFilterPlugin.tsx
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@msyavuz
Copy link
Copy Markdown
Member

msyavuz commented Jan 28, 2026

@ramiroaquinoromero I think option one is more aligned with the already existing the behaviour. Let's go with that.

Comment thread superset-frontend/src/filters/components/Select/SelectFilterPlugin.tsx Outdated
@netlify
Copy link
Copy Markdown

netlify Bot commented Jan 28, 2026

Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit ad39e27
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/698d356b10fc3e0008633c54
😎 Deploy Preview https://deploy-preview-37479--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown
Contributor

@bito-code-review bito-code-review Bot left a comment

Choose a reason for hiding this comment

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

Code Review Agent Run #098c25

Actionable Suggestions - 2
  • superset-frontend/src/filters/components/Select/SelectFilterPlugin.test.tsx - 2
Additional Suggestions - 2
  • superset-frontend/src/filters/components/Select/SelectFilterPlugin.tsx - 1
    • Hardcoded value in condition · Line 516-518
      The condition hardcodes 1000 but should use formData.rowLimit, as the row limit can be configured differently, potentially enabling 'select all' when data is truncated or disabling it unnecessarily.
      Code suggestion
       @@ -517,1 +517,1 @@
      -              multiSelect && !(searchAllOptions && data.length >= 1000)
      +              multiSelect && !(searchAllOptions && data.length >= formData.rowLimit)
  • superset-frontend/src/filters/components/Select/SelectFilterPlugin.test.tsx - 1
    • Avoid `any` type · Line 80-80
      Using `any` type in the test helper violates the guideline to avoid `any` types in TypeScript.
      Code suggestion
       @@ -80,1 +80,1 @@
      - const getWrapper = (props: any = {}) => {
      + const getWrapper = (props: Partial<{ searchAllOptions: boolean; multiSelect: boolean; queriesData: any[] } & Record<string, any>> = {}) => {
Review Details
  • Files reviewed - 2 · Commit Range: cc0c988..1b6fcd1
    • superset-frontend/src/filters/components/Select/SelectFilterPlugin.test.tsx
    • superset-frontend/src/filters/components/Select/SelectFilterPlugin.tsx
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

Comment thread superset-frontend/src/filters/components/Select/SelectFilterPlugin.test.tsx Outdated
Comment thread superset-frontend/src/filters/components/Select/SelectFilterPlugin.test.tsx Outdated
@ramiroaquinoromero
Copy link
Copy Markdown
Contributor Author

@msyavuz Please review it.

@pull-request-size pull-request-size Bot added size/L and removed size/M labels Jan 29, 2026
Comment thread superset-frontend/src/filters/components/Select/SelectFilterPlugin.test.tsx Outdated
Comment thread superset-frontend/src/filters/components/Select/SelectFilterPlugin.test.tsx Outdated
Comment thread superset-frontend/src/filters/components/Select/SelectFilterPlugin.test.tsx Outdated
Comment thread superset-frontend/src/filters/components/Select/SelectFilterPlugin.tsx Outdated
@bito-code-review
Copy link
Copy Markdown
Contributor

bito-code-review Bot commented Jan 29, 2026

Code Review Agent Run #8a5453

Actionable Suggestions - 0
Review Details
  • Files reviewed - 2 · Commit Range: 1b6fcd1..283da0c
    • superset-frontend/src/filters/components/Select/SelectFilterPlugin.test.tsx
    • superset-frontend/src/filters/components/Select/SelectFilterPlugin.tsx
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@github-actions github-actions Bot added risk:db-migration PRs that require a DB migration i18n:spanish Translation related to Spanish language api Related to the REST API doc Namespace | Anything related to documentation embedded plugins dependencies:npm github_actions Pull requests that update GitHub Actions code packages labels Feb 12, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.67%. Comparing base (bd419d1) to head (ad39e27).
⚠️ Report is 211 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master   #37479       +/-   ##
===========================================
+ Coverage        0   66.67%   +66.67%     
===========================================
  Files           0      671      +671     
  Lines           0    51579    +51579     
  Branches        0     5770     +5770     
===========================================
+ Hits            0    34391    +34391     
- Misses          0    15802    +15802     
- Partials        0     1386     +1386     
Flag Coverage Δ
hive 41.50% <ø> (?)
mysql 64.59% <ø> (?)
postgres 64.67% <ø> (?)
presto 41.52% <ø> (?)
python 66.46% <ø> (?)
sqlite 64.26% <ø> (?)
superset-extensions-cli 96.49% <ø> (?)
unit 100.00% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread superset-frontend/src/filters/components/Select/SelectFilterPlugin.test.tsx Outdated
@ramiroaquinoromero ramiroaquinoromero force-pushed the ramiro.aquino.romero/sc-97113/select-all-for-dynamically-search-filter branch from ad39e27 to 01656af Compare February 12, 2026 02:41
@pull-request-size pull-request-size Bot added size/M and removed size/L labels Feb 12, 2026
@github-actions github-actions Bot removed i18n Namespace | Anything related to localization risk:db-migration PRs that require a DB migration i18n:spanish Translation related to Spanish language api Related to the REST API doc Namespace | Anything related to documentation embedded plugins dependencies:npm github_actions Pull requests that update GitHub Actions code packages labels Feb 12, 2026
@bito-code-review
Copy link
Copy Markdown
Contributor

bito-code-review Bot commented Feb 12, 2026

Code Review Agent Run #3d1f1b

Actionable Suggestions - 0
Additional Suggestions - 1
  • superset-frontend/src/filters/components/Select/SelectFilterPlugin.test.tsx - 1
    • Test Asserts Rendering, Not Behavior · Line 684-702
      The tests 'allowSelectAll is enabled when searchAllOptions is enabled for multi-select' and 'allowSelectAll is not enabled for single-select filters' only check the presence of the .ant-select-multiple CSS class, which verifies rendering rather than the actual behavior of allowSelectAll. Per BITO rule [6262], tests should assert business logic and behavior, not just component rendering. This can allow bugs in allowSelectAll functionality to go undetected.
Review Details
  • Files reviewed - 2 · Commit Range: 837c0dd..01656af
    • superset-frontend/src/filters/components/Select/SelectFilterPlugin.test.tsx
    • superset-frontend/src/filters/components/Select/SelectFilterPlugin.tsx
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@michael-s-molina
Copy link
Copy Markdown
Member

@ramiroaquinoromero @msyavuz We tried to implement a similar feature in the past but there are many problems related to pagination, payload size, etc. Check #20143 for more context.

@msyavuz
Copy link
Copy Markdown
Member

msyavuz commented Feb 13, 2026

@ramiroaquinoromero I think technical difficulties @michael-s-molina and @geido had in the past still apply here. Can you check out the pr Michael linked and test those cases?

@ramiroaquinoromero
Copy link
Copy Markdown
Contributor Author

@ramiroaquinoromero I think technical difficulties @michael-s-molina and @geido had in the past still apply here. Can you check out the pr Michael linked and test those cases?

Sure. I am on it.

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 size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants