feat: group multi-browser output by source
Testing / remote-protocol-compat (0.9.3) (push) Successful in 52s
Testing / test (push) Successful in 1m2s
Testing / remote-protocol-compat (0.9.5) (push) Successful in 1m0s
Package Extension / package-extension (push) Successful in 1m11s
Build & Publish Package / publish (push) Successful in 1m7s
Testing / remote-protocol-compat (0.9.3) (push) Successful in 52s
Testing / test (push) Successful in 1m2s
Testing / remote-protocol-compat (0.9.5) (push) Successful in 1m0s
Package Extension / package-extension (push) Successful in 1m11s
Build & Publish Package / publish (push) Successful in 1m7s
- Add browser source grouping metadata to SDK-created tabs, groups, list results, and aggregate count results. - Render grouped local/remote browser tables consistently for clients, tabs, groups, windows, sessions, and remote status output. - Document remote control, auth, HTTP gateway usage, and the refreshed project structure in the README. - Add coverage for grouped output and BrowserCounts browser_groups. - Bump the Python package, extension manifest, and lockfile to 0.15.6. - Add a just publish helper for building and publishing release artifacts.
This commit is contained in:
@@ -1,21 +1,18 @@
|
||||
import click
|
||||
from browser_cli.commands import client_from_ctx, handle_errors
|
||||
from browser_cli.commands.rendering import build_windows_tree, print_table_rows, print_tree
|
||||
from browser_cli.commands.rendering import build_windows_tree, print_browser_grouped_table_rows, print_tree
|
||||
from rich.console import Console
|
||||
|
||||
console = Console()
|
||||
|
||||
def _print_windows(windows: list[dict], *, show_browser: bool = False) -> None:
|
||||
columns = []
|
||||
if show_browser:
|
||||
columns.append(("Browser", lambda window: window.get("browser", "")))
|
||||
columns.extend([
|
||||
columns = [
|
||||
("ID", lambda window: window.get("id", "")),
|
||||
("Alias", lambda window: window.get("alias") or ""),
|
||||
("Tabs", lambda window: window.get("tabCount", "")),
|
||||
("State", lambda window: window.get("state") or ""),
|
||||
])
|
||||
print_table_rows(windows, columns, console=console, empty_message="[yellow]No windows found[/yellow]")
|
||||
]
|
||||
print_browser_grouped_table_rows(windows, columns, console=console, empty_message="[yellow]No windows found[/yellow]")
|
||||
|
||||
@click.group("windows")
|
||||
def windows_group():
|
||||
|
||||
Reference in New Issue
Block a user