Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: browser_resize #92

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

feat: browser_resize #92

wants to merge 3 commits into from

Conversation

Skn0tt
Copy link
Member

@Skn0tt Skn0tt commented Mar 31, 2025

Closes #5

@Skn0tt Skn0tt requested review from pavelfeldman and Copilot March 31, 2025 09:09
@Skn0tt Skn0tt self-assigned this Mar 31, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a new "browser_resize" tool to resize the browser window in both desktop and mobile formats, addressing issue #5.

  • Added a new test for "browser_resize" in tests/basic.spec.ts
  • Implemented the "browser_resize" tool logic in src/tools/common.ts
  • Integrated the new tool into the main tool arrays in src/index.ts

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
tests/basic.spec.ts Adds tests to validate the browser_resize functionality in both desktop and mobile formats.
src/tools/common.ts Implements the resize tool with input validation and processing logic.
src/index.ts Updates the tool arrays to include the browser_resize tool.

@@ -174,3 +174,28 @@ export const chooseFile: ToolFactory = snapshot => ({
}, snapshot);
},
});

const resizeSchema = z.object({
Copy link
Member

Choose a reason for hiding this comment

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

Let them specify pixels? We should be careful about exposing it as it is niche and unclear how it is going to be used. Original request wanted it for responsive design where 800 vs 1024 vs 1280 could result in different media query matches...

Copy link
Member Author

@Skn0tt Skn0tt Apr 2, 2025

Choose a reason for hiding this comment

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

done in 5699c17. was originally concerned that the LLM wouldn't use good values, but it worked well in some tests.

pavelfeldman
pavelfeldman previously approved these changes Mar 31, 2025
@pavelfeldman
Copy link
Member

Sorry you need a rebase

@Skn0tt
Copy link
Member Author

Skn0tt commented Apr 8, 2025

Done!

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.

Feature request: Add viewport size parameters to browser_navigate command
2 participants