fix(review): bound mobile visual-capture thumbnails and give up on a missing preview build - #7410
Merged
JSONbored merged 1 commit intoJul 20, 2026
Conversation
…missing preview build Mobile screenshots rendered at full-page native size in PR comments because the display-thumbnail downscale only bounded width, and thumbnail generation was gated to desktop only. Also, when no preview-build check-run is ever found for a repo (no Workers Builds CI), the "after" cell spun on the loading placeholder forever instead of eventually giving up honestly, since that state was never fed into the existing poll-budget mechanism. Closes #7405
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
JSONbored
deleted the
fix/visual-capture-mobile-thumb-and-preview-loading
branch
July 20, 2026 07:36
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7410 +/- ##
==========================================
- Coverage 91.21% 91.21% -0.01%
==========================================
Files 716 716
Lines 72789 72797 +8
Branches 20859 20863 +4
==========================================
+ Hits 66392 66399 +7
+ Misses 5355 5354 -1
- Partials 1042 1044 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
native (unbounded height) size instead of a bounded thumbnail.
capturePage's display-thumbnailgeneration was gated to
viewportName === "desktop"only, on the assumption that a 390px-widemobile capture was already close enough to the table's display width to skip downscaling — true
for width, but
shot.tscapturesfullPage: true, so a mobile screenshot's HEIGHT is just asunbounded as desktop's.
downscaleForDisplayitself also only bounded width (nofit/height), soremoving the desktop-only gate alone would not have fixed a narrow-but-very-tall image. Fixed both:
the downscale now bounds width AND height (
fit: "inside", mirroringdownscaleForVision'sexisting pattern), and thumbnail generation + the
beforeThumbUrlMobile/afterThumbUrlMobilefields now apply to both viewports, threaded through to the comment table's mobile row.
signal at all (e.g. a frontend with no Workers Builds CI configured).
buildCaptureonly fed theexisting poll-budget give-up logic (
preview-poll-budget.ts) whengetPreviewBuildStatereturned"building"/"succeeded"; the"absent"state (no matching check-run found) was a silent no-op,so
previewPending/previewFailedboth stayedfalseforever and the "Rendering preview…" spinnernever re-evaluated to a terminal state on any later review pass. Fixed by feeding
"absent"intothe same poll-budget-then-give-up treatment as
"building", skipped whenactions_fallbackisconfigured (that feature already owns the "found nothing" case and needs the
previewPendinggatefree to dispatch).
Closes #7405
Scope
type(scope): short summaryConventional Commit format.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Closes #7405).Validation
git diff --checknpm run actionlint(vianpm run test:ci)npm run typechecknpm run test:coveragelocally, unsharded — 100% statements/lines/functions on both changedsource files (
src/review/visual/capture.ts,src/selfhost/stubs/image-downscale.ts), 100%lines on
src/review/unified-comment-bridge.ts(the one pre-existing branch/line gap on eachfile —
capture.ts:400,unified-comment-bridge.ts:81— predates this change and is outsidethe diff).
npm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderate— pre-existingadm-zip/github-actionlintadvisory (no fixavailable upstream), unrelated to this change and present on
mainbefore this PR.math, both-viewport thumbnail generation and its threading through the comment table, and the
"absent"build-state's poll-then-give-up path with and withoutactions_fallbackconfigured.Safety
private rankings, or private maintainer evidence are exposed.
optimization tactics.
no auth/session/CORS surface touched.
changed; this only affects the shape of the bot-generated PR comment table.
apps/loopover-uichanges.UI Evidencesection — N/A, see Notes below.UI Evidence
Not applicable — this is a backend-only fix to the bot's own visual-capture pipeline
(
src/review/**,src/selfhost/**), not a change toapps/loopover-ui. The rendered artifact thisPR fixes is the bot-generated PR comment table on OTHER repos' pull requests, which can't be
meaningfully screenshotted from a local dev server the way an
apps/loopover-uipage can — it'salready covered by the unit tests exercising the exact HTML the comment builder emits (see
test/unit/visual-collapsible.test.ts's new mobile-thumbnail assertions), and will be verifiedagainst a real live PR after the next beta cut/deploy, per this repo's established
build→cut-beta→deploy→verify cycle.
Notes
unresized mobile screenshots, and an "after" cell stuck on the loading placeholder). They're bundled
in one PR since they're the same investigation, touch overlapping code in
capture.ts, and werereported together.