Repository navigation
Studio: keep the overlay rail honest about what it reserves - #10372
Conversation
Two regressions in the bottom-right rail shipped to main and had to be undone by hand. Neither failed a test on the way in. #9849 dropped `jobKeys.length === 0` from the Downloads panel's early return, so a fresh install carried a download FAB on the corner with nothing behind it. Reverted by #10298. Nothing asserted the invariant at any level. #10117 copied the desktop updater's min-h floor onto the llama.cpp banner while making its changelog render only once opened, so the card reserved 204.2px and painted 147.3px and the stack sat 64.9px off the corner. Fixed by #10229. Both suites ran on it and both passed: the browser suite measured the outer slot, which is the element carrying the floor, and read the corner off the rail's own box, which is fixed bottom-0 and cannot move; the source suite was edited in the same commit to assert the floor was present and shrink-0 absent, pinning the bug as a contract. download-panel-not-permanent.test.ts matches the guard through the AST, so reformatting or a rename of jobKeys cannot quietly retire it. overlay-rail-floor-gating.test.ts enumerates the rail's children out of provider.tsx, follows each to its source, and applies one rule rather than a spelling: a floor may only be reserved when the thing it protects is on screen. Both gates in use satisfy it, the CSS :has() and a React predicate that also renders the panel; a floor in the `positioned` ternary satisfies neither. Restored to 5e774c2 it fails on all three banners, naming `positioned` as the condition it found. In the browser suite the dead-space probe now runs over every flowed card rather than the two named banners, and the corner is measured off the bottom-most painted surface instead of the rail's padding box. The Downloads overlay is checked absent with an exact card count, since a bare absence also holds when the selector has rotted. Both new files run inside the existing npm test step, on ubuntu and windows, and cost about a second between them. No workflow changes.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Every one of these let a broken input pass the very test that exists to catch it, reproduced before and after. The empty-list matcher compared an unordered pair, so `0 < jobKeys.length` (unmounts the panel exactly when there ARE jobs) and the always-true `0 <= jobKeys.length` both satisfied it. The accepted shapes are now spelled out with their operands in order. The floor scan only knew `min-h-[calc(`, so an ungated `min-h-52`, `min-h-[204px]` or `min-h-full` produced no literals and the component returned unchecked, taking the `grow` assertion with it. It now reads any `min-h-` token except `min-h-0`, which is the opposite of a floor. A `getText()` keeps its quotes, so the token boundary has to strip them or the start anchor never matches. An inline `minHeight` cannot be gated by a class and is rejected outright. The gate accepted a predicate that rendered any element at all. `changelogAvailable` renders the changelog toggle and is true while the panel is still closed, so a floor gated on it reserves the panel's height on every collapsed card, which is #10117 exactly. The predicate must now render the notes or changelog panel itself. The rail enumeration read only literal children of an anchored div, so a card reaching the Tauri rail through {children} was invisible. Nothing is missed today, since those three are also listed in the browser rail, but a desktop-only card would be, and a suite that under-covers silently is the failure this file exists to prevent. It now also collects every `positioned={false}` call site. The browser probe treated only `position: static` as in flow. `relative` and `sticky` still take part in normal layout, so a card that added `relative` to anchor a control would drop out of the per-card dead-space check and out of the download card count. Only `absolute` and `fixed` are out of flow; all three call sites in that file now say so.
Round two of the same failure mode: each matcher accepted an input that does not hold the property it claims to check. Every case below was reproduced by mutating the source and running the test. The empty-list guard was found by recursing for a comparison anywhere inside the condition, which answers a different question and answers it wrongly in both directions: `jobKeys.length === 0 && activeCount > 0` unmounts for only some empty states, `!(jobKeys.length === 0)` for none, and both passed. The condition is now evaluated three-valued with the empty test pinned true and every other term unknown, so only a guard that an empty list forces true counts. The `:has()` gate accepted any slot name, so `has-[[data-slot=card-footer]]:min-h-52` passed while an always-present footer made the floor permanent. The React gate matched the tag name against /Notes|Changelog/, which would accept a future `<ChangelogToggle>` for the same reason `changelogAvailable` was rejected last round. Both now resolve against the components that actually render the shared notes layout root, and the slots those components declare, read out of the tree rather than matched by name. The `grow` check searched the whole file, so an alternate branch carrying one answered for a surface that did not. It now walks from each floor to its own JSX element and reads that element's painted child. The desktop card is the exposed one, since the browser suite never renders its rail.
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
Two regressions in the bottom-right overlay rail shipped to
mainand had to be undone by hand. Neither failed a test on the way in. This adds the coverage that would have caught both, at a cost of about a second inside the existingnpm teststep.jobKeys.length === 0from the Downloads panel's early return, so a fresh install carried a download FAB on the corner with nothing behind it. Reverted by Revert "Studio: keep a Downloads entry when the list is empty" #10298.min-hfloor onto the llama.cpp banner while making its changelog render only once opened, so the card reserved 204.2px and painted 147.3px and the stack sat 64.9px off the corner. Fixed by Studio: stop the update banners floating off the corner #10229.Why CI did not catch the second one
Both suites ran on #10117 and both passed. Three separate reasons, none of them a missing workflow:
playwright_update_banner_layout.pyonly routed/api/studio/release-noteswith a previewable body, and only measured the llama changelog opened. Thereturn nullbranch inrelease-notes-panel.tsx, live since Show release notes in the update popup, sourced from CHANGELOG.md #7432, was never rendered in a browser.MEASUREselects[data-testid="llama-update-banner"], which is the element carrying themin-h. A card reserving 204px and painting 147px at the top of it satisfies "inside the viewport", "does not overlap" and "height > 1".RAIL_CORNER.fromBottomis read off the rail's padding box, which isfixed bottom-0and so reports the intended 16 however much dead air sits inside the last card.assert.doesNotMatch(llamaRoot, /\bshrink-0\b/), which turned the bug into a pinned contract. A test that compares one card's class string against another's will agree that two cards are consistent while both are wrong.#10229 closed the first two for the two update banners specifically. It did not generalise either.
Changes
studio/frontend/tests/download-panel-not-permanent.test.ts, new. Matches the guard through the AST and finds thejobKeysbinding by its initializer rather than by name, so reformatting, a rename, or an extra clause in the condition cannot quietly retire it. Also pinsmin-h-0on the rail-facing branch and the panel's position above the loaded models card, which is the one overlay meant to hold the corner.studio/frontend/tests/overlay-rail-floor-gating.test.ts, new. Enumerates the rail's children out ofprovider.tsx, follows each to its source through the barrels, and applies one rule rather than a spelling:Both gates in use satisfy it:
has-[[data-slot=update-release-notes]]:for the web and desktop cards, and a React predicate for the llama card provided that predicate also renders the panel. Only thewhenTruebranch counts, since a floor on the other side of a ternary applies when its predicate is false, which is the opposite of a gate and is the shape #8367 shipped. A floor sitting in thepositionedternary with no other gate, which is what #10117 shipped, satisfies neither. The file refuses to run vacuously: if the rail anchor changes it fails saying so rather than finding zero cards.tests/studio/playwright_update_banner_layout.py. The dead-space probe now runs over every flowed card in the rail instead of the two named banners, reporting the offending card's testid and class so a failure names it. The corner is measured off the bottom-most painted surface rather than the rail's padding box. A new pass asserts the Downloads overlay is absent while nothing is downloading, by exact card count rather than by absence, since a bare absence also holds when the selector has rotted.studio/frontend/src/app/provider.tsx.data-testid="overlay-rail"on both rails. The probe reached the rail through whichever banner happened to be up, which finds nothing when none is, and that is exactly the state the download panel has to be judged in.Verification
Both new tests were checked against the commits that shipped the bugs, since a regression test that does not fail there is not one:
download-panel-not-permanent.test.tsfail with its intended message. Reverting makes it pass.5e774c260(Studio: show what changed in llama.cpp updates #10117),overlay-rail-floor-gating.test.tsfails on all three banners and namespositionedas the ternary condition it found, which is the diagnosis. Ata860357c5(Studio: stop the update banners printing over their own buttons #8367) it fails on the anti-vacuity guard instead, because the rail carried a different anchor then.Other checks:
npm run typecheck: passed.provider.tsxcarries 3 pre-existinguseExhaustiveDependencieserrors onmain, unchanged here.tests/studio/test_overlay_layering.py,test_update_release_notes.py,test_banner_update_delay_override.py,test_windows_ui_lanes_are_isolated.py: 207 passed.The Playwright changes themselves have not been run: that lane needs a booted Studio behind
BASE_URL. They get their first real run in thebannershard here.CI
No workflow changes. Both new files live under
studio/frontend/**, which is apull_requestpath filter ofstudio-frontend-ci.yml, andnpm testglobstests/**/*.test.tsin both the Ubuntu build job and the Windows unit job, so they gate every frontend PR twice. The Playwright edits andprovider.tsxare understudio/**andtests/studio/**, which trigger thebannershard ofstudio-ui-smoke.yml.