bito-code-review[bot] commented on PR #43348:
URL: https://github.com/apache/superset/pull/43348#issuecomment-5349732610

   <!-- Bito Reply -->
   The flagged issue is correct. The current implementation in the PR already 
addresses this by forcing all chart holders to render before the readiness 
check and using a non-viewport-scoped readiness predicate for non-tiled 
reports. 
   
   Specifically, in `superset/utils/webdriver.py`, the `_wait_for_charts_ready` 
function now calls `page.evaluate(FORCE_ALL_CHART_HOLDERS_IN_VIEW_JS)` and uses 
`REPORT_ALL_CHART_HOLDERS_READY_JS` for report execution contexts, ensuring all 
mounted holders are terminally rendered before the screenshot is taken. The PR 
also includes regression tests in `tests/unit_tests/utils/webdriver_test.py` 
that verify this behavior.
   
   **superset/utils/webdriver.py**
   ```
   elif report_execution_context:
               # This non-tiled path captures the whole element in one shot
               # (`_get_screenshot` uses `full_page=True` / 
`element.screenshot()`),
               # so below-the-fold holders end up in the image. Force every
               # virtualized row to render up front -- mirroring the client-side
               # "Download as Image/PDF" path -- and then require *all* mounted
               # holders (not just the viewport-visible ones) to reach a 
terminal
               # state. If an off-screen holder never renders, the wait times 
out
               # and the report fails loudly instead of silently delivering a
               # blank/partial screenshot as a Success. The tiled path keeps the
               # viewport-scoped predicate because it scrolls each region into 
view
               # before capturing it.
               page.evaluate(FORCE_ALL_CHART_HOLDERS_IN_VIEW_JS)
               readiness_predicate = REPORT_ALL_CHART_HOLDERS_READY_JS
   ```


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