fix(example): use availWidth/availHeight for SetResolution clamping (follow-up to #1200)#1202
Open
vringar wants to merge 1 commit into
Open
fix(example): use availWidth/availHeight for SetResolution clamping (follow-up to #1200)#1202vringar wants to merge 1 commit into
vringar wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the SetResolution custom-command example to clamp and warn based on the usable screen area reported to the page, improving the accuracy of the “may be clamped” warning in realistic desktop environments.
Changes:
- Switch
get_screen_resolutionfromscreen.width/heighttoscreen.availWidth/availHeightto reflect available (usable) screen space. - Change return type from
list[int]totuple[int, int]and update docstring/warning wording to “available screen resolution”.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1202 +/- ##
=======================================
Coverage 62.12% 62.12%
=======================================
Files 40 40
Lines 3918 3918
=======================================
Hits 2434 2434
Misses 1484 1484 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
vringar
added a commit
that referenced
this pull request
Jun 21, 2026
676353e to
f24a79b
Compare
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.
Follow-up to #1200.
The
SetResolutionexample landed without Copilot's suggested correctness fix because the merge queue drained before it was pushed. This applies it as a small follow-up.get_screen_resolutionnow readsscreen.availWidth/screen.availHeight(the usable area, excluding OS chrome like taskbars/docks) instead ofscreen.width/screen.height, and returns atuple[int, int]. This makes the clamping warning inSetResolutionreflect the window size the page can actually occupy. Docstring and warning wording updated to "available screen resolution" accordingly.