Skip to content

fix(sqllab): make MenuDotsDropdown trigger focusable for tab rename - #43015

Merged
sadpandajoe merged 4 commits into
masterfrom
fix/followup-41329-follow-up-from-41329-fix-sqllab-replace-
Aug 13, 2026
Merged

fix(sqllab): make MenuDotsDropdown trigger focusable for tab rename#43015
sadpandajoe merged 4 commits into
masterfrom
fix/followup-41329-follow-up-from-41329-fix-sqllab-replace-

Conversation

@rusackas

@rusackas rusackas commented Aug 10, 2026

Copy link
Copy Markdown
Member

Follow-up to #41329.

SUMMARY

#41329 replaced SQL Lab's native prompt() tab rename with a Modal, and returns keyboard focus to the tab header after the modal closes. The author explicitly deferred making the "..." (MenuDotsDropdown) trigger itself focusable to a follow-up, so focus landed on the whole tab header wrapper instead of the specific "Rename tab" menu trigger that opened the modal.

This makes MenuDotsDropdown's trigger a native <button> (instead of a div with role="button") and forwards a ref to it, so SqlEditorTabHeader can return focus to that trigger specifically, both after Save and after Cancel/close. A native button gets keyboard focusability and Enter/Space activation for free, and gets an aria-label for screen readers.

TESTING INSTRUCTIONS

  1. Open SQL Lab.
  2. On a query tab, open the menu and choose "Rename tab".
  3. Save (or Cancel) the rename modal.
  4. Focus returns to the trigger for that tab, not the tab header as a whole.

Covered by updated/added unit tests in SqlEditorTabHeader.test.tsx and Dropdown.test.tsx.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration
  • Introduces new feature or API
  • Removes existing feature or API

🤖 Generated with Claude Code

@dosubot dosubot Bot added change:frontend Requires changing the frontend design:accessibility Related to accessibility standards sqllab Namespace | Anything related to the SQL Lab labels Aug 10, 2026

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

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.

Code Review Agent Run #e1ee0c

Actionable Suggestions - 1
  • superset-frontend/src/SqlLab/components/SqlEditorTabHeader/index.tsx - 1
Additional Suggestions - 1
  • superset-frontend/src/SqlLab/components/SqlEditorTabHeader/index.tsx - 1
    • Focus target changed to dropdown · Line 140-141
      Focus return now targets `dropdownTriggerRef` (the '...' dropdown) instead of `tabHeaderRef` (the tab title wrapper). The comment was updated to match, but verify this matches the intended UX — the user opened the modal by clicking the dropdown menu option, so returning focus to the dropdown trigger may feel appropriate.
Review Details
  • Files reviewed - 4 · Commit Range: beb8643..beb8643
    • superset-frontend/packages/superset-ui-core/src/components/Dropdown/Dropdown.test.tsx
    • superset-frontend/packages/superset-ui-core/src/components/Dropdown/index.tsx
    • superset-frontend/src/SqlLab/components/SqlEditorTabHeader/SqlEditorTabHeader.test.tsx
    • superset-frontend/src/SqlLab/components/SqlEditorTabHeader/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

@codecov

codecov Bot commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

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

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #43015   +/-   ##
=======================================
  Coverage   66.67%   66.67%           
=======================================
  Files        2866     2866           
  Lines      162798   162799    +1     
  Branches    37507    37507           
=======================================
+ Hits       108546   108547    +1     
  Misses      52130    52130           
  Partials     2122     2122           
Flag Coverage Δ
javascript 73.69% <100.00%> (+<0.01%) ⬆️

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.

Copilot AI left a comment

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.

Pull request overview

Improves SQL Lab tab-rename focus management by making the MenuDotsDropdown trigger focusable and ref-addressable, so focus can be returned to the exact trigger that opened the rename modal (instead of the broader tab header wrapper).

Changes:

  • Forward a ref through MenuDotsDropdown and make its trigger focusable.
  • Update SqlEditorTabHeader to focus the menu-dots trigger after rename modal Save/Cancel.
  • Update/add unit tests to assert focus returns to the dropdown trigger.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
superset-frontend/src/SqlLab/components/SqlEditorTabHeader/SqlEditorTabHeader.test.tsx Updates focus assertions to expect focus on the menu-dots trigger after modal close.
superset-frontend/src/SqlLab/components/SqlEditorTabHeader/index.tsx Replaces tab-header ref focusing with a MenuDotsDropdown trigger ref for more precise focus restoration.
superset-frontend/packages/superset-ui-core/src/components/Dropdown/index.tsx Makes MenuDotsDropdown trigger focusable and forwards a ref to it.
superset-frontend/packages/superset-ui-core/src/components/Dropdown/Dropdown.test.tsx Adds coverage for trigger focusability and ref forwarding behavior.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@netlify

netlify Bot commented Aug 11, 2026

