Skip to content

fix(explore): prevent duplicate Date Range tooltips - #43425

Open
ayush-singh-0601 wants to merge 1 commit into
apache:masterfrom
ayush-singh-0601:fix/date-range-double-tooltip
Open

fix(explore): prevent duplicate Date Range tooltips#43425
ayush-singh-0601 wants to merge 1 commit into
apache:masterfrom
ayush-singh-0601:fix/date-range-double-tooltip

Conversation

@ayush-singh-0601

Copy link
Copy Markdown

SUMMARY

Hovering the Date Range info icon in Explore currently opens two tooltips at once: the control description and the resolved time-range tooltip on the field.

The info icon lives in ControlHeader and is absolutely positioned next to the label. The Date Range value is wrapped in its own tooltip in DateFilterLabel. Those two hover targets can overlap, so both tooltips fire together.

This keeps both tooltips. The field tooltip is suppressed only while the info icon is hovered, the icon stacking is isolated from the field, and the field tooltip closes immediately on mouse leave. Hovering the Date Range field still shows the time-range tooltip.

Fixes #43386

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before — hovering the info icon shows two tooltips:

Before: two tooltips on the Date Range info icon

After — hovering the info icon shows only the description tooltip:

After: only the info icon tooltip

After — hovering the Date Range field still shows the field tooltip:

After: field tooltip still works

TESTING INSTRUCTIONS

  1. Start Superset locally (docker compose up --build or your usual setup).
  2. Log in and open a chart in Explore, for example Transactions.
  3. Hover the i icon next to the Date Range label.
  4. Confirm only the description tooltip appears.
  5. Hover the Date Range field itself.
  6. Confirm the resolved time-range tooltip still appears, and the description tooltip does not.

Unit coverage is in DateFilterLabel.test.tsx: it hovers the field, then the info icon, and asserts only one tooltip is shown.

ADDITIONAL INFORMATION

  • Has associated issue: Fixes 'i' icon next to the Date Range picker - two tooltip popups are shown #43386
  • 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 change:frontend Requires changing the frontend explore:design Related to the Explore UI/UX labels Aug 22, 2026
@bito-code-review

bito-code-review Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #fec59b

Actionable Suggestions - 0
Review Details
  • Files reviewed - 4 · Commit Range: d60fc0a..d60fc0a
    • superset-frontend/src/explore/components/ControlHeader.tsx
    • superset-frontend/src/explore/components/controls/DateFilterControl/DateFilterLabel.tsx
    • superset-frontend/src/explore/components/controls/DateFilterControl/tests/DateFilterLabel.test.tsx
    • superset-frontend/src/explore/components/controls/DateFilterControl/types.ts
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • Eslint (Linter) - ✔︎ Successful

Bito Usage Guide

Commands

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

  • /review - Manually triggers an incremental AI Review.

  • /review full - 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 on lines 113 to 117
<Icons.InfoCircleOutlined
css={iconStyles}
onClick={tooltipOnClick}
aria-label={t('Show info tooltip')}
/>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggestion: The icon is given an accessible name but remains a non-focusable SVG inside a plain span; keyboard and assistive-technology users cannot reach or activate the existing tooltipOnClick action. Make the icon wrapper keyboard-focusable with appropriate button semantics and keyboard activation, or remove the action-oriented aria-label if the icon is intentionally hover-only. [api mismatch]

Severity Level: Major ⚠️
- ⚠️ Keyboard users cannot reach described Explore controls' info actions.
- ⚠️ Screen readers announce an unavailable button action.
- ⚠️ `tooltipOnClick` remains mouse-only for control headers.

Use CodeAnt Skill

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** superset-frontend/src/explore/components/ControlHeader.tsx
**Line:** 113:117
**Comment:**
	*Api Mismatch: The icon is given an accessible name but remains a non-focusable SVG inside a plain span; keyboard and assistive-technology users cannot reach or activate the existing `tooltipOnClick` action. Make the icon wrapper keyboard-focusable with appropriate button semantics and keyboard activation, or remove the action-oriented `aria-label` if the icon is intentionally hover-only.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
👍 | 👎

@bito-code-review

Copy link
Copy Markdown
Contributor

The flagged issue is correct. The Icons.InfoCircleOutlined component is currently inside a span that lacks keyboard focusability and button semantics, making the onClick handler inaccessible to keyboard users. To resolve this, you should convert the wrapper span into a button element with appropriate styling to maintain the layout, or add tabIndex={0} and role="button" along with keyboard event handlers to the existing wrapper.

Here is a concise fix using a button element:

<button
  type="button"
  data-test={`${name}-description-icon`}
  onMouseEnter={() => onDescriptionHoverChange?.(true)}
  onMouseLeave={() => onDescriptionHoverChange?.(false)}
  onClick={tooltipOnClick}
  css={css`
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
  `}
  aria-label={t('Show info tooltip')}
>
  <Tooltip
    id="description-tooltip"
    title={description}
    placement="top"
    mouseLeaveDelay={0}
  >
    <Icons.InfoCircleOutlined css={iconStyles} />
  </Tooltip>{' '}
</button>

Would you like me to check the rest of the comments on this PR and implement fixes for them as well?

superset-frontend/src/explore/components/ControlHeader.tsx

<button
  type="button"
  data-test={`${name}-description-icon`}
  onMouseEnter={() => onDescriptionHoverChange?.(true)}
  onMouseLeave={() => onDescriptionHoverChange?.(false)}
  onClick={tooltipOnClick}
  css={css`
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
  `}
  aria-label={t('Show info tooltip')}
>
  <Tooltip
    id="description-tooltip"
    title={description}
    placement="top"
    mouseLeaveDelay={0}
  >
    <Icons.InfoCircleOutlined css={iconStyles} />
  </Tooltip>{' '}
</button>

@codecov

codecov Bot commented Aug 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.88889% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 78.86%. Comparing base (f2610e9) to head (d60fc0a).

Files with missing lines Patch % Lines
...-frontend/src/explore/components/ControlHeader.tsx 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #43425      +/-   ##
==========================================
+ Coverage   78.85%   78.86%   +0.01%     
==========================================
  Files        2876     2876              
  Lines      164581   164589       +8     
  Branches    38011    38014       +3     
==========================================
+ Hits       129786   129809      +23     
+ Misses      32348    32333      -15     
  Partials     2447     2447              
Flag Coverage Δ
javascript 74.23% <88.88%> (+0.02%) ⬆️

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

☔ View full report in Codecov by Harness.
📢 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.

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

Labels

change:frontend Requires changing the frontend explore:design Related to the Explore UI/UX size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

'i' icon next to the Date Range picker - two tooltip popups are shown

1 participant