Commit Graph

12 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
Michael S. Molina
8a2f7d378a refactor: Removes the deprecated GENERIC_CHART_AXES feature flag (#26372) 2024-01-31 09:45:57 -05:00
Antonio Rivero
7536dd12cd fix(charts): Time grain is None when dataset uses Jinja (#25842) 2023-11-06 09:51:28 -08:00
Michael S. Molina
be11556799 feat: Adds options to show subtotals in Pivot Table (#24960) 2023-08-14 09:20:32 -03:00
Kamil Gabryjelski
f7e76d02b7 feat: Add currencies controls in control panels (#24718) 2023-08-02 19:22:45 +02:00
Michael S. Molina
6e59f11f4c fix: Dashboard time grain in Pivot Table (#24665) 2023-07-13 11:33:16 -03:00
Kamil Gabryjelski
83ff4cd86a feat: Implement currencies formatter for saved metrics (#24517) 2023-06-28 20:51:40 +02:00
Beto Dealmeida
314987f32d fix: pivot v2 charts created before GENERIC_CHART_AXES is enabled (#23731) 2023-04-25 19:44:50 -07:00
Geido
9ed2326a20 feat: Move cross filters to Dashboard (#22785) 2023-01-25 18:01:06 +01:00
Michael S. Molina
e9032e95ec chore: Adds theme object to chart properties (#19951) 2022-05-04 09:55:22 -03:00
Stephen Liu
6f5778273e chore: add type checking in plugin test directory (#19387) 2022-03-28 10:20:06 +08:00
Yongjie Zhao
3c41ff68a4 refactor(monorepo): move superset-ui to superset(stage 2) (#17552) 2021-11-30 08:29:57 +08:00