Skip to content

fix: update UI selectors and submission for current AI Studio#22

Open
mrowlinson wants to merge 2 commits intoMasuRii:mainfrom
mrowlinson:fix/aistudio-ui-selectors-and-submission
Open

fix: update UI selectors and submission for current AI Studio#22
mrowlinson wants to merge 2 commits intoMasuRii:mainfrom
mrowlinson:fix/aistudio-ui-selectors-and-submission

Conversation

@mrowlinson
Copy link

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-submits to SUBMIT_BUTTON_SELECTOR to match the current AI Studio submit button class.

2. Text input method (browser_utils/page_controller.py)

Replaced JavaScript element.value = text with Playwright's native fill() 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+Enter keyboard shortcut. The _dismiss_tooltip_overlays() method was hanging indefinitely on the current UI, and Meta+Enter is more reliable.

Testing

  • macOS (Apple Silicon)
  • Camoufox v135.0.1-beta.24
  • Python 3.12
  • Successfully sends prompts and receives responses via /v1/chat/completions

Note

The Meta+Enter shortcut is macOS-specific. Linux/Windows users would need Control+Enter instead. Happy to add OS detection if needed.

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.
@MasuRii
Copy link
Owner

MasuRii commented Feb 25, 2026

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.

@MasuRii MasuRii requested a review from Copilot February 25, 2026 15:48
@MasuRii MasuRii self-assigned this Feb 25, 2026
@MasuRii MasuRii added the bug Something isn't working label Feb 25, 2026
Copy link

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

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() in PageController.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.

@mrowlinson
Copy link
Author

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.

Copy link

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

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.

@MasuRii
Copy link
Owner

MasuRii commented Feb 25, 2026

@mrowlinson I did some changes to this, can you test it, if it would work for you

@mrowlinson
Copy link
Author

I'm not going to be able to test it for probably a week. If it works for you I'd just commit it.

@MasuRii
Copy link
Owner

MasuRii commented Feb 26, 2026

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants