Skip to content

fix(editor): clamp viewport/area snapshot captures to 2048px long edge - #639

Merged
wass08 merged 1 commit into
mainfrom
fix/snapshot-viewport-clamp
Aug 12, 2026
Merged

fix(editor): clamp viewport/area snapshot captures to 2048px long edge#639
wass08 merged 1 commit into
mainfrom
fix/snapshot-viewport-clamp

Conversation

@wass08

@wass08 wass08 commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Problem

Viewport and area snapshot crop modes capture at the raw canvas backing-store resolution. On retina/5K Macs that is easily 3500–5000px wide, producing multi-MB WebP files that blow past upload transport limits (and silently fail to save in production).

Fix

  • SNAPSHOT_MAX_EDGE = 2048 exported from the viewer snapshot pipeline; viewport and area captures scale down proportionally (high-quality smoothing) when the source exceeds it. Standard presets (≤1920 long edge) are untouched.
  • Same clamp applied to the non-pipeline fallback paths in ThumbnailGenerator.
  • The capture HUD resolution chip now shows the actual clamped output size.

Verification

  • packages/viewer bun run build and packages/editor check-types pass.
  • Companion private-editor PR bumps the submodule and was smoke-verified on the dev server.

🤖 Generated with Claude Code


Note

Low Risk
Bounded output-size clamp on snapshot encoding only; standard presets are untouched and behavior is otherwise unchanged.

Overview
Caps viewport and area snapshot outputs at a 2048px long edge so retina/high-DPR captures no longer produce multi-MB WebPs that fail upload limits.

Adds SNAPSHOT_MAX_EDGE in the viewer snapshot pipeline and proportionally downscales oversized captures (with high-quality smoothing) in both the pipeline and the ThumbnailGenerator fallback. Standard presets stay unchanged. The capture HUD now shows the clamped resolution.

Reviewed by Cursor Bugbot for commit b9a4642. Bugbot is set up for automated code reviews on this repo. Configure here.

Viewport and area crop modes captured at the raw canvas backing-store
resolution, so retina/5K displays produced multi-MB WebP snapshots that
blow past upload transport limits. Clamp the output long edge to 2048
(matching the 1920-class standard presets) in the snapshot pipeline, the
non-pipeline fallback, and the capture HUD resolution chip.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@wass08
wass08 merged commit ee0186e into main Aug 12, 2026
3 checks passed
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