yousoph opened a new pull request, #42652:
URL: https://github.com/apache/superset/pull/42652
### 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:
1. **`SqlEditorLeftBar`** — the popover content container had `min-width:
500px` but no `max-width`, so the antd Popover sized to `max-content` and grew
to fit the widest child.
2. **`ErrorAlert`** applies `descriptionPre = true` by default, styling the
`description` as preformatted code (monospace `fontFamilyCode` + `white-space:
pre-wrap`). The OAuth2 message body is prose, not a stack trace, so `pre-wrap`
only wrapped against a constrained width the ballooning popover never provided.
### Changes
- `OAuth2RedirectMessage` now passes `descriptionPre={false}` so its prose
body wraps normally instead of rendering as monospace preformatted text.
- The `SqlEditorLeftBar` popover content is capped with `max-width: 500px`
so 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
1. In SQL Lab, open the database/schema selector for a database configured
with OAuth2 (e.g. Snowflake OAuth) while unauthorized.
2. Confirm the "Authorization needed" banner appears, its text wraps within
the popover, and the popover width matches the no-banner state.
Unit tests: `OAuth2RedirectMessage.test.tsx` adds a case asserting the prose
body is not rendered with preformatted/monospace (`pre-wrap`) styling.
### ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration (follow approval process in
[SIP-59](https://github.com/apache/superset/issues/13351))
- [ ] 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
This addresses a customer-reported layout regression.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]