Skip to content

Find the overlay rails by testid, not by the corner spelled into the pattern - #11268

Merged
danielhanchen merged 10 commits into
mainfrom
fix-overlay-rail-matchers
Sep 18, 2026
Merged

danielhanchen merged 10 commits into
mainfrom
fix-overlay-rail-matchers

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

What

Four tests across two files are red on main since #11260 (2485a8fd9), which moved the notification rails flush to the bottom-right corner:

-className="pointer-events-none fixed bottom-0 right-4 -mx-3 flex max-h-[calc(100dvh_-_8px)] ... px-3"
+className="pointer-events-none fixed bottom-0 right-0 flex max-h-[100dvh] ..."
+style={{ paddingLeft: STACK_SHADOW_GUTTER_LEFT, paddingRight: STACK_CARD_INSET_RIGHT, ... }}

Both files found the rail with a regex that spelled the old corner into the pattern:

re.findall(r'"pointer-events-none fixed bottom-0 right-4 ([^"]*)"', provider)

So after #11260 it matched nothing, and the tests reported the rails as missing rather than as moved:

  • test_overlay_layering.py::test_the_notification_stack_uses_the_named_layer
  • test_update_release_notes.py::test_the_overlay_stack_fits_the_viewport
  • test_update_release_notes.py::test_the_desktop_stack_is_capped_like_the_browser_one
  • test_update_release_notes.py::test_the_download_panel_can_shrink_inside_the_capped_stack

The product change is deliberate and documented in the commit. The matchers are what move.

The change

Both files now find the rails by data-testid="overlay-rail", which #11260 added. This is the same reasoning test_update_release_notes.py already grew _class_on_testid for, in its own words: "An anchor built from classes cannot survive one of them being inserted or reordered, which is the failure this file is being fixed for." The rail matcher was the one place that had not been converted.

Two claims that used to ride along inside the matcher now get tests of their own:

  • test_both_rails_are_still_pinned_to_the_bottom_right_corner - a testid-anchored matcher would happily return a rail that had wandered to the top left, so the corner is asserted explicitly and names the rail that moved.
  • test_the_rail_gutters_come_out_of_the_cap_and_not_the_cards - Studio: stop the overlay rail clipping card shadows in dark mode #11260's actual claim, which no class can carry any more now the gutters are inline px. It holds the two floors the comment gives (22px left and 14px top, from the deepest card shadow 0 8px 28px -6px), requires both rails to take all four paddings from named constants, and refuses a rem-valued padding utility, which is the Studio: add a loaded models indicator with per-model eject #8082 failure those px constants exist to avoid.

Verification

  • Reproduced on unmodified main a945e399f: 4 failed, 192 passed.
  • After: 241 passed across both files plus the branding and docker suites this PR stacks on.
  • Sabotage-proved, each failing the right test with a message naming the cause:
sabotage caught by
rail off the corner (right-0 to left-0) test_both_rails_are_still_pinned_to_the_bottom_right_corner
cap removed the three capping tests
left gutter cut 28px to 4px test_the_rail_gutters_come_out_of_the_cap_and_not_the_cards
px-3 rem utility restored same

A pure restyle no longer breaks them, which is exactly what went wrong here.

Stack

Based on #11255, which is based on #11262. Merge order: 11262, 11255, this, then 11263 / 11257.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 18, 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-18T13:52:01.617021Z c7f992f Manual request
🔒 Security Review ✅ Completed 2026-09-18T12:22:13.793123Z 50ed115 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.

@shimmyshimmer

Copy link
Copy Markdown
Member

@codex security review

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review

Security review completed. No security issues were found in this pull request.

