Simplify browser sizing to pane sync and fixed presets - #833
Conversation
Deploying mouseterm with
|
| Latest commit: |
ec30d3d
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://d625b2ec.mouseterm.pages.dev |
| Branch Preview URL: | https://simplify-browser-viewport-co.mouseterm.pages.dev |
dormouse-bot
left a comment
There was a problem hiding this comment.
With the Emulate dropdown gone, nothing sends the host's device op anymore. The modal was its only caller: ScreenActions.applyDevice (and its impl in agent-browser-surface-controller.ts) → BrowserHandle.device → { op: 'device' } in lib/src/lib/platform/browser-automation.ts → the case 'device' branches in browser-host.ts, agent-browser-host.ts and playwright-host.ts. dor agent-browser set device / dor playwright call the provider directly and don't go through this op. So "Device emulation remains available through the CLI" is true, but the webview path is left in place, along with its tests and the spec rules that describe it: the device row in the Browser Host op table, "serializes all viewport and device writes", "A Fixed viewport or device ends the browser's sync", and the Playwright "A device adds only its touch and user agent over the host's CDP session". A later reader will take all of this for a live path. Either remove the chain and those spec lines in this PR, or mark them Reserved: if you plan to bring a GUI entry point back. DimInput's disabled prop is now dead too; it only existed for device mode.
…xt actions
The port row now uses BrowserDisplayIcon at the panel's 15px icon size and
the Display vocabulary ("iframe embed"), with a divider after the port and a
link-styled "more…" trigger over the native overflow select. The Title, Dir,
and Ports rows write their action text in lowercase to match `iframe` and
`agent-browser`; tooltips and accessible names keep sentence case.
Simplified along the way: one ActionFace for the copy and opening overlays,
one ACTION_BOX_CLASS shared with the overflow measurements, the provider
switch and chosen-provider state shared with the Display modal through
BrowserProviderSwitch, labels taken from BROWSER_DISPLAY_LABEL, and the
dead `fit` prop removed.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
dormouse-bot
left a comment
There was a problem hiding this comment.
The "more…" dropdown in the port row runs its action from the <select>'s onChange (PortLaunchActions in lib/src/components/wall/TerminalContextView.tsx). In Chromium on Windows and Linux, which covers WebView2 and the VS Code webview, pressing ↑/↓ on a focused, closed select changes its value and fires change without opening the list. A keyboard user who tabs to "more…" and presses ↓ to see the options therefore launches the first overflowed target: a Pane opens and the context dismisses. The value resets to "", so each further arrow press does it again. Mouse users and macOS, where the arrow key opens the popup, are unaffected. The context is meant to be keyboard-driven ("Must focus context controls on opening" in docs/specs/layout.md), so this needs a fix. Two options: act only on Enter or on mouse selection from the open list, or replace the select with a button-triggered menu.
…trigger In Chromium on Windows and Linux, arrow keys and type-ahead change a closed select's value and fire `change`, so a keyboard user tabbing to "more…" and pressing ↓ launched the first overflowed target. Keys that would change the closed select now do nothing, and ↑/↓ open the list with `showPicker()`. WebKit counted the transparent select's option text as overflow past the trigger, failing the narrow stories' fit checks; the trigger now clips it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The Display modal's Emulate dropdown was the only caller of
`ScreenActions.applyDevice` → `BrowserHandle.device` → `{ op: 'device' }`
and the device branches in the browser, agent-browser, and Playwright
hosts. Device emulation stays with the CLI (`dor agent-browser set device`,
`dor playwright`), which calls the provider directly. The spec rules that
described the webview path go with it, as does `DimInput`'s `disabled`
prop, which only device mode used.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
On the "more…" dropdown keyboard finding (review on 117648d): fixed in ab286c3, taking the first option. A launch now happens only on a choice from the open list.
The same commit fixes the WebKit play failures in the narrow TerminalContext stories. WebKit counted the transparent select's option text as overflow past the "more…" trigger, and the trigger now clips it. The TerminalContext, AgentBrowserScreenModal and BrowserChromeHeader stories pass in both Chromium and WebKit locally. |
The directory's copy is now an unlabeled icon right after the path, like the Surface ref's, and confirms with the check alone. When the row runs out of room, "open in Finder" drops to its icon (and its busy state to the spinner), and only then does the path truncate, from its start, so its end stays visible. The port row's width measurement moves into a shared `useRowFit`, and the gallery's play check now holds the Dir row to one line alongside Ports. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
As the row narrows, "explain" drops to its icon, the title truncates to eight characters, the Surface ref drops to its copy icon (its tooltip and accessible name, now "Copy surface:N", keep the ref), and only then does the title truncate further. The row shares `useRowFit` with Dir and Ports, and the gallery's play check holds it to one line with them. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
dormouse-bot
left a comment
There was a problem hiding this comment.
The Title row's fit can go stale when the helper-placement buttons change. Details inline.
Superseded by the review on a later commit.
The fit reads the header actions' width, but only the row and its measurer were observed, so a placement side coming or going without the context resizing left the ladder stale. `useRowFit` now also observes elements whose width a fit reads, and the Title row passes its actions. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The Display dialog now offers two screencast sizing modes: Resize with pane and Fixed size. Fixed size contains a preset selector (including Custom) and editable width, height, and DPR. Selecting a preset fills the fields; editing them switches to Custom without silently pinning an omitted DPR.
Remove the Emulate dropdown and its GUI-only device lists. Device emulation remains available through the CLI.
Follow-up to #830, which has merged. Validation: full
pnpm testpassed; checked Phone preset selection and custom dimension editing in Storybook throughdor agent-browser.Also in this PR:
iframeandagent-browser. Tooltips and accessible names keep sentence case.surface:Ndrops to its copy icon, then the title truncates further.deviceop is removed. The Emulate dropdown was its only caller. Device emulation stays in the CLI.Validation for these:
libpnpm test(4141 passed), the spec and public-docs lints, and the TerminalContext and AgentBrowserScreenModal Storybook play checks in Chromium. Checked the port row in Storybook throughdor agent-browser.