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

   ### SUMMARY
   
   (Written with help from Claude Code (Fable 5.1); I reviewed and refined the 
code and the design decisions, and tested the fix locally on a 7.0.0rc2 build.)
   
   Since #40627 `sanitizeHtml` only keeps an allowlist of CSS properties. The 
tooltip markers were built as sized boxes (`display:inline-block; width; 
height; background`), none of which survive, so Timeseries, Histogram and Mixed 
Timeseries tooltips lost the colored dot in front of each series name.
   
   This builds the marker as a colored glyph (●, ■, ▲, ◆ for the ECharts symbol 
types) using only `color` and `margin-right`, which the allowlist keeps. The 
sanitizer is left as is.
   
   - `tooltipMarker(color, symbol)` added to `superset-ui-core` next to 
`tooltipHtml`.
   - Timeseries uses it instead of its own `getSymbolMarker` box builder 
(removed).
   - Histogram and Mixed Timeseries build the marker from the series color 
ECharts already provides, instead of pasting ECharts' own box marker.
   
   Trade-off: the glyphs approximate the symbol shapes rather than reproduce 
them. The `pin` symbol (a teardrop, only reached when a Timeseries chart cycles 
past five series) now shows as a plain dot, since no non-emoji character 
matches it.
   
   Fixes #45483
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   7.0.0rc2, line chart and histogram.
   
   Before:
   
   <img width="747" height="522" alt="local-rc2-tooltip-line-before" 
src="https://github.com/user-attachments/assets/b3705052-3933-487f-8845-8644eb242735";
 />
   
   <img width="747" height="522" alt="local-rc2-tooltip-hist-before" 
src="https://github.com/user-attachments/assets/29691680-7038-4985-8228-f22ad686a4fc";
 />
   
   After:
   
   <img width="747" height="522" alt="local-rc2-tooltip-line-after" 
src="https://github.com/user-attachments/assets/f36407d8-48ca-462d-ac1b-b136b91fce77";
 />
   
   <img width="747" height="522" alt="local-rc2-tooltip-hist-after" 
src="https://github.com/user-attachments/assets/a47e22ee-2644-4437-9d08-7b6a5fee695c";
 />
   
   ### TESTING INSTRUCTIONS
   
   1. Open a Line Chart with two or more metrics, hover a point: each tooltip 
row starts with a dot in the series color.
   2. Open a Histogram and a Mixed Chart and hover: same.
   3. Unit: `tooltipMarker` output run through `sanitizeHtml` keeps its color 
(`packages/superset-ui-core/test/utils/tooltip.test.ts`).
   
   ### ADDITIONAL INFORMATION
   
   - [x] Has associated issue: #45483
   - [ ] 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 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