fix: update UI selectors and submission for current AI Studio#22
fix: update UI selectors and submission for current AI Studio#22mrowlinson wants to merge 2 commits intoMasuRii:mainfrom
Conversation
Google AI Studio updated its Angular UI, breaking the existing selectors and submission flow. This patch fixes three issues: 1. Submit button selector: Added 'button.ctrl-enter-submits' to match the current AI Studio submit button class. 2. Text input method: Replaced JavaScript element.value assignment with Playwright's native fill() method. The JS approach bypassed Angular's reactive forms change detection, leaving the internal model empty despite text being visually present. 3. Submission method: Replaced the submit button click + tooltip dismissal flow with Meta+Enter keyboard shortcut. The tooltip dismissal (_dismiss_tooltip_overlays) was hanging indefinitely on the current UI, and Meta+Enter is more reliable as it bypasses button state checks entirely. Tested on macOS with Camoufox v135.0.1-beta.24.
|
Have you tested this yourself? I've tested it myself using my windows os, havent tried linux but tried testing this pr and issue is that the browser automation fail to submit request. |
There was a problem hiding this comment.
Pull request overview
Updates the automation layer to match recent Google AI Studio UI changes that broke prompt submission by adjusting selectors and switching to Playwright-native input/keyboard submission.
Changes:
- Added a new submit-button CSS selector intended to match the current AI Studio submit button class.
- Replaced JS-based textarea value setting with Playwright
fill()inPageController.submit_prompt(). - Replaced click-based submission flow with a keyboard shortcut submission in
PageController.submit_prompt().
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
config/selectors.py |
Updates submit button selector(s) to match the latest AI Studio UI. |
browser_utils/page_controller.py |
Changes prompt entry + submission flow to use fill() and a keyboard shortcut instead of click-based submission. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
I've tried it on my Mac. I don't have a Windows PC to test it on. I did note that what I changed may only work on Mac and Control+Enter may need to be used for Windows/Linux. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@mrowlinson I did some changes to this, can you test it, if it would work for you |
|
I'm not going to be able to test it for probably a week. If it works for you I'd just commit it. |
You can try the dev branch, I committed the fix in there |
Summary
Google AI Studio updated its Angular UI, breaking the existing selectors and submission flow.
Changes
1. Submit button selector (
config/selectors.py)Added
button.ctrl-enter-submitstoSUBMIT_BUTTON_SELECTORto match the current AI Studio submit button class.2. Text input method (
browser_utils/page_controller.py)Replaced JavaScript
element.value = textwith Playwright's nativefill()method. The JS approach bypassed Angular's reactive forms change detection — text appeared visually but Angular's internal model remained empty, preventing submission.3. Submission method (
browser_utils/page_controller.py)Replaced the submit button click + tooltip dismissal flow with
Meta+Enterkeyboard shortcut. The_dismiss_tooltip_overlays()method was hanging indefinitely on the current UI, andMeta+Enteris more reliable.Testing
/v1/chat/completionsNote
The
Meta+Entershortcut is macOS-specific. Linux/Windows users would needControl+Enterinstead. Happy to add OS detection if needed.