fix(tools): report new tabs after send keys#4768
Open
haosenwang1018 wants to merge 1 commit into
Open
Conversation
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
send_keysand reuse the existing new-tab detection after the key event finishes.send_keys(keys="Enter")the same new-tab feedback/auto-switch behavior that click actions already have.Fixes #4758 for the Enter-key path. The click path already uses this helper on current
main.Testing
uv run --with pytest --with pytest-asyncio python -m pytest tests/ci/test_send_keys_new_tab_detection.py -quv run --with ruff ruff check browser_use/tools/service.py tests/ci/test_send_keys_new_tab_detection.pyuv run --with ruff ruff format --check browser_use/tools/service.py tests/ci/test_send_keys_new_tab_detection.pySummary by cubic
Report and auto-switch to new tabs opened by
send_keys(e.g., Enter) to match click behavior. We capture tabs before the key event and reuse the existing new-tab detection.send_keysnow reports and switches to a new tab when Enter opens one, consistent with click actions.Written for commit 9a4cbf2. Summary will update on new commits. Review in cubic