Copy link
Copy Markdown

Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 0cc2b0c
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6a7df829eaa6ae0008c3a75c
😎 Deploy Preview https://deploy-preview-43015--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

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

@bito-code-review

bito-code-review Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #c7a439

Actionable Suggestions - 0
Review Details
  • Files reviewed - 4 · Commit Range: beb8643..341906a
    • superset-frontend/packages/superset-ui-core/src/components/Dropdown/Dropdown.test.tsx
    • superset-frontend/packages/superset-ui-core/src/components/Dropdown/index.tsx
    • superset-frontend/src/SqlLab/components/SqlEditorTabHeader/index.tsx
    • superset-frontend/src/SqlLab/components/TabbedSqlEditors/TabbedSqlEditors.test.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

@sha174n sha174n left a comment

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.

LGTM. Switching the trigger to a native is the right focusability fix (Enter/Space activation, role=button, no nested-button since antd clones onto the single child). Minor: the PR description says the trigger is made focusable via tabIndex={0}, but the diff actually uses a native button (the better approach) so no tabIndex is needed — worth updating the wording.

@sha174n sha174n added the merge-if-green If approved and tests are green, please go ahead and merge it for me label Aug 13, 2026
@rusackas

Copy link
Copy Markdown
Member Author

@sha174n good catch, updated the description to match the diff.

rusackas and others added 4 commits August 13, 2026 09:58
…ocus return

Follow-up to #41329, which returned focus to the whole SQL Lab tab header
wrapper after closing the rename-tab modal (the author explicitly deferred
making the menu trigger itself focusable). The "..." trigger is now a
focusable, ref-forwarding element, so focus returns to the specific
"Rename tab" menu trigger instead of the wrapper around it.

Co-Authored-By: Claude <noreply@anthropic.com>
… access

Renders the trigger as a native <button> instead of a div with
role="button", so it gets keyboard activation (Enter/Space) for free and
satisfies the jsx-a11y prefer-tag-over-role rule; also adds an aria-label
so screen readers announce it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…real button

userEvent.keyboard() doesn't exist in the pinned @testing-library/user-event
v12, so the new Dropdown keyboard test never ran; swap in fireEvent to
simulate a native button's Enter-to-click activation. Also update
TabbedSqlEditors' removeQueryEditor test, which picked the tab's first
<button> by position and started grabbing the new "..." actions trigger
instead of the actual remove button.

Co-Authored-By: Claude <noreply@anthropic.com>
The real callers (SqlEditorTabHeader, GridTable HeaderMenu) always pass
trigger={['click']}; antd's Dropdown default trigger is hover, so the
test's fireEvent.click never opened the menu without it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@rusackas
rusackas force-pushed the fix/followup-41329-follow-up-from-41329-fix-sqllab-replace- branch from 341906a to 0cc2b0c Compare August 13, 2026 17:00
Comment on lines +96 to 103
<MenuDotsWrapper
ref={ref}
type="button"
aria-label={t('Actions')}
data-test="dropdown-trigger"
>
{RenderIcon(iconOrientation)}
</MenuDotsWrapper>

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 disabled prop remains on AntdDropdown but is not forwarded to the new native trigger. Consequently, callers such as ActionCell that pass disabled still render a focusable and apparently clickable button, whereas the previous non-focusable div did not add a keyboard tab stop. Forward the disabled state to MenuDotsWrapper so disabled dropdown actions cannot receive focus or appear interactive. [api mismatch]

Severity Level: Major ⚠️
- ⚠️ Empty `ActionCell` menus leave inaccessible disabled controls focusable.
- ⚠️ Keyboard users encounter an action trigger with no available actions.
- ⚠️ Disabled state is visually and semantically incomplete.

Fix in Cursor Fix in VSCode Claude

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

**Path:** superset-frontend/packages/superset-ui-core/src/components/Dropdown/index.tsx
**Line:** 96:103
**Comment:**
	*Api Mismatch: The `disabled` prop remains on `AntdDropdown` but is not forwarded to the new native trigger. Consequently, callers such as `ActionCell` that pass `disabled` still render a focusable and apparently clickable button, whereas the previous non-focusable `div` did not add a keyboard tab stop. Forward the disabled state to `MenuDotsWrapper` so disabled dropdown actions cannot receive focus or appear interactive.

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
👍 | 👎

@sadpandajoe
sadpandajoe merged commit fbeba10 into master Aug 13, 2026
76 checks passed
@sadpandajoe
sadpandajoe deleted the fix/followup-41329-follow-up-from-41329-fix-sqllab-replace- branch August 13, 2026 17:27
@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

change:frontend Requires changing the frontend design:accessibility Related to accessibility standards merge-if-green If approved and tests are green, please go ahead and merge it for me packages preset-io size/M sqllab Namespace | Anything related to the SQL Lab

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants