Skip to content

Count a capped overlay stack by what it reads, not by how the cap is spelled - #9253

Merged
danielhanchen merged 1 commit into
mainfrom
fix-overlay-cap-guard
Aug 19, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
fix-overlay-cap-guard

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Three tests in test_update_release_notes.py assert every bottom-right overlay stack caps itself, and counted the literal string maxHeight: stack.maxHeight in provider.tsx to do it.

#9246 keeps the cap but wraps it:

-        maxHeight: stack.maxHeight,
+        maxHeight: railMaxHeight(stack.maxHeight),

railMaxHeight(cardsRoom) returns cardsRoom + STACK_SHADOW_GUTTER — the same measured cap plus a constant, so the rail's overflow clip stops slicing the shadow off its bottom card. All three tests went red against a PR that had not removed a single cap.

The tests are right about their subject and wrong about their method

This file already made this mistake once and fixed it the same way. The comment sits two lines above one of the failing assertions:

Counted by the layer they sit on, not by a literal z-index: the overlay rail reads its depth from Z_LAYER now.

_capped_stacks() now matches the cap being derived from stack.maxHeight, through an optional wrapping call. Nothing about what the assertions are about changes: a cap that stops reading stack.maxHeight still fails.

Mutation-checked

mutation result
#9246's railMaxHeight(stack.maxHeight) passes
cap dropped entirely fails
cap hardcoded to 600, no longer tracking the measurement fails
only one of the two stacks capped fails

That last one is the exact bug the == stacks comparison exists to catch, and it still does.

Verification

#9246 needs no change; it goes green once this lands and it rebases.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

…spelled

Three tests assert every bottom-right overlay stack caps itself, and counted the
literal `maxHeight: stack.maxHeight` in provider.tsx to do it. #9246 keeps the cap
but wraps it -- `maxHeight: railMaxHeight(stack.maxHeight)`, which is the same
value plus a constant gutter so the rail's overflow clip stops slicing the shadow
off its bottom card -- and all three went red against a PR that had not removed a
single cap.

The tests are right about what they care about and wrong about how they check it.
This file already made the same mistake once and fixed it the same way; the
comment two lines below one of these assertions says so:

    Counted by the layer they sit on, not by a literal z-index: the
    overlay rail reads its depth from Z_LAYER now.

_capped_stacks matches the cap being DERIVED from stack.maxHeight, through an
optional wrapping call. That still fails on everything the count was protecting,
verified by mutation: the cap dropped entirely, the cap hardcoded to a number so
it no longer tracks the measurement, and only one of the two stacks capped -- the
exact bug the "== stacks" comparison exists to catch. #9246's wrapped form passes,
and its branch goes from 3 failures to 187 passed with this test alone swapped in.

Nothing about the assertions' subject changes. A cap that stops reading
stack.maxHeight still fails.
@danielhanchen
danielhanchen force-pushed the fix-overlay-cap-guard branch from 0e14b3d to d17e89f Compare August 19, 2026 05:03
@danielhanchen
danielhanchen merged commit 8b4a5ee into main Aug 19, 2026
4 of 5 checks passed
@danielhanchen
danielhanchen deleted the fix-overlay-cap-guard branch August 19, 2026 05:03
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