fix: prevent browser target and focus surprises
- Respect the globally selected browser when renaming client aliases. - Pass the resolved local profile into sync and async local transports so BROWSER_CLI_PROFILE is honored consistently. - Stop tabs.active from explicitly focusing the OS browser window, avoiding virtual-desktop jumps during tab activation. - Make window merging skip audible, unmuted windows so video playback windows are not selected as merge targets. - Bump the Python package and extension manifest versions to 0.12.2. - Add regression coverage for browser selection and focus-stealing behavior.
This commit is contained in:
+11
-1
@@ -49,7 +49,7 @@ def test_clients_rename_uses_global_browser_target_when_set():
|
||||
result = CliRunner().invoke(main, ["--browser", "old-id", "clients", "rename", "work"])
|
||||
|
||||
assert result.exit_code == 0
|
||||
send_command.assert_called_once_with("clients.rename_profile", {"alias": "work"}, profile=None)
|
||||
send_command.assert_called_once_with("clients.rename_profile", {"alias": "work"}, profile="old-id")
|
||||
assert "Restart the browser" not in result.output
|
||||
|
||||
def test_clients_rename_rejects_duplicate_alias(tmp_path):
|
||||
@@ -63,6 +63,16 @@ def test_clients_rename_rejects_duplicate_alias(tmp_path):
|
||||
assert "Browser alias 'work' already exists" in result.output
|
||||
send_command.assert_not_called()
|
||||
|
||||
def test_clients_rename_duplicate_check_uses_global_browser_target(tmp_path):
|
||||
registry_path = tmp_path / "registry.json"
|
||||
registry_path.write_text('{"work": "/tmp/work.sock"}', encoding="utf-8")
|
||||
|
||||
with patch("browser_cli.commands.clients.REGISTRY_PATH", registry_path), patch("browser_cli.commands.clients.send_command") as send_command:
|
||||
result = CliRunner().invoke(main, ["--browser", "work", "clients", "rename", "work"])
|
||||
|
||||
assert result.exit_code == 0
|
||||
send_command.assert_called_once_with("clients.rename_profile", {"alias": "work"}, profile="work")
|
||||
|
||||
def test_clients_rename_allows_same_alias_for_same_target(tmp_path):
|
||||
registry_path = tmp_path / "registry.json"
|
||||
registry_path.write_text('{"work": "/tmp/work.sock"}', encoding="utf-8")
|
||||
|
||||
Reference in New Issue
Block a user