Skip to content

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

Open
massucattoj wants to merge 1 commit intoapache:masterfrom
massucattoj:fix/filter-popover-hide-unary-operator-value
Open

fix(explore): hide value input for unary filter operators#39924
massucattoj wants to merge 1 commit intoapache: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
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.

1 participant