Skip to content

Conversation

seanmcguire12
Copy link
Member

@seanmcguire12 seanmcguire12 commented Jun 26, 2025

why

  • improved dropdown handling for OS level dropdowns

what changed

  • added native selectOptionFromDropdown function in actHandlerUtils.ts
  • updated prompting such that the LLM only chooses selectOptionFromDropdown in specific cases (when the dropdown is OS level)

test plan

  • act evals

fast follow PRs

  • add documentation explaining the various types of dropdowns, and how to prompt stagehand to handle each of them.

to do

  • better prompting
  • add a timeout for locator
  • add multiple evals

Copy link

changeset-bot bot commented Jun 26, 2025

🦋 Changeset detected

Latest commit: 8c064dd

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@seanmcguire12 seanmcguire12 force-pushed the sean/stg-520-improve-dropdown-support branch from 6498c3c to 2550c0f Compare July 1, 2025 01:31
@seanmcguire12 seanmcguire12 marked this pull request as ready for review July 3, 2025 22:30
@seanmcguire12 seanmcguire12 added act These changes pertain to the act function parity To note required feature parity in client SDKs labels Jul 3, 2025
@stagehand-parity-bot
Copy link

🔄 Feature Parity Issue Created

An issue has been automatically created in the Python SDK repository to track parity implementation:
browserbase/stagehand-python#135

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Introduces native OS-level dropdown support with a new selectOptionFromDropdown function, differentiating between native <select> elements and custom dropdowns for more reliable interactions.

  • Added native selectOptionFromDropdown function in lib/handlers/handlerUtils/actHandlerUtils.ts with 5-second timeout
  • Updated lib/prompt.ts to intelligently route dropdown interactions based on element type (select vs custom)
  • Added accessibility tree improvements in lib/a11y/utils.ts to properly identify native select elements
  • Introduced three comprehensive eval tests: os_dropdown.ts, custom_dropdown.ts, and hidden_input_dropdown.ts to validate different dropdown scenarios

8 files reviewed, 5 comments
Edit PR Review Bot Settings | Greptile

@seanmcguire12 seanmcguire12 changed the title [WIP] add native selectOptionFromDropdown add native selectOptionFromDropdown Jul 3, 2025
@miguelg719 miguelg719 removed the act These changes pertain to the act function label Jul 3, 2025
@seanmcguire12 seanmcguire12 merged commit 8bcb5d7 into main Jul 4, 2025
16 of 27 checks passed
@github-actions github-actions bot mentioned this pull request Jul 4, 2025
seanmcguire12 pushed a commit that referenced this pull request Jul 4, 2025
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @browserbasehq/[email protected]

### Patch Changes

- [#856](#856)
[`8a43c5a`](8a43c5a)
Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - set
download behaviour by default

- [#857](#857)
[`890ffcc`](890ffcc)
Thanks [@miguelg719](https://github.com/miguelg719)! - return
"not-supported" for elements inside the shadow-dom

- [#844](#844)
[`64c1072`](64c1072)
Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - don't
automatically close tabs

- [#860](#860)
[`b077d3f`](b077d3f)
Thanks [@miguelg719](https://github.com/miguelg719)! - Set default
schema on extract options with no schema

- [#842](#842)
[`8bcb5d7`](8bcb5d7)
Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - improved
handling for OS level dropdowns

- [#846](#846)
[`7bf10c5`](7bf10c5)
Thanks [@miguelg719](https://github.com/miguelg719)! - Filter attaching
to target worker / shared_worker

## @browserbasehq/[email protected]

### Patch Changes

- Updated dependencies
\[[`8a43c5a`](8a43c5a),
[`890ffcc`](890ffcc),
[`64c1072`](64c1072),
[`b077d3f`](b077d3f),
[`8bcb5d7`](8bcb5d7),
[`7bf10c5`](7bf10c5)]:
    -   @browserbasehq/[email protected]

## @browserbasehq/[email protected]

### Patch Changes

- Updated dependencies
\[[`8a43c5a`](8a43c5a),
[`890ffcc`](890ffcc),
[`64c1072`](64c1072),
[`b077d3f`](b077d3f),
[`8bcb5d7`](8bcb5d7),
[`7bf10c5`](7bf10c5)]:
    -   @browserbasehq/[email protected]

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
parity To note required feature parity in client SDKs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants