Skip to content

fix(computer-use): scale scroll amounts #23

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

Merged
merged 3 commits into from
Jun 19, 2025

Conversation

matthewjmarangoni
Copy link
Contributor

This is an approach fixing the TypeScript Computer Use template application scrolling too little (fixes Issue #20).

This method determines the dimensions of the screen available to the browser page, partitioning it, and using that as a scaling factor for the step amounts provided by Claude. It is intended to handle screen resolution and window size changes without enforcing a restriction on the maximum scroll amount.

A drawback of unbounded scaling is it could result in extreme jumps if at some point Claude generates actual pixel values.

This PR does not cover the Python template. It appears to already use a constant scaling factor but could be adapted if this approach is accepted.

@juecd
Copy link
Contributor

juecd commented Jun 13, 2025

@matthewjmarangoni I like this approach! Would you mind updating the Python version with the same logic?

@matthewjmarangoni
Copy link
Contributor Author

Can do.

@matthewjmarangoni matthewjmarangoni changed the title fix(computer-use): scale scroll amounts in TypeScript fix(computer-use): scale scroll amounts Jun 14, 2025
@matthewjmarangoni
Copy link
Contributor Author

The Python template has been updated and both templates outputs changed to show pixels instead of percentages.

Ready for review @juecd!

@juecd juecd requested review from jaskirat05 and removed request for jaskirat05 June 16, 2025 18:28
@juecd
Copy link
Contributor

juecd commented Jun 16, 2025

@jaskirat05 will take a look here, thanks Jas!

Copy link
Contributor

@juecd juecd left a comment

Choose a reason for hiding this comment

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

This LGTM - we may need to tweak the scroll_factor as we test this more but this is a good starting point. Thanks!

@juecd juecd merged commit c6db199 into onkernel:main Jun 19, 2025
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