Skip to content

fix(sqllab): truncate long tab names in the overflow ("...") dropdown#41585

Merged
msyavuz merged 2 commits into
masterfrom
msyavuz/fix/sqllab-tab-overflow-blank
Jul 1, 2026
Merged

fix(sqllab): truncate long tab names in the overflow ("...") dropdown#41585
msyavuz merged 2 commits into
masterfrom
msyavuz/fix/sqllab-tab-overflow-blank

Conversation

@msyavuz

@msyavuz msyavuz commented Jun 30, 2026

Copy link
Copy Markdown
Member

SUMMARY

When a SQL Lab tab has a very long name and the tab bar collapses tabs into the overflow ("...") dropdown, the dropdown entries render blank, so overflowed tabs become unreachable.

The tab label is a flex node (SqlEditorTabHeader: icon menu + title + status icon), not plain text. antd styles each overflow menu item for a plain-text label (overflow:hidden + text-overflow:ellipsis on the item, flex:1 on its > span). The nested flex TabTitleWrapper defeats that ellipsis and, with no width bound, an extremely long name overflows the item and gets clipped out of view.

Fix: scope a style to the overflow dropdown (via the tabs more overlayClassName) that caps the menu-item width and lets the title truncate inside it. The dropdown is portaled to body, outside the tabs' emotion scope, so the rule lives in SqlLabGlobalStyles. The tab bar itself is untouched.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before: overflow dropdown rows for long-named tabs show empty space (no name).

image

After: each row shows the name truncated with an ellipsis, e.g. AAAAAAAA…, with the menu icon and status dot still visible.

image

TESTING INSTRUCTIONS

  1. Open SQL Lab.
  2. Rename a tab to a very long string (200+ chars) and/or open enough tabs to force overflow.
  3. Click the "..." overflow control at the right of the tab bar.
  4. Each hidden tab now lists its name (truncated with an ellipsis) and clicking switches to it.

Unit: npm run test -- src/SqlLab/components/SqlEditorTabHeader/SqlEditorTabHeader.test.tsx

ADDITIONAL INFORMATION

  • Has associated issue: No
  • Required feature flags: None
  • Changes UI — SQL Lab tab overflow dropdown only
  • Includes DB Migration: No
  • Introduces new feature or API: No
  • Removes existing feature or API: No

https://claude.ai/code/session_015i9w3EMM6EY647fa6SBBSS

@dosubot dosubot Bot added the sqllab:design Related to the SQL Lab UI/UX label Jun 30, 2026
@bito-code-review

bito-code-review Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #5db754

Actionable Suggestions - 0
Additional Suggestions - 1
  • superset-frontend/src/SqlLab/components/TabbedSqlEditors/index.tsx - 1
    • Missing test coverage · Line 266-266
      Consider adding a test assertion to verify that `overlayClassName` is passed to the `more` prop. This ensures the CSS truncation rules defined in `SqlLabGlobalStyles` remain connected to the overflow dropdown as the codebase evolves.
Review Details
  • Files reviewed - 4 · Commit Range: 22afd19..22afd19
    • superset-frontend/src/SqlLab/SqlLabGlobalStyles.tsx
    • superset-frontend/src/SqlLab/components/SqlEditorTabHeader/SqlEditorTabHeader.test.tsx
    • superset-frontend/src/SqlLab/components/SqlEditorTabHeader/index.tsx
    • superset-frontend/src/SqlLab/components/TabbedSqlEditors/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

hideAdd={offline}
onTabClick={onTabClicked}
onEdit={handleEdit}
more={{ overlayClassName: SQLLAB_TAB_OVERFLOW_POPUP_CLASS }}

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 overflow dropdown class is being passed through more.overlayClassName, but Ant Design Tabs uses popupClassName for the collapsed-tabs menu class. With the current prop shape, the custom class is not applied to the popup, so the global truncation styles never take effect and long tab names can still render blank in the overflow menu. Pass the class through the Tabs popup class prop that the component actually consumes. [api mismatch]

