Commit Graph

11 Commits

Author SHA1 Message Date
Maxime Beauchemin
bce6ca1ae0 refactor: eliminate all static theme dependencies and enable true dynamic theming
This comprehensive architectural transformation removes all static theme imports
(supersetTheme, themeObject) across the entire codebase, replacing them with
proper dynamic theme access patterns that support real-time theme switching.

## What Changed

**Static Exports Eliminated:**
- Removed `supersetTheme` and `themeObject` exports from core theme module
- Eliminated static theme dependencies across 47 files
- Updated ESLint rules to reflect removed exports

**Dynamic Theme Architecture:**
- Functional components: Use `useTheme()` hook for reactive theme access
- Class components: Use `withTheme()` HOC for theme injection
- Transform functions: Access `theme` from chartProps parameter
- Test infrastructure: Use `Theme.fromConfig()` for isolated testing
- Singleton pattern: `DEFAULT_THEME` for efficient fallbacks

**Test Architecture Cleanup:**
- Removed unnecessary theme setup from 30+ test files
- Eliminated legacy `dynamicTheme` cruft from logic tests
- Simplified theme assertions to focus on behavior vs implementation details
- Maintained theme testing only where legitimately needed

**Core Infrastructure:**
- ThemeController uses dynamic theme creation instead of static imports
- ChartProps uses singleton DEFAULT_THEME for efficient fallbacks
- Theme providers only at app root and isolated contexts (tests, storybook)

## Why This Was Needed

The previous architecture had static theme imports that:
- Always returned light theme values regardless of current theme mode
- Broke dark mode compatibility in visualizations (fixed in previous commit)
- Created performance overhead with redundant theme instance creation
- Prevented real-time theme switching across components
- Led to inconsistent theme access patterns

## Benefits

-  Perfect dark mode support - no static dependencies to break theming
-  True dynamic theming - all components react to theme changes
-  Clean architecture - minimal providers, consistent patterns
-  Better performance - singleton pattern eliminates waste
-  Future-proof - ready for theme customization and user preferences
-  Developer experience - clear patterns for every context

This transformation enables the next generation of Superset theming with
complete dynamic theme support and perfect dark mode compatibility.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-16 10:57:36 -07:00
SBIN2010
9424538bb1 feat: add sort legend to legend section (#34911) 2025-09-04 16:41:47 -07:00
Michael S. Molina
0e165c1a21 fix: Graph chart colors (#30851) 2024-11-11 14:11:17 -08:00
Josh Soref
d0c9cde0ba chore(frontend): Spelling (#25452)
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Co-authored-by: Geido <60598000+geido@users.noreply.github.com>
Co-authored-by: Evan Rusackas <evan@preset.io>
2024-09-10 15:05:35 -06:00
Michael S. Molina
b549977f05 feat: Utility function to render chart tooltips (#27950) 2024-05-07 13:00:30 -03:00
Kamil Gabryjelski
871cab8cbe feat: Enable cross fitlers in WorldMap and Graph charts (#22886) 2023-02-22 11:42:56 +01:00
Ville Brofeldt
2e650eaebe fix(plugin-chart-echarts): tooltip overflow bug (#22218)
Co-authored-by: Ville Brofeldt <ville.brofeldt@apple.com>
2022-11-24 14:11:01 +02:00
Michael S. Molina
3bc0865d90 fix: Drill to detail blocked by tooltip (#22082)
Co-authored-by: Ville Brofeldt <ville.brofeldt@apple.com>
2022-11-23 21:50:06 +02:00
Michael S. Molina
e9032e95ec chore: Adds theme object to chart properties (#19951) 2022-05-04 09:55:22 -03:00
Josh Soref
bebb10e495 chore(frontend-tests): Spelling (#19853)
* spelling: against

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: been

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: charts

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: clicking

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: columns

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: duplicate

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: especially

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: extensions

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: fields

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: filter

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: for

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: label

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: labeled

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: nativefilter

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: registry

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: render

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: resizable

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: response

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: successful

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: transform

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: unfortunately

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: until

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: virtual

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: wrapper

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
2022-04-26 10:35:01 -07:00
Yongjie Zhao
3c41ff68a4 refactor(monorepo): move superset-ui to superset(stage 2) (#17552) 2021-11-30 08:29:57 +08:00