fix(sqllab): stop OAuth2 banner from ballooning the database selector popover - #42652
Open
yousoph wants to merge 1 commit into
Open
fix(sqllab): stop OAuth2 banner from ballooning the database selector popover#42652yousoph wants to merge 1 commit into
yousoph wants to merge 1 commit into
Conversation
When a SQL Lab database uses OAuth2 and the user has not yet authorized,
the "Authorization needed" banner rendered inside the "Select Database and
Schema" popover displayed its body as a single unwrapped monospace line,
forcing the popover (and both selects) to ~3x their normal width. This was
reported by a customer using Snowflake OAuth.
Two fixes:
- OAuth2RedirectMessage passes descriptionPre={false} to ErrorAlert so the
prose body renders with normal white-space (wraps naturally, non-monospace)
instead of preformatted stack-trace styling.
- The SqlEditorLeftBar popover content now has a fixed max-width alongside its
min-width, keeping the popover at a constant width whether or not the banner
is showing and forcing the banner text to wrap vertically.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
|
Bito Review Skipped - Source Branch Not Found |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #42652 +/- ##
=======================================
Coverage 65.44% 65.44%
=======================================
Files 2810 2810
Lines 159362 159362
Branches 36372 36372
=======================================
Hits 104295 104295
Misses 53025 53025
Partials 2042 2042
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SUMMARY
In SQL Lab, the "Select Database and Schema" popover shows an "Authorization needed" banner (
OAuth2RedirectMessage) when the selected database uses OAuth2 and the user has not yet authorized. The banner's body text rendered as a single unwrapped monospace line, which forced the entire popover — and the Database/Schema selects inside it — to balloon to roughly 3x its normal width.Two things combined to cause this:
SqlEditorLeftBar— the popover content container hadmin-width: 500pxbut nomax-width, so the antd Popover sized tomax-contentand grew to fit the widest child.ErrorAlertappliesdescriptionPre = trueby default, styling thedescriptionas preformatted code (monospacefontFamilyCode+white-space: pre-wrap). The OAuth2 message body is prose, not a stack trace, sopre-wraponly wrapped against a constrained width the ballooning popover never provided.Changes
OAuth2RedirectMessagenow passesdescriptionPre={false}so its prose body wraps normally instead of rendering as monospace preformatted text.SqlEditorLeftBarpopover content is capped withmax-width: 500pxso its width stays constant whether or not the banner is shown.Net effect: the popover keeps a stable width, and the authorization message wraps and uses vertical space.
BEFORE
The "Authorization needed" banner appears on one long unwrapped monospace line, stretching the popover ~3x wider and pushing the Database/Schema selects out with it.

AFTER
The popover width is unchanged from the no-banner state; the banner text wraps within the popover and flows downward.

TESTING INSTRUCTIONS
Unit tests:
OAuth2RedirectMessage.test.tsxadds a case asserting the prose body is not rendered with preformatted/monospace (pre-wrap) styling.ADDITIONAL INFORMATION
This addresses a customer-reported layout regression.