GitHub user FrancescoCastaldi added a comment to the discussion: Scalable way to customize Superset for UX improvisation
The most scalable way to customize Superset without falling into maintenance debt or painful merge conflicts on every upstream release is to use **extension points and configuration layers** rather than forking the core frontend codebase. Here is the recommended hierarchy of customizations, ordered from least maintenance to most: ### 1. Configuration & Feature Flags (`superset_config.py`) Many UX behaviors (including dashboard filters) are configurable out of the box: - **Auto-apply native filters without the Apply button:** In native filter configuration, check "Auto-apply filter changes on selection" or configure `DASHBOARD_NATIVE_FILTERS: True` with default auto-apply behavior. - **Theme Variables:** Superset 6.x supports Ant Design theme token overrides through `THEME_OVERRIDES` in `superset_config.py`, allowing you to adjust brand colors, corner radius, padding, and font sizes across all pages without rebuilding assets. ### 2. Dashboard Custom CSS (Zero Maintenance on Upgrade) For utilitarian UX adjustments (such as hiding specific buttons, adjusting card margins, or highlighting active tabs): - Use **Edit Dashboard -> Edit CSS**. - CSS rules live in the Superset metadata database rather than container source code. They persist seamlessly across version upgrades. ### 3. Dynamic Plugins for Custom Visualizations (SIP-38) If you need custom chart controls or tables: - Never edit plugins inside `superset-frontend/plugins/`. - Build your custom plugin as a separate npm package using `@superset-ui/generator-superset`. - Set `DYNAMIC_PLUGINS = True` in `superset_config.py` and register the plugin at runtime via URL or an administrative script. ### 4. Docker Multi-Stage Asset Overlay (If you must patch files) If a functional requirement strictly necessitates modifying a core frontend file (e.g., `FilterBar.tsx`): - Maintain your changes as isolated `.patch` files or discrete source files in your deployment git repository. - Use a multi-stage Dockerfile that builds from the official release tag: ```dockerfile FROM apache/superset:6.1.0 AS custom COPY ./patches/FilterBar.tsx /app/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterBar.tsx # Rebuild only the frontend bundle layer ``` This keeps your base image pinned to official security releases while keeping your customizations transparent and easily rebased. GitHub link: https://github.com/apache/superset/discussions/41185#discussioncomment-19164794 ---- This is an automatically sent email for [email protected]. To unsubscribe, please send an email to: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