Reviewed commit: 50ed115119

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@danielhanchen
danielhanchen force-pushed the fix-desktop-branding-contract branch from c9796c8 to b430ebb Compare September 18, 2026 12:51
Base automatically changed from fix-desktop-branding-contract to main September 18, 2026 12:51
@danielhanchen
danielhanchen force-pushed the fix-overlay-rail-matchers branch from 22c9c3a to 30830bc Compare September 18, 2026 12:53
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 18, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 18, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 18, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 18, 2026
@unslothai unslothai deleted a comment from shimmyshimmer Sep 18, 2026
@unslothai unslothai deleted a comment from shimmyshimmer Sep 18, 2026
@unslothai unslothai deleted a comment from shimmyshimmer Sep 18, 2026
@unslothai unslothai deleted a comment from shimmyshimmer Sep 18, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 18, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 18, 2026
@unslothai unslothai deleted a comment from shimmyshimmer Sep 18, 2026
@unslothai unslothai deleted a comment from shimmyshimmer Sep 18, 2026
@unslothai unslothai deleted a comment from shimmyshimmer Sep 18, 2026
@unslothai unslothai deleted a comment from shimmyshimmer Sep 18, 2026
@unslothai unslothai deleted a comment from shimmyshimmer Sep 18, 2026
@unslothai unslothai deleted a comment from shimmyshimmer Sep 18, 2026
chatgpt-codex-connector[bot]

This comment was marked as resolved.

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 18, 2026
chatgpt-codex-connector[bot]

This comment was marked as resolved.

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 18, 2026
chatgpt-codex-connector[bot]

This comment was marked as resolved.

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 18, 2026
chatgpt-codex-connector[bot]

This comment was marked as resolved.

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

Copy link
Copy Markdown
Member Author

@codex review

danielhanchen and others added 10 commits September 18, 2026 13:49
…pattern

#11260 moved the rails flush to the bottom-right corner (right-4 -> right-0,
max-h-[calc(100dvh_-_8px)] -> max-h-[100dvh]) and paid the inset as inline px
padding. Four tests across two files matched the rail with a regex that spelled
the old corner into the pattern, so they found nothing and reported the rails as
missing rather than as moved:

  test_overlay_layering.py::test_the_notification_stack_uses_the_named_layer
  test_update_release_notes.py::test_the_overlay_stack_fits_the_viewport
  test_update_release_notes.py::test_the_desktop_stack_is_capped_like_the_browser_one
  test_update_release_notes.py::test_the_download_panel_can_shrink_inside_the_capped_stack

The product change is deliberate and documented; the matchers are what move.
Both files now find the rails by data-testid="overlay-rail", which is the same
reasoning test_update_release_notes.py already grew _class_on_testid for: an
anchor built out of the classes under test cannot survive one of them changing.

Where the rail sits is now a claim in its own test rather than a side effect of
the matcher, and the gutter rule #11260 introduced gets one too: the cap is the
whole viewport and the gutters are paid as inline px, so the cards keep the band
they had. That test also holds the two floors the comment gives (22px left and
14px top, from the deepest card shadow) and refuses a rem-valued padding utility,
which is the #8082 failure the constants exist to avoid.

Sabotage-proved: rail off the corner, cap removed, left gutter cut to 4px, and a
px-3 utility restored each fail the right test with a message naming the cause.
A pure restyle no longer breaks them, which is what went wrong here.
…onstant

Two review items, both right, both the failure this file exists to catch.

_applies passes on a gated rule, so md:fixed md:bottom-0 md:right-0 satisfied the
corner guarantee while the rail was unpinned below that breakpoint. The file's own
matcher tests say a positive guarantee takes _only_under; the rail assertions were
the place that did not.

Counting "padding*: STACK_" per file said nothing about which constant reached
which property. paddingLeft fed from STACK_CARD_INSET_RIGHT still counted two,
left the 22px floor vouching for a 28px constant nothing applied, and rendered a
16px gutter that clips the shadow the floor exists for. Now read per rail as a
property-to-constant map and compared whole.

Both sabotages fail the right test: gating the three utilities fails the corner
test, and swapping paddingLeft's constant fails the gutter test.
Two more of the same shape, both right.

