Skip to content

fix(dash0): bug report screenshot shows the viewport, not the top of the page - #516

Merged
fclairamb merged 3 commits into
mainfrom
fix/bug-report-viewport-capture
Oct 11, 2026
Merged

fclairamb merged 3 commits into
mainfrom
fix/bug-report-viewport-capture

Conversation

@fclairamb

Copy link
Copy Markdown
Owner

On a scrolled page the bug report screenshot was a strip taken from the top of the page. On /checks scrolled by 500px it was 2048x536 instead of 2048x1536, with the bottom half of the sidebar. At the bottom of a page it fell back to the top of the page.

Cause: html-to-image sizes the capture from <html>'s client box, so it rendered the first viewport at scroll 0. cropToViewport then cut that image from scrollY down.

Fix (useFeedback.ts):

  • Capture exactly the viewport. The window scroll becomes a negative margin on the cloned root. Fixed and sticky elements stay where the user sees them.
  • Scrolled inner containers (sidebar menu, overflow-auto tables) are set to scroll 0 and their children are translated by the old offset during the capture, then restored. The page looks the same while this happens.
  • cropToViewport removed. The report context now includes scroll.

Tests: 4 new Playwright tests in bug-report.spec.ts (scrolled page with a scroll-0 control, bottom of the page, scrolled inner box with a control, mobile). They inject colored bands at known offsets and sample the preview image. All 4 fail on the previous code and pass with the fix. The 11 existing bug report tests and the dash0 unit tests (2484) pass.

Spec: specs/done/2026/10/2026-10-11-01-bug-report-screenshot-captures-top-of-page.md

🤖 Generated with Claude Code

fclairamb and others added 2 commits October 11, 2026 11:07
…the page

html-to-image sized the capture from <html>'s client box, so it rendered
the first viewport at scroll 0, and cropToViewport then cut a strip from
it at scrollY (or gave up and returned the top of the page). Capture
exactly the viewport and turn the window scroll into a negative margin on
the cloned root; fixed and sticky elements stay in place. Scrolled inner
containers are flattened for the capture and restored after.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@codecov

codecov Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.75%. Comparing base (81d982f) to head (4dbd628).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #516      +/-   ##
==========================================
- Coverage   82.76%   82.75%   -0.01%     
==========================================
  Files        1175     1175              
  Lines      121450   121450              
==========================================
- Hits       100513   100510       -3     
- Misses      20930    20933       +3     
  Partials        7        7              

see 9 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@fclairamb
fclairamb enabled auto-merge (squash) October 11, 2026 10:27
@fclairamb
fclairamb merged commit 114c547 into main Oct 11, 2026
26 checks passed
@fclairamb
fclairamb deleted the fix/bug-report-viewport-capture branch October 11, 2026 10:41
fclairamb added a commit that referenced this pull request Oct 11, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.38.2](v0.38.1...v0.38.2)
(2026-10-11)


### Bug Fixes

* **dash0:** bug report screenshot shows the viewport, not the top of
the page ([#516](#516))
([114c547](114c547))
* **dash0:** center the auth card on mobile
([#490](#490))
([ca250f6](ca250f6))
* **dash0:** name a tunneled check's bastion even when it is not on the
page ([#512](#512))
([d1bb246](d1bb246))
* **deps:** update github.com/dop251/goja digest to 73dc7ed
([#503](#503))
([d2f7bfa](d2f7bfa))
* **deps:** update github.com/dop251/goja digest to a4bedf5
([#499](#499))
([638a4bb](638a4bb))
* **deps:** update go dependencies (non-major)
([#517](#517))
([9f6cbbc](9f6cbbc))
* **security:** address open code scanning and Dependabot alerts
([#514](#514))
([84dc69d](84dc69d))
* **status-pages:** fast staged loading for public status pages
([#504](#504))
([a269baa](a269baa))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant