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

   ### SUMMARY
   
   ECharts charts animate when they first render (~1 second for the draw 
animation). In tiled screenshots, each tile scrolls into view, waits for the 
spinner to clear, then takes the screenshot immediately — but ECharts 
animations can still be mid-draw at that point, producing partially-rendered 
line/area charts.
   
   **Root cause:** `SCREENSHOT_SELENIUM_ANIMATION_WAIT` (the global animation 
delay) runs once before tiling starts, so only tile 1 benefits from it. Tiles 
2+ receive data, clear their spinner, and then get captured while their ECharts 
animation is still running.
   
   **Fix:** Add an `animation_wait: int = 0` parameter to 
`take_tiled_screenshot`. After each per-tile spinner check clears, if 
`animation_wait > 0` the code waits that many seconds before taking the 
screenshot. The call site in `webdriver.py` passes 
`animation_wait=selenium_animation_wait` (same config value already used for 
the global pre-tiling wait), so production deployments with 
`SCREENSHOT_SELENIUM_ANIMATION_WAIT=5` automatically get the per-tile wait too.
   
   The default of `0` is safe for the non-tiled path and for deployments that 
don't configure an animation wait.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   N/A — the bug manifests as partially-rendered ECharts lines captured 
mid-animation; fix ensures each tile waits for animations to complete before 
capture.
   
   ### TESTING INSTRUCTIONS
   
   1. Configure a Superset instance with `SCREENSHOT_TILED_ENABLED=True` and 
`SCREENSHOT_SELENIUM_ANIMATION_WAIT=5`
   2. Create a dashboard with 20+ ECharts line/area charts (enough to exceed 
`SCREENSHOT_TILED_CHART_THRESHOLD`)
   3. Trigger a PDF report and inspect the output — charts should be fully 
rendered on all tiles, not partially drawn
   
   Unit tests: `pytest tests/unit_tests/utils/test_screenshot_utils.py -v`
   
   ### ADDITIONAL INFORMATION
   
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to