You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by jl...@apache.org on 2026/10/21 19:09:19 UTC
(superset) 01/01: fix(theme): restore the 12px tooltip font size dropped by the theming overhaul
This is an automated email from the ASF dual-hosted git repository.
sadpandajoe pushed a commit to branch ultraset-dashboard-published-favorite-icon-tooltip-too-large
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 78df94537da12797666e5c7f60485932d7af4646
Author: Joe Li <47...@users.noreply.github.com>
AuthorDate: Wed Oct 21 19:09:00 2026 +0000
fix(theme): restore the 12px tooltip font size dropped by the theming overhaul
Superset tooltips rendered at the small font size (12px, line-height 1.6)
from #11737 onward: first as an inline overlayStyle on the Tooltip
wrapper, then as the ``components.Tooltip`` token override that #31182
moved into the Ant Design v5 theme config. The theming overhaul in #31590
(dd129fa403) deleted that theme file wholesale and nothing re-seeded the
override, so from 6.0.0 every tooltip falls back to Ant Design's global
``fontSize`` of 14px. The dashboard favorite and published-status
tooltips in #38726 are the reported symptom.
Seed ``components.Tooltip`` in ``_THEME_DEFAULT_BASE``, the single place
built-in tokens live; ``_THEME_DARK_BASE`` spreads it, so the dark theme
inherits the override and partial ``THEME_DEFAULT`` overrides keep it via
the existing deep merge.
Fixes #38726
Co-Authored-By: Claude Fable 5.1 <no...@anthropic.com>
---
superset/config.py | 9 +++++++++
tests/unit_tests/config_test.py | 20 ++++++++++++++++++++
2 files changed, 29 insertions(+)
diff --git a/superset/config.py b/superset/config.py
index 723c366e4c7..ee61bc1a917 100644
--- a/superset/config.py
+++ b/superset/config.py
@@ -1280,6 +1280,15 @@ _THEME_DEFAULT_BASE: Theme = {
# Editor selection color (for SQL Lab text highlighting)
"colorEditorSelection": "#fff5cf",
},
+ # Per-component token overrides. Tooltip text renders at the small font
+ # size rather than Ant Design's global ``fontSize`` so tooltips stay
+ # visually subordinate to the content they annotate.
+ "components": {
+ "Tooltip": {
+ "fontSize": 12,
+ "lineHeight": 1.6,
+ },
+ },
"algorithm": "default",
}
diff --git a/tests/unit_tests/config_test.py b/tests/unit_tests/config_test.py
index 490cd095dab..520955f30a4 100644
--- a/tests/unit_tests/config_test.py
+++ b/tests/unit_tests/config_test.py
@@ -657,6 +657,26 @@ def test_theme_default_logo_defaults() -> None:
assert config.THEME_DEFAULT["token"]["brandLogoUrl"] == config.APP_ICON
+def test_theme_defaults_seed_tooltip_component_tokens() -> None:
+ """
+ Regression test for #38726: tooltips must render at the small font size.
+
+ The shipped light and dark themes both carry a ``components.Tooltip``
+ override; without it Ant Design falls back to the global ``fontSize``
+ and every tooltip renders two pixels larger than intended.
+ """
+ from superset import config
+
+ expected = {"fontSize": 12, "lineHeight": 1.6}
+ default_components = config.THEME_DEFAULT["components"]
+ assert default_components is not None
+ assert default_components["Tooltip"] == expected
+ assert config.THEME_DARK is not None
+ dark_components = config.THEME_DARK["components"]
+ assert dark_components is not None
+ assert dark_components["Tooltip"] == expected
+
+
def test_smtp_ssl_server_auth_defaults_to_true() -> None:
"""
The shipped default for SMTP_SSL_SERVER_AUTH validates the SMTP server's