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

   ### SUMMARY
   Scheduled dashboard reports render the dashboard headlessly and screenshot 
it into
   a PDF. On tall dashboards with `DashboardVirtualization` active, only a 
moving
   window of charts is mounted, so off-window charts are unrendered 
placeholders.
   
   - **Tiled path** scrolls each region into view and waits per tile → renders
     correctly even with virtualization active (the good path).
   - **Non-tiled path** takes a single full-page screenshot but its readiness 
gate
     only waits for *viewport-visible* holders, so below-the-fold holders are
     captured blank and delivered as `state=Success`.
   
   A large dashboard mis-routes to the non-tiled path when its `scrollHeight` is
   measured while charts are still virtualized/collapsed (`0 < height <= one 
tile`),
   which is why the same dashboard yields good PDFs on some runs and blank on 
others.
   
   Fix (all server-side — the frontend can't be gated on `standalone=Report` 
since
   the Embedded SDK shares that mode):
   - Route large scheduled-report dashboards to the tiled path regardless of a 
stale
     short height measurement, so they can't fall into the single-shot capture.
   - Harden the non-tiled report path: dispatch the client-side
     `superset-force-all-in-view` event to un-window virtualized charts, then 
require
     **all** mounted holders (not just viewport-visible) to reach a terminal 
state via
     a new `REPORT_ALL_CHART_HOLDERS_READY_JS` predicate. On timeout it raises, 
so a
     partial capture fails and retries instead of shipping a blank PDF.
   - Surface below-the-fold offenders in the readiness-timeout diagnostics
     (`all_unready_holders`), which the viewport-scoped scan hid as 
`virtualized`.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   _N/A — backend screenshot pipeline change; covered by unit tests._
   
   ### TESTING INSTRUCTIONS
   `pytest tests/unit_tests/utils/webdriver_test.py 
tests/unit_tests/utils/test_screenshot_utils.py`.
   
   New regression tests: large report tiles despite a short measured height;
   non-tiled report force-renders + waits for all holders; below-fold-unrendered
   raises loudly and logs `all_unready_holders`.
   
   Manual: schedule a report for a tall (> 1 viewport) dashboard with
   `DASHBOARD_VIRTUALIZATION` enabled and confirm the delivered PDF is complete.
   
   ### ADDITIONAL INFORMATION
   - [ ] Has associated issue:
   - [x] Required feature flags: `DASHBOARD_VIRTUALIZATION` (to reproduce)
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
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