Repository navigation
Studio: stop the overlay rail clipping card shadows in dark mode - #11260
Conversation
The bottom-right rail scrolls, so it clips at its padding box, and the 12px it reserved on the inline axis was shorter than the dark-mode card shadow reaches. 0 8px 28px -6px paints about 22px past a card's left edge and 14px above it, so the halo ended on a hard vertical line a few pixels out instead of fading. Widen the gutter to 28px on the left and 20px on the top, the two edges where a cut can be seen, and sit the rail flush against the right and bottom edges so the clip there lands on the screen edge. The cards keep their 16px inset and their height band: the cap grows by the gutters that pay for them.
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. |
|
@codex review |
Paying for the top gutter with a cap past 100dvh put the rail's scrollport top at -4px, so once the rail scrolls, a card brought back with scrollIntoView could align 4px above the window and lose its first pixels. That also trips the reach check in tests/studio/playwright_update_banner_layout.py. Take the gutter to 16px and cap the rail at 100dvh instead. The cards' band is the same 100dvh less 32 they always had, the top gutter still clears the 14px the dark shadow reaches above a card, and the rail never extends past the window on any edge.
|
@codex review |
|
Fixed in 31fdbc3: the rail is capped at 100dvh now, so its scrollport never starts above the window and scrollIntoView cannot park a card off screen. The top gutter is 16px, which still clears the 14px the dark shadow reaches above a card, and the cards' band is the same 100dvh less 32 as before. @codex review |
|
Codex Review: Didn't find any major issues. Hooray! 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". |
unslothai#11260 sat the rail flush in its corner and took the shadow gutter into an inline style, so right-4 became right-0 and the cap went from calc(100dvh - 8px) to 100dvh. It updated the two frontend tests that measure the gutter, but three checks here and one in test_overlay_layering match the rail by its class literal, and those literals were the ones that moved. The result reads far worse than it is: with no rail matched, the tests report "a rail left its bottom-right corner" and "the bottom-right overlay stack is gone" while the rail sits exactly where unslothai#11260 put it. Match what the tests actually claim. The corner is asserted, the right step is not. The cap is asserted to be viewport-relative, the arithmetic inside it is not, since that is decided and checked in overlay-shadow-gutter.test.ts. Both matchers are now exercised on a rail and on a non-rail, the way this file already tests its class matchers. They failed by matching nothing, which is the one failure a matcher cannot report about itself. Confirmed against the three regressions they exist for: a rail moved out of the corner fails 4, a rail with no viewport cap fails 3, a rail hard-coding a z-index over the named layer fails 3. (cherry picked from commit 8548cec)
…pattern (#11268) * Find the overlay rails by testid, not by the corner spelled into the 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. * 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>
…lothai#11260) * Studio: stop the overlay rail clipping card shadows in dark mode The bottom-right rail scrolls, so it clips at its padding box, and the 12px it reserved on the inline axis was shorter than the dark-mode card shadow reaches. 0 8px 28px -6px paints about 22px past a card's left edge and 14px above it, so the halo ended on a hard vertical line a few pixels out instead of fading. Widen the gutter to 28px on the left and 20px on the top, the two edges where a cut can be seen, and sit the rail flush against the right and bottom edges so the clip there lands on the screen edge. The cards keep their 16px inset and their height band: the cap grows by the gutters that pay for them. * Studio: keep the overlay rail's scrollport inside the viewport Paying for the top gutter with a cap past 100dvh put the rail's scrollport top at -4px, so once the rail scrolls, a card brought back with scrollIntoView could align 4px above the window and lose its first pixels. That also trips the reach check in tests/studio/playwright_update_banner_layout.py. Take the gutter to 16px and cap the rail at 100dvh instead. The cards' band is the same 100dvh less 32 they always had, the top gutter still clears the 14px the dark shadow reaches above a card, and the rail never extends past the window on any edge.
…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>
What
In dark mode the update card's shadow ends on a hard vertical line a few pixels to the left of the card instead of fading out. Same on the top edge.
Why
The bottom-right overlay rail scrolls (
overflow-y-auto), so it clips everything at its padding box. It reserved 12px on the inline axis and 8px on top, which was enough for the light shadow (0 2px 8px -2px) but not for the dark one (0 8px 28px -6px). Chromium paints that blur out to roughly its full radius past the spread rect, so the halo reaches about 22px to a card's left and 14px above it, and the clip cut the fade mid-gradient.Measured in the browser: with a solid
0 0 0 40pxtest shadow on the card, the cut lands exactly 12px out, on the rail's padding edge.Change
right-0/bottom-0and carries the cards' 16px inset as padding, so the clip on those two edges lands on the screen edge where a cut shadow is invisible.Tests
tests/update-banner-flex-priority.test.tsnow reads the dark shadow off the cards and asserts the gutter clears its reach, so a deeper shadow fails instead of quietly bringing the hard line back.tests/overlay-shadow-gutter.test.tsfollows the new inline gutters and the signed cap. Full frontend suite passes.