rusackas opened a new pull request, #43979:
URL: https://github.com/apache/superset/pull/43979
### SUMMARY
Dashboard "Export to PDF"/PNG (and single-chart screenshot export) drives a
headless Playwright browser server-side. `page.screenshot(full_page=True)`
(#31158 / #35484) already expands the outer dashboard scroll so no chart is cut
off, but it has no effect on a chart's own *internal* scroll container — a
dense table taller than the space its dashboard tile gives it still renders
clipped to whatever's visible in that tile at capture time.
The client-side "Download as image" export already solves this (#34233) by,
before rasterizing: switching ag-Grid tables to their `"print"` `domLayout`
(which forces every row to render instead of virtualizing), and resetting
height/overflow on other scrollable table wrappers. The server-side PDF/PNG
path never got the same treatment, which is exactly what's reported in #38090
("Export to pdf ... downloads not the full table. Download as image does").
This PR ports that same DOM-expansion step into `WebDriverPlaywright`
(`superset/utils/webdriver.py` / `superset/utils/screenshot_utils.py`), applied
in-place to the live page right before the tiling decision / screenshot
capture, so both the tiled and non-tiled capture paths see the fully-expanded
content. It reuses the `_agGridApi` handle that `ThemedAgGridReact`
(`@superset-ui/core`) already stashes on the grid's host element for exactly
this purpose.
### TESTING INSTRUCTIONS
1. Enable `ALERT_REPORTS`, `ENABLE_DASHBOARD_SCREENSHOT_ENDPOINTS`,
`ENABLE_DASHBOARD_DOWNLOAD_WEBDRIVER_SCREENSHOT`.
2. Build a dashboard with a Table (or Pivot Table) chart containing more
rows than fit in its tile height.
3. Dashboard → Download → **Export to PDF** (or PNG).
4. Before this change: the export is clipped to whatever was scrolled into
view for that table at capture time. After: the full table content is included,
matching what "Download as image" already produces for the same chart.
Automated:
```bash
pytest tests/unit_tests/utils/webdriver_test.py
tests/unit_tests/utils/test_screenshot_utils.py
```
### ADDITIONAL INFORMATION
- [x] Has associated issue: Fixes #38090
- [ ] 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]