Severity Level: Critical 🚨
- ❌ SQL Lab overflowed tab dropdown still omits long tab titles.
- ⚠️ Users cannot easily switch to hidden long-named tabs.
- ⚠️ SQL Lab tab UX remains broken despite added global styles.
Steps of Reproduction ✅
1. Open SQL Lab, which renders `TabbedSqlEditors` via
`src/SqlLab/components/App/index.tsx:6-16` where <TabbedSqlEditors /> is nested inside
`SqlLabStyles` and `AppLayout`.

2. In `TabbedSqlEditors` (`src/SqlLab/components/TabbedSqlEditors/index.tsx:191-208`),
note that each tab item label is a `SqlEditorTabHeader` React node, and the tabs are
rendered through `StyledEditableTabs` (`EditableTabs` wrapper around Ant Design Tabs).

3. The global overflow dropdown truncation styles are defined in
`src/SqlLab/SqlLabGlobalStyles.tsx:4-7,20-43` using the CSS class name
`SQLLAB_TAB_OVERFLOW_POPUP_CLASS = 'sqllab-tab-overflow-popup'`, targeting
`.sqllab-tab-overflow-popup .ant-tabs-dropdown-menu-item` and related selectors.

4. The tabs component attempts to apply that class by passing `more={{ overlayClassName:
SQLLAB_TAB_OVERFLOW_POPUP_CLASS }}` to `StyledEditableTabs`
(`src/SqlLab/components/TabbedSqlEditors/index.tsx:256-33), but `EditableTabs` in
`packages/superset-ui-core/src/components/Tabs/Tabs.tsx:33-47` simply forwards its props
to `AntdTabs` and does not interpret a `more` prop.

5. Ant Design Tabs (as seen from its `AntdTabsProps` usage in `Tabs.tsx:21,25`) exposes
`popupClassName` on the Tabs component, not a `more.overlayClassName` config object;
because `more` is not a valid prop, the overflow dropdown never receives the
`sqllab-tab-overflow-popup` class, the global CSS in `SqlLabGlobalStyles.tsx` does not
apply, and overflowed tabs with very long names continue to render with effectively blank
labels in the "..." dropdown.

Fix in Cursor Fix in VSCode Claude

(Use Cmd/Ctrl + Click for best experience)

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

**Path:** superset-frontend/src/SqlLab/components/TabbedSqlEditors/index.tsx
**Line:** 266:266
**Comment:**
	*Api Mismatch: The overflow dropdown class is being passed through `more.overlayClassName`, but Ant Design Tabs uses `popupClassName` for the collapsed-tabs menu class. With the current prop shape, the custom class is not applied to the popup, so the global truncation styles never take effect and long tab names can still render blank in the overflow menu. Pass the class through the Tabs popup class prop that the component actually consumes.

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 more prop is not a valid property for the Ant Design Tabs component used in this project, so passing overlayClassName through it fails to apply the required CSS class to the overflow dropdown. To resolve this, you should pass the class name using the popupClassName prop, which is the standard Ant Design API for styling the collapsed-tabs menu.

Here is the corrected implementation for superset-frontend/src/SqlLab/components/TabbedSqlEditors/index.tsx:

      onTabClick={onTabClicked}
      onEdit={handleEdit}
      popupClassName={SQLLAB_TAB_OVERFLOW_POPUP_CLASS}
      type={queryEditors?.length === 0 ? 'card' : 'editable-card'}

I have checked the PR comments, and there are no other actionable suggestions or pending review threads to address. Would you like me to perform any other checks on this PR?

superset-frontend/src/SqlLab/components/TabbedSqlEditors/index.tsx

onTabClick={onTabClicked}
      onEdit={handleEdit}
      popupClassName={SQLLAB_TAB_OVERFLOW_POPUP_CLASS}
      type={queryEditors?.length === 0 ? 'card' : 'editable-card'}

expect(queryByText(extraQueryEditor2.name)).not.toBeInTheDocument();
});

test('exposes the name on a dedicated node the overflow dropdown can truncate', () => {

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.

maybe this can be migrate away from the parent describe block? :D

@pull-request-size pull-request-size Bot added size/XL and removed size/M labels Jul 1, 2026
@netlify

netlify Bot commented Jul 1, 2026

Copy link
Copy Markdown

Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 2cfd3f0
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6a4541db4d139c0008936119
😎 Deploy Preview https://deploy-preview-41585--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 Jul 1, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #801910

Actionable Suggestions - 0
Additional Suggestions - 1
  • superset-frontend/src/SqlLab/components/TabbedSqlEditors/index.tsx - 1
    • Deprecated Tabs prop usage · Line 266-266
      The `popupClassName` prop is deprecated in antd 5.x. Please replace it with `classNames={{ popup: SQLLAB_TAB_OVERFLOW_POPUP_CLASS }}` to align with the current Tabs API.
Filtered by Review Rules

Bito filtered these suggestions based on rules created automatically for your feedback. Manage rules.

  • superset-frontend/src/SqlLab/components/SqlEditorTabHeader/SqlEditorTabHeader.test.tsx - 1
Review Details
  • Files reviewed - 2 · Commit Range: 22afd19..dcf6df9
    • superset-frontend/src/SqlLab/components/SqlEditorTabHeader/SqlEditorTabHeader.test.tsx
    • superset-frontend/src/SqlLab/components/TabbedSqlEditors/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

msyavuz added 2 commits July 1, 2026 19:35
The SQL Lab tab label is a flex node (icon menu + title + status icon),
not plain text. antd's overflow dropdown styles each menu item for a
plain-text label (overflow:hidden + text-overflow:ellipsis on the item),
so the nested flex defeats the ellipsis and very long tab names render
blank, leaving overflowed tabs unreachable from the menu.

Scope a style to the overflow dropdown (via the tabs `more`
overlayClassName) that caps the menu item width and lets the title
truncate inside it. The dropdown is portaled to the body, outside the
tabs' emotion scope, so the rule lives in SqlLabGlobalStyles.

Claude-Session: https://claude.ai/code/session_015i9w3EMM6EY647fa6SBBSS
Address review: the overflow dropdown class was passed via
`more.overlayClassName`; switch to Ant Design Tabs' `popupClassName`, the
idiomatic prop for classing the collapsed-tabs popup, so it composes with
the internal dropdown classes instead of replacing them.

Also flatten SqlEditorTabHeader.test.tsx away from its describe blocks
into top-level test() cases (per the test convention), replacing the
shared beforeEach with an openTabDropdown() helper.
@msyavuz
msyavuz force-pushed the msyavuz/fix/sqllab-tab-overflow-blank branch from dcf6df9 to 2cfd3f0 Compare July 1, 2026 16:35
@msyavuz
msyavuz requested a review from hainenber July 1, 2026 16:41
@codecov

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.44%. Comparing base (438d4d5) to head (2cfd3f0).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #41585      +/-   ##
==========================================
- Coverage   64.45%   64.44%   -0.01%     
==========================================
  Files        2670     2670              
  Lines      147335   147336       +1     
  Branches    33988    33988              
==========================================
- Hits        94963    94953      -10     
- Misses      50645    50656      +11     
  Partials     1727     1727              
Flag Coverage Δ
javascript 69.14% <100.00%> (-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.

@msyavuz
msyavuz merged commit b7d5de8 into master Jul 1, 2026
66 checks passed
@msyavuz
msyavuz deleted the msyavuz/fix/sqllab-tab-overflow-blank branch July 1, 2026 17:52
@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

preset-io size/XL sqllab:design Related to the SQL Lab UI/UX

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants