garrytan / garrytan/gstack

browse: add `viewport auto` / `viewport reset` to unpin fixed viewport

Open
#1,059 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
133k
Forks
19.9k
Avg merge
18h 46m
Merged PRs (30d)
26

Description

## Problem

`browse viewport W×H` pins the viewport via Playwright's `setViewportSize`, overriding the launch-time `viewport: null` that normally lets the viewport follow the real Chrome window size. Once pinned, there is no way to restore auto-follow behaviour without `browse restart`, which kills the Chrome session (and drops a `/connect-chrome` headed attachment back to `launched` mode).

Several skills call `$B viewport` as a side-effect (e.g. responsive testing, benchmarks with specific breakpoints), leaving the browser in a locked state even after the skill finishes. From the user's perspective the Chrome window is visibly larger than the viewport Claude is rendering into.

## Repro

```bash
$B viewport 1280x520
$B js "window.innerWidth + 'x' + window.innerHeight" # 1280x520
# resize Chrome window manually → viewport stays 1280x520
```

## Proposal

A `browse viewport auto` (or `viewport reset` / `viewport unpin`) command that clears the pinned size and restores window-following behaviour, without tearing down the Chrome session.

In Playwright terms this means calling something like `page.setViewportSize(null)` where supported, or recreating the page/context with `viewport: null`. If neither is possible without a restart, even documenting the constraint + exposing a lightweight "soft restart that preserves the current tab/URL" would help.

## Environment

- Platform: Windows 11
- Mode: both `headed` (via `/connect-chrome`) and `launched` reproduce

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.