The cap was a substring test, so md:max-h-[100dvh] counted as capped while every
viewport below that breakpoint could spill cards off screen again. It takes
_only_under now, like the corner assertions.

The rem-padding refusal matched a bare token only, so !px-3 walked past it -- and
an important Tailwind padding beats the non-important inline px padding outright,
which is precisely the rem-scaled offset the constants exist to avoid. It reads
through _split_variants now, so the variants and the importance marker come off
first, and arbitrary rem values are refused alongside the numeric scale.

Sabotages: md:max-h-[100dvh] fails the three capping tests, !px-3 and md:!px-3
each fail the gutter test. All three passed before.
…value

Three review items, all right, and two of them the same lesson twice.

test_overlay_layering.py found the rail with rfind("<")/find(">"). An attribute
holding a comparison starts that scan mid-expression and drops every class before
it, so a hard-coded z-index earlier in the className is invisible and the layering
test passes over the regression it exists to catch. The bracket- and literal-aware
scanner it needed already existed in test_update_release_notes.py, so it moves to
tests/_shared/jsx_tags.py and both files import it. tests/conftest.py already puts
that directory on sys.path for exactly this reason, in its own words: so the levels
"share one module rather than each growing a private copy".

The padding refusal enumerated spellings and kept missing them: first !px-3, then
px-2.5 (fractional, and this repo uses it) and !pr-[0px] / md:!p-[4px] (arbitrary,
non-rem, and !important beats the inline declaration outright). Enumerating values
has an endless tail, so it matches the PROPERTY now: the rail's padding comes from
the inline px style, and ANY padding utility on it is either rem-scaled or an
override. Seven spellings sabotage-proved, including all five named in review, plus
a plain pt-4.

The truncated-tag case is proved too: a comparison attribute before the test id
with z-[99] added to the className now fails the layering test.
ps- and pe- were outside the character class, and this repo uses both (ps-9,
ps-1.5, ps-[5px], pe-[calc(...)]), so !ps-3 on a rail would have overridden the
inline start gutter with a rem-scaled value and passed.

The side letter stays optional and a "-" still has to follow it, so
pointer-events-none, peer-* and place-items-center are unaffected; that is
asserted as a control alongside the four sabotages (ps-3, !ps-3,
pe-[calc(1rem)], md:!pe-2), each of which fails the gutter test.
…opped

The class-anchored matcher this PR replaces carried "pointer-events-none" inside
its pattern, so the rule was enforced as a side effect of finding the element.
Anchoring on the testid found the rail without it, and nothing else asserted it.

That is a behaviour contract, not styling. The rail spans its whole cap with a
28px transparent shadow gutter and a scroll region, and the cards inside opt back
in with pointer-events-auto (the download panel by name), so a rail that loses the
container rule swallows clicks meant for the UI behind it.

Asserted ungated, next to the corner rules. Dropping the class fails the test, and
so does gating it behind a breakpoint.
…ered part

_class_value answers what the className renders in EVERY state, which is what the
positive corner and cap guarantees need. The padding prohibition was reading the
same set, and for a "must never" that is the wrong question: cn("...", compact &&
"!pl-0") overrides the inline gutter whenever compact is true, and an
always-rendered reader never sees the token at all.

_rail_class_tokens reads the literals out of the whole expression instead, and the
two readers stay side by side with the asymmetry written down: "must always have X"
and "must never have Y" cannot be answered from the same set.

Sabotage: wrapping both rails as cn("...", isUpdating && "!pl-0") now fails the
gutter test and passed before.
…family

Tailwind has two ways to set padding and the guard only knew one. The
arbitrary-property form is emitted with !important and, once _split_variants has
taken the marker off, begins with "[", so a pattern anchored on "p" never sees
![padding:0px] or [padding-left:0px]! at all.

