mistercrunch opened a new pull request, #34764:
URL: https://github.com/apache/superset/pull/34764

   ## Overview
   
   Introduces customizable brand spinners that allow customers to replace the 
default loading.gif spinner with their own branding across both frontend 
Loading components and backend bootstrap page.
   
   ## Features
   
   ### 🎨 **Theme Integration**
   - **`brandSpinnerUrl`**: Use custom image URLs for spinners
   - **`brandSpinnerSvg`**: Use inline SVG content with animations (takes 
precedence)
   - Seamless integration with existing Superset theme system
   - Per-theme configuration (different spinners for light/dark modes)
   
   ### 🔄 **Precedence Rules**
   1. **Explicit `image` prop** (highest priority - component override)
   2. **`theme.brandSpinnerSvg`** (theme-based SVG content)
   3. **`theme.brandSpinnerUrl`** (theme-based URL)
   4. **Default `loading.gif`** (fallback)
   
   ### 🌐 **Full Coverage**
   - **Frontend**: All `<Loading />` components use theme-aware spinners
   - **Backend**: Bootstrap page shows custom spinner while JS loads
   - **Consistency**: Same branding throughout entire loading experience
   
   ## Technical Implementation
   
   ### Frontend Changes
   - **Theme Types**: Added `brandSpinnerUrl?` and `brandSpinnerSvg?` to 
`SupersetSpecificTokens`
   - **Loading Component**: Enhanced with theme-aware logic and SVG data URI 
support
   - **Default Theme**: Added spinner tokens to theme configuration
   
   ### Backend Changes
   - **SPA Template**: Updated `superset/templates/superset/spa.html` with 
theme-aware spinner logic
   - **Context Processor**: Enhanced to expose theme data directly to templates
   - **Bootstrap Flow**: Theme data flows from DB/config → template → frontend
   
   ## Configuration Examples
   
   ### Via Theme Configuration
   ```python
   THEME_DEFAULT = {
       "algorithm": "default",
       "token": {
           "brandSpinnerSvg": "<svg>...</svg>",  # Animated SVG spinner
           "brandSpinnerUrl": "/static/custom-spinner.gif"  # Or image URL
       }
   }
   ```
   
   ### Via Theme Administration UI
   - Navigate to Settings → Themes
   - Edit theme and add `brandSpinnerSvg` or `brandSpinnerUrl` fields
   - Changes apply immediately across all loading states
   
   ## Testing
   
   - ✅ **5 new unit tests** covering all precedence scenarios
   - ✅ **Comprehensive test coverage** for theme integration
   - ✅ **All existing tests pass** (85 total tests)
   - ✅ **Pre-commit validation** passes all checks
   
   ## Backward Compatibility
   
   - ✅ **Zero breaking changes** - existing installations work unchanged
   - ✅ **Progressive enhancement** - spinners upgrade automatically when 
configured
   - ✅ **Graceful fallback** - always falls back to default spinner
   


-- 
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: notifications-unsubscr...@superset.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org
For additional commands, e-mail: notifications-h...@superset.apache.org

Reply via email to