dosubot[bot] commented on issue #41283: URL: https://github.com/apache/superset/issues/41283#issuecomment-4770027707
<!-- Answer --> Hi @pSpitzner! I'm [Dosu](https://go.dosu.dev/dosubot) and I'm helping the Apache Superset team. Your analysis is spot on. I looked into the code and can confirm the root cause: there's a fundamental disconnect between the frontend tooltip system (introduced in PR #34276) and the backend data population logic. **The issue in detail:** The backend populates tooltip data via `extraProps`, which is driven by the `js_columns` form setting [[1]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/viz.py#L1717-L1731). When you add columns to "Tooltip contents," the frontend expects those fields to exist in the picked object, but there's no logic connecting `tooltip_contents` to the `extraProps` population on the backend side — they are independent settings. The computed metric isn't automatically included in `extraProps` when additional columns are specified. **Possible workarounds (none fully satisfying without CSP changes):** 1. **Custom `js_tooltip` JavaScript** — the `js_tooltip` form control [[2]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/plugins/legacy-preset-chart-deckgl/src/utilities/Shared_DeckGL.jsx#L141-L149) lets you override the default tooltip rendering entirely [[3]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/common.tsx#L44-L46), but this runs arbitrary JS so it has the same CSP issue you noted. 2. **Custom Handlebars template** — if the computed metric is present in the object data, you can reference it in a template, but as you noted this also requires CSP adjustments. **For a proper fix**, I agree with your proposed solution: the default template used when columns are added to "Tooltip contents" should automatically include the `Metric` field. On the backend side, this would mean ensuring the computed metric is included in the data made available to the tooltip (either by adding it to `extraProps` or by having the frontend tooltip builder pull it from the object's top-level properties where it's already available for coloring). One additional note: the entire deck.gl visualization class hierarchy is marked as deprecated since version 3.0 [[4]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/viz.py#L1711-L1717), so any fix here would be patching legacy code. That said, until it's replaced, this is a valid usability gap worth addressing. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=reply-with-mention&utm_term=apache%2Fsuperset).* --- Docs are dead. Just use [Dosu](https://dosu.dev?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-tagline&utm_term=apache%2Fsuperset). [](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-feedback&utm_term=apache%2Fsuperset&message_id=bf586b87-abcf-463f-b3a7-05efb7cb6553) [](https://github.dosu.com/apache/superset?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-ask-repo&utm_term=apache%2Fsuperset) [](https://app.dosu.dev/signup?referrer=openSource&source=github-footer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-share-team&utm_term=apache%2Fsuperset) -- 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]