Both spellings now sit in one named pattern. The side letter stays optional with a
"-" required after it, so pointer-events-none, peer-* and place-items-* are still
out, and [margin-left:4px] and [position:fixed] are too; that control is asserted
alongside the four sabotages (![padding:0px], [padding-left:0px]!,
md:![padding-inline:1rem], [padding-block:2px]).
@danielhanchen
danielhanchen force-pushed the fix-overlay-rail-matchers branch from c7f992f to 948c27a Compare September 18, 2026 13:49
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: c7f992f4cb

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

@danielhanchen
danielhanchen merged commit ed91ec2 into main Sep 18, 2026
0 of 23 checks passed
@danielhanchen
danielhanchen deleted the fix-overlay-rail-matchers branch September 18, 2026 13:53
shaojun pushed a commit to shaojun/unsloth that referenced this pull request Sep 29, 2026
…pattern (unslothai#11268)

* Find the overlay rails by testid, not by the corner spelled into the pattern

unslothai#11260 moved the rails flush to the bottom-right corner (right-4 -> right-0,
max-h-[calc(100dvh_-_8px)] -> max-h-[100dvh]) and paid the inset as inline px
padding. Four tests across two files matched the rail with a regex that spelled
the old corner into the pattern, so they found nothing and reported the rails as
missing rather than as moved:

  test_overlay_layering.py::test_the_notification_stack_uses_the_named_layer
  test_update_release_notes.py::test_the_overlay_stack_fits_the_viewport
  test_update_release_notes.py::test_the_desktop_stack_is_capped_like_the_browser_one
  test_update_release_notes.py::test_the_download_panel_can_shrink_inside_the_capped_stack

The product change is deliberate and documented; the matchers are what move.
Both files now find the rails by data-testid="overlay-rail", which is the same
reasoning test_update_release_notes.py already grew _class_on_testid for: an
anchor built out of the classes under test cannot survive one of them changing.

Where the rail sits is now a claim in its own test rather than a side effect of
the matcher, and the gutter rule unslothai#11260 introduced gets one too: the cap is the
whole viewport and the gutters are paid as inline px, so the cards keep the band
they had. That test also holds the two floors the comment gives (22px left and
14px top, from the deepest card shadow) and refuses a rem-valued padding utility,
which is the unslothai#8082 failure the constants exist to avoid.

Sabotage-proved: rail off the corner, cap removed, left gutter cut to 4px, and a
px-3 utility restored each fail the right test with a message naming the cause.
A pure restyle no longer breaks them, which is what went wrong here.

* Require the rail's corner ungated, and bind each padding to its own constant

Two review items, both right, both the failure this file exists to catch.

_applies passes on a gated rule, so md:fixed md:bottom-0 md:right-0 satisfied the
corner guarantee while the rail was unpinned below that breakpoint. The file's own
matcher tests say a positive guarantee takes _only_under; the rail assertions were
the place that did not.

Counting "padding*: STACK_" per file said nothing about which constant reached
which property. paddingLeft fed from STACK_CARD_INSET_RIGHT still counted two,
left the 22px floor vouching for a 28px constant nothing applied, and rendered a
16px gutter that clips the shadow the floor exists for. Now read per rail as a
property-to-constant map and compared whole.

Both sabotages fail the right test: gating the three utilities fails the corner
test, and swapping paddingLeft's constant fails the gutter test.

* Read the cap and the padding utilities through their variants

Two more of the same shape, both right.

The cap was a substring test, so md:max-h-[100dvh] counted as capped while every
viewport below that breakpoint could spill cards off screen again. It takes
_only_under now, like the corner assertions.

The rem-padding refusal matched a bare token only, so !px-3 walked past it -- and
an important Tailwind padding beats the non-important inline px padding outright,
which is precisely the rem-scaled offset the constants exist to avoid. It reads
through _split_variants now, so the variants and the importance marker come off
first, and arbitrary rem values are refused alongside the numeric scale.

