fix(web): agent page resizes now scale to fit the browser panel - #205
Merged
Conversation
When an agent called browser_resize, the new size reached the page but not the tab. The frame kept filling the panel while the page rendered at the wider viewport, so it came out cropped. The result also reported the panel's size instead of the page's, so the agent read its resize as having done nothing and resized again. An agent resize is now recorded on the tab the same way a drag on the frame's edges is: the panel scales the page down to fit, keeps its aspect ratio, shows the size in the device toolbar, and leaves the chat split alone. The status reports the page's CSS viewport, the activity line says "Agent resized 1280x800", and the tool description tells the agent the panel scales rather than crops.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
When an agent called
browser_resize, the new size reached the page but not the tab. The frame kept filling the panel while the page rendered at the wider viewport, so it came out cropped. The result also reported the panel's size instead of the page's, so the agent read its resize as having done nothing and resized again.An agent resize is now recorded on the tab the same way a drag on the frame's edges is: the panel scales the page down to fit, keeps its aspect ratio, shows the size in the device toolbar, and leaves the chat split alone. The status reports the page's CSS viewport, the activity line says "Agent resized 1280×800", and the tool description tells the agent the panel scales rather than crops.
Covered by a new unit test in
previewAutomationHost.test.ts. Not yet tried live in the desktop app; to check, ask an agent to resize the page to 1280 by 800 and confirm the page shrinks to fit rather than cropping.