Skip to content

fix(example): use availWidth/availHeight for SetResolution clamping (follow-up to #1200)#1202

Open
vringar wants to merge 1 commit into
masterfrom
fix/set-resolution-availwidth
Open

fix(example): use availWidth/availHeight for SetResolution clamping (follow-up to #1200)#1202
vringar wants to merge 1 commit into
masterfrom
fix/set-resolution-availwidth

Conversation

@vringar

@vringar vringar commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #1200.

The SetResolution example 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_resolution now reads screen.availWidth/screen.availHeight (the usable area, excluding OS chrome like taskbars/docks) instead of screen.width/screen.height, and returns a tuple[int, int]. This makes the clamping warning in SetResolution reflect the window size the page can actually occupy. Docstring and warning wording updated to "available screen resolution" accordingly.

Copilot AI review requested due to automatic review settings June 20, 2026 09:53

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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_resolution from screen.width/height to screen.availWidth/availHeight to reflect available (usable) screen space.
  • Change return type from list[int] to tuple[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.

Comment thread custom_command.py Outdated
Comment thread custom_command.py Outdated
@codecov

codecov Bot commented Jun 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 62.12%. Comparing base (e438983) to head (f24a79b).

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.
📢 Have feedback on the report? Share it here.

🚀 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.

vringar added a commit that referenced this pull request Jun 21, 2026
@vringar vringar force-pushed the fix/set-resolution-availwidth branch from 676353e to f24a79b Compare June 21, 2026 03:21
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.

2 participants