Skip to content

Conversation

@wojtekn
Copy link
Contributor

@wojtekn wojtekn commented Aug 14, 2025

Related issues

Proposed Changes

I propose to explicitly set the browser size to ensure the screenshot taken on a Mac always has the correct size. I was consistently getting different thumbnail sizes when connected to an external monitor (correct) and without a monitor (incorrect):

External monitor:

Window created with size: { x: 1200, y: 96, width: 1040, height: 1248 }
WebContents zoom factor: 1
WebContents zoom level: 0
Window size after forcing dimensions: { x: 1200, y: 96, width: 1040, height: 1248 }
Before capture - Window bounds: { x: 1200, y: 96, width: 1040, height: 1248 }
Before capture - Zoom factor: 1
Before capture - Zoom level: 0
Window size right before capture: { x: 1200, y: 96, width: 1040, height: 1248 }
Captured image size: { width: 1040, height: 1220 }

Macbook:

Window created with size: { x: 344, y: 38, width: 1040, height: 1009 }
WebContents zoom factor: 1
WebContents zoom level: 0
Window size after forcing dimensions: { x: 344, y: 38, width: 1040, height: 1248 }
Before capture - Window bounds: { x: 344, y: 38, width: 1040, height: 1248 }
Before capture - Zoom factor: 1
Before capture - Zoom level: 0
Window size right before capture: { x: 344, y: 38, width: 1040, height: 1248 }
Captured image size: { width: 2080, height: 2440 }
Before After
423931954-6c60dec5-5c7e-46e4-8b65-788f0a9cbe50 png_jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9 eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDIzMjkw 2VQt0Tb4-fOrKS4lVpB_hhJqnP0C1Mn8VwaEY5jbCqw 423931953-29c9cc38-367c-494c-8353-df0a5255e0f1 png_jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9 eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDIzMjkw CYZT5K2lapWZd0ONx6oa6O0UVw9sljpNgosBoZlGln4

Testing Instructions

  1. Start Studio
  2. Start site
  3. Confirm that thumbnail has correct size
  4. Stop site
  5. Connect external monitor
  6. Start site
  7. Confirm that the thumbnail has correct size

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

@wojtekn wojtekn requested a review from a team August 14, 2025 15:58
@wojtekn wojtekn self-assigned this Aug 14, 2025
Copy link
Contributor

@nightnei nightnei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't reproduce different sizes, maybe due to different dimensions between your and my external displays. But anyway bigger size of screenshot looks much better with default 900x600 window of Studio so definitelly makes sense to set it fixed 👍

BEFORE AFTER
Screenshot 2025-08-18 at 17 15 11 Screenshot 2025-08-18 at 17 11 32

@wojtekn
Copy link
Contributor Author

wojtekn commented Aug 18, 2025

Thanks for reviewing and testing @nightnei .

The bigger screenshot was the desired one - it was configured as a constant of 1040 x 1248, and the incorrect screenshot on Mac had proportions close to square.

@wojtekn wojtekn merged commit a9bc955 into trunk Aug 18, 2025
12 checks passed
@wojtekn wojtekn deleted the fix/varying-screenshot-heights-on-mac branch August 18, 2025 16:52
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.

3 participants