Skip to content

fix: js statement wrapping + click auto-routes option to selectOption (v0.4.5)#117

Merged
garrytan merged 2 commits intomainfrom
garrytan/browser-fix
Mar 17, 2026
Merged

fix: js statement wrapping + click auto-routes option to selectOption (v0.4.5)#117
garrytan merged 2 commits intomainfrom
garrytan/browser-fix

Conversation

@garrytan
Copy link
Owner

Summary

  • js command now handles statementsconst, semicolons, multi-line code with await all work correctly instead of throwing SyntaxError. Shared wrapForEvaluate() helper DRYs up js and eval.
  • Click on <option> refs auto-routes to selectOption() — no more 5-second hang when an agent clicks @e3 [option] "Admin". Checks both ARIA role and DOM tagName to avoid blocking custom listbox components.
  • Click failures on <option> elements give actionable error — "Use browse select instead of click for dropdown options."

Pre-Landing Review

No issues found.

Eval Results

No prompt-related files changed — evals skipped.

TODOS

No TODO items completed in this PR.

Test plan

  • All browse tests pass (173 tests, 0 failures)
  • All skill validation tests pass (157 tests, 0 failures)
  • 6 new tests: multi-line js, await+semicolons, await+keywords, simple expressions, option auto-routing, CSS option error guidance

🤖 Generated with Claude Code

garrytan and others added 2 commits March 16, 2026 19:23
Bug 1: js command wrapped all code as expressions — const, semicolons,
and multi-line code broke with SyntaxError. Added needsBlockWrapper()
and wrapForEvaluate() helpers (shared with eval) to detect statements
and use block wrapper {…} instead of expression wrapper (…).

Bug 2: clicking <option> refs hung forever because Playwright can't
.click() native select UI. Click handler now checks ARIA role + DOM
tagName and auto-routes to selectOption() via parent <select>.

Bug 3: click timeouts on <option> elements gave no guidance. Now
throws helpful error: "Use browse select instead of click."
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@garrytan garrytan merged commit 318ffdb into main Mar 17, 2026
lucaslim pushed a commit to lucaslim/gstack-governed that referenced this pull request Mar 17, 2026
… (v0.4.5) (garrytan#117)

* fix: js statement wrapping + click auto-routes option to selectOption

Bug 1: js command wrapped all code as expressions — const, semicolons,
and multi-line code broke with SyntaxError. Added needsBlockWrapper()
and wrapForEvaluate() helpers (shared with eval) to detect statements
and use block wrapper {…} instead of expression wrapper (…).

Bug 2: clicking <option> refs hung forever because Playwright can't
.click() native select UI. Click handler now checks ARIA role + DOM
tagName and auto-routes to selectOption() via parent <select>.

Bug 3: click timeouts on <option> elements gave no guidance. Now
throws helpful error: "Use browse select instead of click."

* chore: bump version and changelog (v0.4.5)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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.

1 participant