Skip to content

Studio: keep the overlay rail honest about what it reserves - #10372

Merged
danielhanchen merged 5 commits into
mainfrom
overlay-rail-regression-tests
Sep 6, 2026
Merged

danielhanchen merged 5 commits into
mainfrom
overlay-rail-regression-tests

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Summary

Two regressions in the bottom-right overlay rail shipped to main and 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 existing npm test step.

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:

  1. No fixture ever produced the empty-notes state. playwright_update_banner_layout.py only routed /api/studio/release-notes with a previewable body, and only measured the llama changelog opened. The return null branch in release-notes-panel.tsx, live since Show release notes in the update popup, sourced from CHANGELOG.md #7432, was never rendered in a browser.
  2. Every geometric check read the outer slot. MEASURE selects [data-testid="llama-update-banner"], which is the element carrying the min-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.fromBottom is read off the rail's padding box, which is fixed bottom-0 and so reports the intended 16 however much dead air sits inside the last card.
  3. The source suite was edited in the same commit as the regression. Studio: show what changed in llama.cpp updates #10117 added 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 the jobKeys binding by its initializer rather than by name, so reformatting, a rename, or an extra clause in the condition cannot quietly retire it. Also pins min-h-0 on 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 of provider.tsx, follows each to its source through the barrels, 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: 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 the whenTrue branch 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 the positioned ternary 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:

Other checks:

  • Full frontend suite: 6889 passed, 0 failed, 28.4s. The two new files add 9 tests and about a second between them.
  • npm run typecheck: passed.
  • Biome and ruff clean on the changed files. provider.tsx carries 3 pre-existing useExhaustiveDependencies errors on main, 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 the banner shard here.

CI

No workflow changes. Both new files live under studio/frontend/**, which is a pull_request path filter of studio-frontend-ci.yml, and npm test globs tests/**/*.test.ts in both the Ubuntu build job and the Windows unit job, so they gate every frontend PR twice. The Playwright edits and provider.tsx are under studio/** and tests/studio/**, which trigger the banner shard of studio-ui-smoke.yml.

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.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 6, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-06T08:25:39.850620Z 4f178af Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

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.
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 6, 2026
chatgpt-codex-connector[bot]

This comment was marked as resolved.

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 6, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 6, 2026
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.
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 6, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 6, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 6, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 6, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 6, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 6, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 6, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 6, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 6, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 6, 2026
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: cd51eaf30a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 6, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 6, 2026
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 4f178af077

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 6, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 6, 2026
@danielhanchen
danielhanchen merged commit 7ba00bb into main Sep 6, 2026
41 checks passed
@danielhanchen
danielhanchen deleted the overlay-rail-regression-tests branch September 6, 2026 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant