bikash-barnwal opened a new pull request, #43195:
URL: https://github.com/apache/superset/pull/43195

   ### SUMMARY
   
   A handlebars tooltip template on a deck.gl chart renders text with no 
surface behind it — the map shows straight through, and the values are hard to 
read.
   
   The cause is not in `plugin-chart-handlebars`; it is the deck.gl tooltip 
container. `preset-chart-deckgl/src/components/Tooltip.tsx` branched its 
styling on `variant`:
   
   - `variant === 'default'` got the full themed surface — background, color, 
padding, border, radius, shadow;
   - the `else` branch set **only** `margin`. No background, no border, no 
padding.
   
   Handlebars tooltips always take that second branch:
   
   - `utilities/tooltipUtils.tsx` wraps `HandlebarsRenderer` in `<div 
className="deckgl-tooltip" data-tooltip-type="custom">` when 
`formData.tooltip_template` is set;
   - `DeckGLContainer.tsx:114-122` detects that marker and renders `<Tooltip … 
variant="custom" />`;
   - `utilities/HandlebarsRenderer.tsx` emits the compiled template in a plain 
div with only sizing rules.
   
   So nothing along the handlebars path ever painted a background. The default 
tooltip already has the correct chrome, which is why only custom templates are 
affected.
   
   The fix applies the same themed surface to both variants; `variant` now only 
picks the offset margin (`sizeUnit * 2` default vs `sizeUnit * 3` custom, 
preserving existing spacing). All values are antd theme tokens — no literal 
colors, so `theme-colors/no-literal-colors` stays satisfied.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   Before: handlebars tooltip text floats directly over the map with no 
background.
   After: same opaque, bordered, elevated surface the default deck.gl tooltip 
already uses.
   
   ### TESTING INSTRUCTIONS
   
   ```bash
   cd superset-frontend
   npm run test -- plugins/preset-chart-deckgl/src/components/Tooltip 
plugins/preset-chart-deckgl/src/DeckGLContainer
   ```
   
   **11 tests across 2 suites pass** (verified in a clean checkout). The 
component had no test file; this adds one asserting the custom variant's 
computed background/color/radius/padding, plus a default-variant regression 
test and a null-tooltip case.
   
   Manually: a deck.gl chart with a handlebars **Tooltip template**, hovered 
over a light and a dark area of the basemap.
   
   Not verified: no browser screenshot was taken. The change applies styling 
already used by the default tooltip in the same component.
   
   Possible follow-up, left out to keep the diff minimal: 
`HandlebarsRenderer.tsx` still sets hardcoded `maxWidth: '300px'` and 
`fontSize: '12px'` inline, now duplicating the container's token-based values.
   
   ### ADDITIONAL INFORMATION
   
   - [x] Has associated issue: Fixes #41154
   - [ ] Required feature flags:
   - [x] 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
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


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