Skip to content

fix(explore): hide value input for unary filter operators#39924

Merged
sadpandajoe merged 2 commits into
apache:masterfrom
massucattoj:fix/filter-popover-hide-unary-operator-value
May 23, 2026
Merged

fix(explore): hide value input for unary filter operators#39924
sadpandajoe merged 2 commits into
apache:masterfrom
massucattoj:fix/filter-popover-hide-unary-operator-value

Conversation

@massucattoj
Copy link
Copy Markdown
Contributor

SUMMARY

In the Explore filter popover (Simple tab), when a unary operator was selected
(IS NULL, IS NOT NULL, IS TRUE, IS FALSE), the value input below the
operator dropdown was rendered in a disabled (grayed-out) state instead of
being hidden. Disabled inputs that can never be interacted with create visual
noise and confuse users about what is required to complete the filter.

This change hides the value control entirely whenever the selected operator
appears in DISABLE_INPUT_OPERATORS, so only the column and operator fields
are shown for unary operators.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before:
Screenshot 2026-05-06 at 22 11 50

After:
Screenshot 2026-05-06 at 22 10 58

TESTING INSTRUCTIONS

  1. Open any chart in Explore (e.g. a Table chart on birth_names or any
    dataset).
  2. In the FILTERS section, click an existing filter or + Add filter.
  3. Switch to the SIMPLE tab.
  4. Pick any column.
  5. Change the operator to Is null, Is not null, Is true, or Is false.
  6. Expected: the value input below the operator does not render at
    all (previously it rendered as a disabled/grayed input).
  7. Switching back to a non-unary operator (e.g. Equal to, In) should
    restore the value input.

Automated coverage: see four new tests in
AdhocFilterEditPopoverSimpleTabContent.test.tsx asserting that the value
input is not in the document for each unary operator.

ADDITIONAL INFORMATION

  • Has associated issue:
  • 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

@bito-code-review
Copy link
Copy Markdown
Contributor

bito-code-review Bot commented May 7, 2026

Code Review Agent Run #154654

Actionable Suggestions - 0
Additional Suggestions - 1
  • superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent/AdhocFilterEditPopoverSimpleTabContent.test.tsx - 1
    • Test Duplication · Line 489-551
      The four test functions for hiding the value input are nearly identical, differing only in the operator. This creates maintenance risk if the test structure needs changes. Consider parameterizing with test.each for better maintainability.
      Code suggestion
       @@ -489,64 +489,20 @@
      -test('hides the value input when operator is IS_NULL', () => {
      -  setup({
      -    adhocFilter: new AdhocFilter({
      -      expressionType: ExpressionTypes.Simple,
      -      subject: 'value',
      -      operatorId: Operators.IsNull,
      -      operator: OPERATOR_ENUM_TO_OPERATOR_TYPE[Operators.IsNull].operation,
      -      comparator: undefined,
      -      clause: Clauses.Where,
      -    }),
      -  });
      -  expect(
      -    screen.queryByPlaceholderText('Filter value (case sensitive)'),
      -  ).not.toBeInTheDocument();
      -});
      -
      -test('hides the value input when operator is IS_NOT_NULL', () => {
      -  setup({
      -    adhocFilter: new AdhocFilter({
      -      expressionType: ExpressionTypes.Simple,
      -      subject: 'value',
      -      operatorId: Operators.IsNotNull,
      -      operator: OPERATOR_ENUM_TO_OPERATOR_TYPE[Operators.IsNotNull].operation,
      -      comparator: undefined,
      -      clause: Clauses.Where,
      -    }),
      -  });
      -  expect(
      -    screen.queryByPlaceholderText('Filter value (case sensitive)'),
      -  ).not.toBeInTheDocument();
      -});
      -
      -test('hides the value input when operator is IS_TRUE', () => {
      -  setup({
      -    adhocFilter: new AdhocFilter({
      -      expressionType: ExpressionTypes.Simple,
      -      subject: 'value',
      -      operatorId: Operators.IsTrue,
      -      operator: OPERATOR_ENUM_TO_OPERATOR_TYPE[Operators.IsTrue].operation,
      -      comparator: undefined,
      -      clause: Clauses.Where,
      -    }),
      -  });
      -  expect(
      -    screen.queryByPlaceholderText('Filter value (case sensitive)'),
      -  ).not.toBeInTheDocument();
      -});
      -
      -test('hides the value input when operator is IS_FALSE', () => {
      -  setup({
      -    adhocFilter: new AdhocFilter({
      -      expressionType: ExpressionTypes.Simple,
      -      subject: 'value',
      -      operatorId: Operators.IsFalse,
      -      operator: OPERATOR_ENUM_TO_OPERATOR_TYPE[Operators.IsFalse].operation,
      -      comparator: undefined,
      -      clause: Clauses.Where,
      -    }),
      -  });
      -  expect(
      -    screen.queryByPlaceholderText('Filter value (case sensitive)'),
      -  ).not.toBeInTheDocument();
      -});
      -
      +test.each([
      +  [Operators.IsNull, 'IS_NULL'],
      +  [Operators.IsNotNull, 'IS_NOT_NULL'],
      +  [Operators.IsTrue, 'IS_TRUE'],
      +  [Operators.IsFalse, 'IS_FALSE'],
      +])('hides the value input when operator is %s', (operatorId, operatorName) => {
      +  setup({
      +    adhocFilter: new AdhocFilter({
      -      expressionType: ExpressionTypes.Simple,
      -      subject: 'value',
      -      operatorId,
      -      operator: OPERATOR_ENUM_TO_OPERATOR_TYPE[operatorId].operation,
      -      comparator: undefined,
      -      clause: Clauses.Where,
      -    }),
      -  });
      -  expect(
      -    screen.queryByPlaceholderText('Filter value (case sensitive)'),
      -  ).not.toBeInTheDocument();
      -});
Review Details
  • Files reviewed - 2 · Commit Range: e3e173c..e3e173c
    • superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent/AdhocFilterEditPopoverSimpleTabContent.test.tsx
    • superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent/index.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

@dosubot dosubot Bot added the explore:filter Related to filters in Explore label May 7, 2026
Copy link
Copy Markdown
Contributor

@alexandrusoare alexandrusoare left a comment

Choose a reason for hiding this comment

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

LGTM

@sadpandajoe
Copy link
Copy Markdown
Member

@massucattoj looks ready to go after a rebase.

…hide-unary-operator-value

# Conflicts:
#	superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent/index.tsx
@codecov
Copy link
Copy Markdown

codecov Bot commented May 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.20%. Comparing base (5003ee1) to head (45b7b55).

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #39924   +/-   ##
=======================================
  Coverage   64.20%   64.20%           
=======================================
  Files        2592     2592           
  Lines      139232   139232           
  Branches    32327    32327           
=======================================
  Hits        89389    89389           
  Misses      48308    48308           
  Partials     1535     1535           
Flag Coverage Δ
javascript 67.33% <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.

@sadpandajoe sadpandajoe merged commit 965ec47 into apache:master May 23, 2026
67 of 78 checks passed
@bito-code-review
Copy link
Copy Markdown
Contributor

Bito Automatic Review Skipped – PR Already Merged

Bito scheduled an automatic review for this pull request, but the review was skipped because this PR was merged before the review could be run.
No action is needed if you didn't intend to review it. To get a review, you can type /review in a comment and save it

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

Labels

explore:filter Related to filters in Explore size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants