Repository navigation
fix: size the floating panel against its viewport so root zoom can't push it past the window - #5362
Merged
Merged
Conversation
…push it past the window Since #5039, a window narrower than `--lf-rail-room` opens the thread Send starts in the floating panel, not a margin card, so `test_a_zoomed_floating_draft_and_sent_comment_fit_a_narrow_window` waited for a card that no longer opens there. Reading the panel instead showed it overran the window: the panel's width was `min(540px, 100vw - gutter)`, and a page's root `zoom` scales the panel but not `100vw`, so at zoom 1.25 in a 605px window the panel stood 675px wide and cut off Resolve and Close. The width now subtracts the gutter from `100%` of the viewport the panel is fixed to, which zoom scales with it. Unzoomed, the panel is unchanged. The test now checks the panel thread fits the narrow zoomed window, then widens the window and checks the card the thread moves to shows its words. It drops its transformed-holder case: since #5228 Leaf's chrome root stands after `body` as a 0x0 box, so that case's page rule transforming `div.lf-chrome` made it a zero-width containing block, and the draft never took focus; its local `zoom` on `.lf-fab-bar` already lost to the chrome guard. No page markup can put Leaf's surfaces under a transform now. Closes #5142
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since #5039, a window narrower than
--lf-rail-room(958px with Leaf's theme) opens the thread a new comment's Send starts in the floating panel, not a margin card.test_a_zoomed_floating_draft_and_sent_comment_fit_a_narrow_windowstill waited for a card at 605px and 315px, so it failed in every run since the 11-02 nightly (#5142). Rewriting it to read the panel exposed a product defect: under a page's rootzoom: 1.25in a 605px window, the panel was 675px wide and cut off its own Resolve and Close.Cause. The panel's width was
min(540px, 100vw - gutter). A rootzoomscales the panel but not100vw, so the zoomed panel was wider than the window. The width now subtracts the gutter from100%of the viewport the panel is fixed to, which zoom scales with the panel. At zoom 1 the result is the same, apart from no longer counting a classic scrollbar's width.leaf-dev stillsshowsfloating-threadandship-threadsunchanged at phone width, andfloating-threadunchanged at 560x800.Test. At a narrow window under root zoom, the test still holds the draft inside the window, as #2232 meant it to. After Send it now checks that the panel shows the thread and fits the window. It then widens to 1440px and checks that the card the thread moves to shows its words unclipped. The test fails on main at the panel's bounds and passes with the CSS change.
It drops the
transformed-holdercase. That page transformeddiv.lf-chrome. Since #5228, Leaf's chrome root stands afterbodyas a 0×0 box (base.css,:root > .lf-chrome), so the transform turned it into a zero-width containing block, and the draft never took focus. The test failed there on main, earlier than the card check, and bisecting puts the break at #5228. The case's localzoom: 1.2on.lf-fab-baralready lost to the chrome guard (computedzoom1). Ordinary page markup can no longer put Leaf's surfaces under a transform, so the case protected no reachable page.test_a_scaled_floating_draft_keeps_its_room_when_its_passage_scrolls_awaystill covers a scaled draft.Left open. Several other chrome rules also size against
100vw, such aschrome.css,annotation-chrome.css,controls.cssand the--lf-float-wfallback. I haven't checked which of them overrun the window under a rootzoom.Closes #5142 — automated triage