Sabotages: md:max-h-[100dvh] fails the three capping tests, !px-3 and md:!px-3
each fail the gutter test. All three passed before.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Share one JSX scanner, and refuse padding by property rather than by value

Three review items, all right, and two of them the same lesson twice.

test_overlay_layering.py found the rail with rfind("<")/find(">"). An attribute
holding a comparison starts that scan mid-expression and drops every class before
it, so a hard-coded z-index earlier in the className is invisible and the layering
test passes over the regression it exists to catch. The bracket- and literal-aware
scanner it needed already existed in test_update_release_notes.py, so it moves to
tests/_shared/jsx_tags.py and both files import it. tests/conftest.py already puts
that directory on sys.path for exactly this reason, in its own words: so the levels
"share one module rather than each growing a private copy".

The padding refusal enumerated spellings and kept missing them: first !px-3, then
px-2.5 (fractional, and this repo uses it) and !pr-[0px] / md:!p-[4px] (arbitrary,
non-rem, and !important beats the inline declaration outright). Enumerating values
has an endless tail, so it matches the PROPERTY now: the rail's padding comes from
the inline px style, and ANY padding utility on it is either rem-scaled or an
override. Seven spellings sabotage-proved, including all five named in review, plus
a plain pt-4.

The truncated-tag case is proved too: a comparison attribute before the test id
with z-[99] added to the className now fails the layering test.

* Cover the logical padding utilities too

ps- and pe- were outside the character class, and this repo uses both (ps-9,
ps-1.5, ps-[5px], pe-[calc(...)]), so !ps-3 on a rail would have overridden the
inline start gutter with a rem-scaled value and passed.

The side letter stays optional and a "-" still has to follow it, so
pointer-events-none, peer-* and place-items-center are unaffected; that is
asserted as a control alongside the four sabotages (ps-3, !ps-3,
pe-[calc(1rem)], md:!pe-2), each of which fails the gutter test.

* Keep the rail's pointer-events contract, which the new matcher had dropped

The class-anchored matcher this PR replaces carried "pointer-events-none" inside
its pattern, so the rule was enforced as a side effect of finding the element.
Anchoring on the testid found the rail without it, and nothing else asserted it.

That is a behaviour contract, not styling. The rail spans its whole cap with a
28px transparent shadow gutter and a scroll region, and the cards inside opt back
in with pointer-events-auto (the download panel by name), so a rail that loses the
container rule swallows clicks meant for the UI behind it.

Asserted ungated, next to the corner rules. Dropping the class fails the test, and
so does gating it behind a breakpoint.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Read prohibitions off the whole class expression, not the always-rendered part

_class_value answers what the className renders in EVERY state, which is what the
positive corner and cap guarantees need. The padding prohibition was reading the
same set, and for a "must never" that is the wrong question: cn("...", compact &&
"!pl-0") overrides the inline gutter whenever compact is true, and an
always-rendered reader never sees the token at all.

_rail_class_tokens reads the literals out of the whole expression instead, and the
two readers stay side by side with the asymmetry written down: "must always have X"
and "must never have Y" cannot be answered from the same set.

Sabotage: wrapping both rails as cn("...", isUpdating && "!pl-0") now fails the
gutter test and passed before.

* Cover Tailwind's arbitrary padding properties as well as its utility family

Tailwind has two ways to set padding and the guard only knew one. The
arbitrary-property form is emitted with !important and, once _split_variants has
taken the marker off, begins with "[", so a pattern anchored on "p" never sees
![padding:0px] or [padding-left:0px]! at all.

Both spellings now sit in one named pattern. The side letter stays optional with a
"-" required after it, so pointer-events-none, peer-* and place-items-* are still
out, and [margin-left:4px] and [position:fixed] are too; that control is asserted
alongside the four sabotages (![padding:0px], [padding-left:0px]!,
md:![padding-inline:1rem], [padding-block:2px]).

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
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.

2 participants