Skip to content

fix(sqllab): correct Run dropdown crash and caret color regression - #43849

Draft
sadpandajoe wants to merge 1 commit into
masterfrom
sqllab-run-dropdown-color-crash
Draft

fix(sqllab): correct Run dropdown crash and caret color regression#43849
sadpandajoe wants to merge 1 commit into
masterfrom
sqllab-run-dropdown-color-crash

Conversation

@sadpandajoe

Copy link
Copy Markdown
Member

Summary

  • The SQL Lab Run control's split-button dropdown (shown when CTAS/CVAS is allowed) passed its menu content through antd's overlay prop. Antd v6 dropped that deprecated prop entirely, so the menu never reached antd's internal Dropdown, and clicking the caret threw React.Children.only expected to receive a single React element child.
  • Separately, the caret icon used theme.colorIcon (a neutral "weak action" token) instead of a color meant to contrast against the primary button background, rendering it in the wrong dark/grey shade.
  • Fixes both by passing the menu via the already-supported popupRender prop and using theme.colorTextLightSolid for the caret icon color.

This addresses a customer-reported issue.

Before / After

Before — dark/grey caret on the primary button, and clicking it crashes with React.Children.only:

before

After — caret color matches the button's other icon, and the dropdown menu opens correctly:

after

Test plan

  • Added a failing-first RTL test reproducing the React.Children.only crash on caret click, confirmed it failed for the predicted reason, then fixed it
  • Added a failing-first RTL test asserting the caret icon color, confirmed it failed for the predicted reason, then fixed it
  • Added a general regression test to DropdownButton.test.tsx covering popupRender + click trigger
  • All 16 relevant Jest tests pass
  • Pre-commit (oxfmt/oxlint/stylelint/type-check) passes on changed files

When CTAS/CVAS is allowed on a database, the Run button renders as a
split button via DropdownButton, passing menu content through the
deprecated antd `overlay` prop. antd v6 dropped `overlay` support
entirely, so the passthrough silently became a no-op and clicking the
dropdown caret threw "React.Children.only expected to receive a single
React element child." Pass the menu through `popupRender`, the prop
DropdownButton actually wires up.

Also fixes the caret icon color: it used `colorIcon`, a neutral token
meant for icons on default surfaces, which renders as dark grey against
the primary/danger button background. Use `colorTextLightSolid` instead,
matching the icon-on-primary-button pattern used elsewhere in the
codebase.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@codecov

codecov Bot commented Sep 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 79.42%. Comparing base (cceb52e) to head (ce986b7).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
...c/SqlLab/components/RunQueryActionButton/index.tsx 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #43849      +/-   ##
==========================================
- Coverage   79.42%   79.42%   -0.01%     
==========================================
  Files        2895     2895              
  Lines      167953   167955       +2     
  Branches    38896    38897       +1     
==========================================
+ Hits       133394   133395       +1     
- Misses      32059    32060       +1     
  Partials     2500     2500              
Flag Coverage Δ
javascript 74.94% <66.66%> (-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.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant