yousoph opened a new pull request, #42320:
URL: https://github.com/apache/superset/pull/42320

   ### SUMMARY
   
   Error messages shown inside charts — standalone charts and charts embedded 
in dashboards — rendered their stack-trace / error detail in the default UI 
font (Lato) in **dark mode**, instead of the monospace font used in light mode. 
SQL Lab error messages were unaffected.
   
   **Root cause:** `ErrorMessageWithStackTrace` (the shared error component 
used by both SQL Lab's `ResultSet` and charts via `ChartErrorMessage`) rendered 
the stack trace in a bare `<pre>` with no explicit `font-family`, relying on 
the browser/antd default styling for the element. That default is cascade-order 
dependent: when the dark theme's style tags are (re)injected, the UI 
font-family reset wins over the inherited monospace, so the chart error text 
dropped to the UI font. SQL Lab was unaffected because it sets the monospace 
family explicitly on the element (`MonospaceDiv`, `font-family: 
theme.fontFamilyCode`), which always wins regardless of injection order.
   
   **Fix:** Render the stack trace in a `styled.pre` that sets `font-family` 
from `theme.fontFamilyCode` directly on the element — the shared theme token, 
mirroring SQL Lab's `MonospaceDiv` and the existing `TaskStackTracePopover`. 
Because the family is now set on the element from the theme token, it resolves 
to monospace in both light and dark mode. This is the single shared error path, 
so SQL Lab and chart error rendering stay consistent.
   
   ### BEFORE/AFTER
   
   Before: chart error stack traces rendered in the UI font (Lato) in dark mode.
   After: chart error stack traces render in the monospace font 
(`theme.fontFamilyCode`) in both light and dark mode.
   
   ### TESTING INSTRUCTIONS
   
   1. Switch to dark mode.
   2. Trigger a chart error (e.g. a chart whose query errors) in a standalone 
chart and in a dashboard.
   3. Expand the error detail / stack trace and confirm it renders in the 
monospace font, matching light mode and SQL Lab.
   
   ### ADDITIONAL INFORMATION
   
   - [ ] Has associated issue
   - [x] Required feature flags: n/a
   - [x] Changes UI
   - [ ] Includes DB Migration
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API


-- 
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]

Reply via email to