Repository navigation
Make a window one value: tab, State and tab_options take a Window - #5274
Merged
Merged
Conversation
#5268 named every window once in `WINDOWS`, but `tab()` still took a size and a touch flag, so each caller split a `Window` back into its parts, and `State` and `tab_options` carried the same pair. Now `tab(browser, window, scheme)` takes a `Window`, a state names its own `window`, and `--viewport` gives one. The default 1440x900 window is the named entry `macbook` ("a 1440px by 900px MacBook screen"), since eval's `desktop` is 1280x800 and the render gate already calls its 1280x720 fixed window a laptop. `tab`, stills and probe open it unless told another, and `leaf-dev journey` and `bench-latency` read its size. The unnamed `DESKTOP` and `PHONE` constants are gone. `chosen_window` beside `tab_options` replaces the option wrapper and `State.window()`: `--viewport` replaces a state's window, and `--touch` or `--no-touch` sets the pointer of whichever window the tab opens in. One behavior changed: a size `--viewport` spells, such as 600x900, now has a mouse over a state that names a finger, as a named `--viewport` window already overrode the state's pointer. Pass `--touch` for a finger at that size. Every state keeps its size and pointer (all 249 compared with main), and stills of failed-widget, margin-gallery, breakout-captions-scrolled and plan-panel, by default, at `--viewport phone` and at `--viewport 600x900 --touch`, are pixel-identical to main's tooling. The eval's comment and decision journeys keep the first selected window's size under a mouse (`Run.journey_window`), as before: the scripted comment selects with mouse events, and a coarse pointer changes how the composer keeps a selection.
leaf-agent
approved these changes
Nov 4, 2026
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.
#5268 named every window once in
WINDOWS, buttab()still took a size and a touch flag, so each caller split aWindowback into its parts, andStateandtab_optionscarried the same pair. Now a window is one value:tab(browser, window, scheme)takes aWindow, a state names its ownwindow, and--viewportgives one.The default 1440×900 window is the named entry
macbook("a 1440px by 900px MacBook content viewport").desktopstays eval's 1280×800, andlaptopwould clash withmiddle("a 900px by 700px laptop window") and with the render gate, which calls its 1280×720 window "the fixed laptop window".tab, and stills and probe for a state that names no window, openmacbookunless told another;leaf-dev journeyandbench-latencyread its size. The unnamedDESKTOPandPHONEconstants are gone. Sinceeval --viewportoffers every named window,eval --viewport macbooknow works too.chosen_window, besidetab_options, replaces the option wrapper andState.window():--viewportreplaces a state's window, and--touchor--no-touchsets the pointer of whichever window the tab opens in.One behavior changed: a size
--viewportspells, such as600x900, now has a mouse even over a state that names a finger, as a named--viewportwindow already overrode a state's pointer. Pass--touchfor a finger at that size.The eval's scripted comment and the user agent's decision keep the first selected window's size under a mouse (
Run.journey_window), as before. The scripted comment selects with mouse events, and a coarse pointer changes how the composer keeps a selection.Checks
STATES, and the named windows' sizes, pointers and descriptions are unchanged.failed-widget(its own 1600×900),margin-gallery(phone, finger),breakout-captions-scrolled(phone size, mouse) andplan-panel, by default, at--viewport phoneand at--viewport 600x900 --touch: all 16base.png/head.pngcaptures are pixel-identical to main's tooling.leaf-dev probereports[390, 844, coarse]for--state margin-gallery,[390, 844, fine]for--viewport phone --no-touch, and[1440, 900, fine]by default.dev/tests/model/test_stills.pycovers each way a run chooses a window, and the eval tests near the changed code pass.