Repository navigation
Glass menus open and close like iOS 26: a consumed opener, a round lens and a droplet close - #1444
Merged
Merged
Conversation
The morphing menus (Library Sort & Filter and the +N list, Watchlist Sort & Filter, the profile menu) now lay their panel over the control that opened them: the panel's top edge is the opener's top edge, the near edge is still the opener's outer edge, and the panel is never narrower or shorter than the opener. One shared rule, popover::cover_opener beside hang_x, replaces the per-screen arithmetic (16 px under the pill, a fixed y of 154 for the chip). A panel too tall for the room still slides up inside the safe frame. The profile menu is laid over the chip's live drawn rect, the resting circle before the first draw. The old-placement tests change on purpose: the panel covers the pill in every language, and each menu's settled panel contains its opener with the tops flush. Co-Authored-By: Claude Opus 5.5 <[email protected]>
While a morphing surface names a bar member as its opener (the profile chip, Screen::bar_opener), the chrome pass no longer draws that member. Header openers already work this way: the page leaves the opener out of its own pass (DrawFrame::lifted) and the lift pass is its only copy. Rig::draw_chrome now takes the lifted bar member (the same decision as the lift pass, Dispatcher::lift_target) and Bridge::draw_chrome skips the chip for it, so the chip is not left visible under the dim while the menu is open, and its label is not in the host snapshot the panel's rim refracts. The dispatcher re-takes the host snapshot when the lifted member changes, bar member or page element alike. The chip appears only through the lift pass at the morph's opener alpha. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Measured from the iOS 26 Photos filter menu (60 fps, about 230 ms): the rows and the frost leave while the glass holds (already so); the clear slab then springs to a small drain rect just below the opener (centred on it, 60% of its width, about its height, 8 px under it, closer than the neck reach); then the opener re-forms as its own blob at its own rect, growing from about half size, while the slab shrinks to nothing toward its top-centre, draining up into it through the smooth-minimum neck, and the opener's face fades back in over the last of it. When the slab is gone the frame is the closed frame exactly. A close with no opener rect (the fade+scale fallback) has no droplet and keeps its old end. All new numbers are named constants in popover_morph. The open is unchanged; with the panel now covering its opener, its first frame is the opener's rect and it grows out of itself. The N-b test keeps its ramp rule for the open and holds the close to the drain band and a last bead; the close-duration test and the dim-and-morph one-clock test move with the new choreography (the rect holds for the content phase, so its reading turns up to three frames after the dim). Co-Authored-By: Claude Opus 5.5 <[email protected]>
The bar left the chip out of the chrome pass as soon as the menu mounted, but the lift that replaces it stands on the stack's latched underlay field and paints nothing until that has latched, so the first frames of an open drew the chip nowhere and it blinked out for a frame. The dispatcher now decides once per frame, before the dim pass can latch the field, whether the lift paints the chip (`bar_paint`). The chrome pass leaves the chip out on exactly those frames and draws it itself until then, the lift pass is asked only on them, and the host snapshot is re-taken on the frame the chip changes hands. A chip the morph has consumed stays out of the bar. Co-Authored-By: Claude Opus 5.5 <[email protected]>
On a close the opener re-forms as a blob B that the glass joins to the draining slab A by a smooth-minimum neck. B started from nothing about the opener's centre, so on its first frame it was a point the smooth minimum turned into a one-frame spike on the slab's top edge, and a frame later, with a taller opener, a small capsule floating above the slab with the neck broken. B is now born at BLOB_BORN (0.3) of the opener's size, so it is a shape the neck can join, and it grows up from the opener's bottom edge, the one nearest the slab, so the gap between B's bottom and the slab's top never exceeds the drain gap, well inside the neck's reach. The open is unchanged, and so are the 13 frames of the close and the small drop hanging under the pill at its end. New tests step the close at 1/60 for three openers and require the union of the two shapes, by the shader's own smooth minimum, to be inside the glass at the middle of the gap on every frame both exist, and B's first frame to be at least a quarter of the opener's height. Co-Authored-By: Claude Opus 5.5 <[email protected]>
On a close the glass is a clear slab A draining into a blob B, the opener re-forming, and the frame then hands back to the opener drawn focused: a flat white pill. B was dark glass on every frame of its re-forming and the pill popped in on the hand-back (owner film, 2026-11-17). B's face now blends from the glass toward the opener's focused fill: Merge::tint (0 when B is born, REFORM_TINT of it as the slab arrives, all of it when A is gone) rides the two clocks B's size already rides, so it needs no curve of its own and steps by at most a quarter of the range per frame at 60 fps. The opener's face (its label) never leads the tint. The caller names the colour: Popover::opener_fill, which the Library's and the Watchlist's header menus set to page_header::OPENER_FILL, the very constant the lift paints the pill with; the account menu names none, its opener is a glass capsule with no flat focused fill. fs_glass.frag mixes the finished straight colour toward u_mrg_tint (rgb the fill, alpha the amount, 0 = off) by the smooth minimum's own blend factor for B, 1 - hb, on both exits and before the dither. The open is left alone: frame 0 draws no glass and the face and the glass cross-fade on one progress, and B sits inside the growing panel there, where 1 - hb is at most a half. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…t away On the TV the first frame of every glass-menu close (the BACK press) cost 131% of a 60 Hz frame's GPU budget: it threw the frozen host snapshot away, so the page was redrawn into the snapshot, the tab bar's live blur re-sourced and the dim field re-latched. Popover::release() called host::invalidate() unconditionally. It has done so since becb4e5, when release() also released the host user; 28f9228 moved the release into release_host() ("a dismissed panel keeps its page frozen for the length of its fade-out") and left the invalidate behind. For both glass menus (a morphing popover with the Live host policy, which holds no ground stage) it protected nothing and cost the whole redraw. It now drops only a GROUND-stage snapshot (host::ground_invalidate): page + scrim + opener + the panel's own ground at full strength, which a fade could not be drawn over; only a caching_host popover reaches it (decision_alert). Real page damage and page motion during the fade still re-take through host::begin_frame, and the scrim and the lift are drawn live above the snapshot. Tests, red first: the pinned "one capture for open and stay, one at the dismiss" epoch delta of 2 is now 1 across the whole close, with host::invalidations() unmoved across pop.dismiss(); a container-level test drives BACK through a FixtureModal that owns a morphing Popover opened on Mount and dismissed on Closing as both real menus do (fixture::modal_owns_popover) and asserts the BACK step re-takes nothing; and a guard, green before and after, pins that a caching_host popover's ground snapshot is still dropped by the dismiss. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… it draws changed The BACK commit of a glass menu delivers Uncover then Enter(Restored) to the host page, and Home answered both with an unconditional fx.invalidate(Nav). Page damage on that commit retakes the frozen host snapshot on the close's first frame (host_refresh), the frame that then redraws the page into the snapshot, re-sources the tab bar's blur and re-latches the dim: 131% of a 60 Hz frame's GPU budget on the TV, over Home with the account menu. The Library page raises no damage on either event. What the damage protected: the arm syncs the catalog and, through the head of step, the caption policy the Under posters setting resolves to. Settings changes that setting while it covers Home (and an Opaque surface does not tick the page), and nothing tells a covered Home, so the Uncover/Enter damage was what repainted it. That is real and stays, narrowed to what changed: a new catalog generation (sync_catalog_changed), and a moved caption policy, which step's head now reports itself on whichever event first sees it (the head already refreshed the field on every event, so the arms could no longer observe the change). `covered` and the hero countdown are not drawn. Enter(Fresh), a page arriving, still paints unconditionally; Enter(Restored) (a modal's dismissal or a pop, which are the same event pair) paints only on a change, as the Library does, its transition's motion and a moved focus's own damage covering the rest. Test, red first: Cover, Uncover and Enter(Restored) over an unchanged page raise no typed page damage; a catalog that changed under the cover, and an Under posters setting that changed under it, still do (once); Enter(Fresh) still does. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… on every frame 4ae8dc5 handed the profile chip to the lift only once the stack's field had latched, so the snapshot taken on the mount frame held the bar's chip and the hand-over, two frames into the open, flipped ownership AFTER that frame's page pass had served the held quad: the chip was painted twice on that frame (the snapshot's copy under the lift's), both rims lost their lens (the snapshot is not `page_tex()` until it is re-taken), and the next frame re-took the whole page, a third over-budget frame per open on the TV. Its test counted bar and lift calls, not what the held snapshot holds. Ownership and the chrome's exclusion are keyed on the mount again, so the mount capture absorbs the change and the snapshot never holds the chip. The lift now paints on every frame its menu owns the chip and chooses its ground where it paints (`widgets::lift_ground`), by state and not by frame count: the latched field once there is one, else the host snapshot (valid on the mount frame, it is taken in that frame's page pass before the lift) drawn CLEAR through the existing `GlassMorph::clear` (the morphing menu's own opening material) with the snapshot in the `sharp` slot, which is the one the program reads in the snapshot's own bottom-up orientation, else the flat capsule `profile_chip_on` already falls back to. No gfx or shader change, and no live glass. The test now asserts the bar never draws a chip its menu owns, the lift is asked on every frame (the unlatched ones included) on the ground the frame's state gives, and the snapshot is re-taken on the mount and not again while the menu is up. Red against 4ae8dc5 (the bar drew the chip on the mount frame). Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…the draw The lift-ownership compare (a page element or a bar member the lift owns changes -> `popover::set_lift_owns(false)` and the host snapshot is thrown away) ran inside `draw_with`. The frame's page pass runs BEFORE the draw and has already served the held snapshot by then, so every flip re-took the snapshot one frame late and showed the old one on the flip frame. A latent case on main: focus moves off the opener during a closing menu's fade, `lift_target()`'s Closing branch drops the lift, and for one frame the opener was drawn by nobody (the old snapshot lacks it, the lift is off). The decision is a function of dispatcher state alone (`lift_target()`), so it is now `Dispatcher::settle_lift`, which `app/run.rs` calls at the head of the frame after the popover host's `begin_frame` and before `backdrop_layers` and the page passes that read the held snapshot. `draw_with` still calls it, idempotently, for the callers with no pre-pass (a host test, the plain `draw`), where it finds the application's call made and does nothing. The test drives the production order (`frame_with(.., false)`, then the pre-pass call, then the draw) through a mount and the stand-down of a closing menu and asserts the snapshot is thrown away in the pre-pass call and the draw throws away nothing. Red against the previous `draw_with` decision (the pre-pass call re-took nothing). Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The owner's verdict on the morph was that it is too fast. A frame-by-frame measurement of the owner's iOS 26 recording (a glass menu, 60 fps) shows what ours lacks: the height overshoots ~9% and settles over ~400 ms, the width lags and overshoots ~4%, the rows are laid out in the glass and ride its overshoot (visible from ~100 ms, opaque by ~150), the frost completes at the first peak, and a close bulges outward for a frame and takes its rows with the slab over ~50 ms. Ours is critically damped, still after ~150 ms, with its rows finished by ~80 ms. These tests state that curve (the measured table is in the test) and the close's bulge; the ones that pinned the old critically damped constants (no overshoot, a held rect on the close's first frames, the rows' own spring) now say the new thing. They fail on the current implementation. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…glass, a slower dim The owner found the morph too fast. Measured frame by frame, iOS 26's glass menu overshoots (height ~9%, width ~4% and two frames behind), settles over ~400 ms, carries its rows in the glass, frosts by its first peak, and its close bulges for a frame and takes the rows with the slab. - The width and height are underdamped springs fitted to the measured table (height k 920 zeta 0.66; width k 450 zeta 0.7 after a 26 ms lag), landed exactly on the panel (Spring::land) so an underdamped open reports settled only once it has stopped ringing, not at the first crossing. The fill ramp reads the height alone (it leads, so the glass draws from the first step); the frost, the rows and the dim read the slower axis. - The rows ride the glass: their scale is the glass's height over the panel's; they appear at ~100 ms and are opaque by ~150. The rows spring remains for the no-opener fallback only. - A close gives both springs an outward kick (the ~2% bulge), no longer holds the rect while the content leaves, and its rows and frost leave over ~50 ms with the slab; the close is 13 frames (217 ms). - The 30% dim of a morphing menu follows the morph (Popover::dim -> Scrim::following; the container used its appear spring, k 300, 73% at 150 ms and 14% at 200 ms on the way out). The three header menus ask for it; every other surface keeps the container's spring. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… bulge The popover host tests held the rect inside the panel for the whole open and had it only shrink on a close; the open now rings ~6% past the panel and a close bulges ~2% on its first frame, so both bounds say so. The opener's face hands from the open's fade to the close's return by a steeper blend of the out spring: with the slower out spring (6000, was 9000) the residual of the linear blend made the face flicker back by ~1e-3 while out closed on 1. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ens shape (red) The side-by-side film against the owner's iOS 26 recording shows the open's rect timing matches, but the close runs about twice as fast, the rows scale with the glass's height rather than being magnified by the lens, and the glass is a panel-radius box mid-motion rather than a round lens. These tests encode the measured close and rows tables (series.md, Iteration 2, 2026-11-17), the round-lens radius rule and the 'no row outside the rounded shape' check. Frame::rows_clip is a stub (= rect) so they compile; the next commit makes them pass. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…a round lens The close ran about twice as fast as the owner's iOS 26 recording: one k 2000 spring for both axes had the slab at the drain by ~60 ms. The width and the height are now separate springs fitted to the measured close table (width K 450, height K 140 with a ~7% bulge at ~33 ms, fold released at half the height's travel, opener whole by ~215 ms), the dim follows the height out and is gone with the slab. The rows' scale was the glass's height ratio; the recording shows the lens magnifying them (0.65 when they first show, ~1.12 at ~167 ms). They get their own underdamped spring (K 395, zeta 0.57, within 0.02 of the table) and show from ~75 ms. The glass was a panel-radius rounded rect all the way; iOS's is a round lens (half its smaller side) until it nears full size. The radius is now the lens until a shape spring (K 1500, released at 94% of the travel) relaxes it to the caller's panel radius, landing exactly. The shared painter has only a rectangular scissor, so the rows are clipped to the rect's inscribed rectangle (Frame::rows_clip) and none can show outside the round shape; a true rounded clip is the shared-layer follow-up. The host tests that pinned the old close (clip == rect, the arrived slab in the drain band, a 2% first-frame bulge) are updated to the measured one. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Three frames into a close the width leads and the height still holds its bulge (iOS: ~7% at 33 ms), so the old 'three frames in, both axes 20 px smaller' assertion pinned the double-speed close. It now checks the width at three frames and the height at five. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…drain smoothly The previous close test fitted the springs' travel before the fold shrank it, so the table passed while the drawn slab (the bbox of A and B the painter receives) collapsed by a third of the panel in one frame at +133 ms. The table is now encoded against the drawn bbox, per frame within 0.08; the drawn height may not rise after the bulge nor drop more than 12% of the panel in a frame, at every opener; the fold must begin while the slab is nearly at the drain. The radius bound is the tighter one (the lens side's change + 30% of the distance from the panel radius + 2 px) on the open; a close's radius departs the panel's, where its first step is the whole of its own gap, so that half of the test uses half the lens-to-panel span. The whitening and dim tests follow the later hand-back. (Red against the implementation of the previous commit.) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
At +133 ms the drawn slab dropped by a third of the panel in one frame: the fold, released at half the travel with K_FOLD 3600, shrank A on both axes at once. The fold is now released in the last fifth of the height's travel (FOLD_AT 0.2, K_FOLD 5800), narrows A by 1 - fold and drains its height with 1 - fold^2, so the drawn height follows the recording's bbox through ~200 ms and no frame drops more than ~11% of the panel; the width and height springs are refitted against the DRAWN series (K_CLOSE_W 460 / target -0.37 / kick 5.3, K_CLOSE_H 120 / target -0.67 / kick 5.5). The hand-back moves to ~233 ms (the table has the droplet gone by ~250). B wears all of the opener's fill by TINT_WHOLE_AT 0.9 so the last glass frame is whole whatever step the fold takes, K_SHAPE 1500 -> 1200 keeps the open's radius ease inside its per-frame bound. rows_clip is untouched. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…behind it, the ClipScope's lens and the morph's rows (red) The glass menu's rows are cut today by an inscribed rect, which slices a letter with a straight edge where the glass has a round one. The owner approved a shared rounded clip in the painter, so these pin it first: the coverage a fragment gets (1 inside, 0.5 on the edge, 0 half a pixel out), the plain rect and texture programs staying free of the mask, the masked variants writing every fragment through one helper, the one writer of the live record and the guards that clear it, the ClipScope's lens and nesting, and the rows lying inside the lens on the last frames before the settle. They do not compile against the old API, which is the failure. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…red rounded clip in the painter The rows of a morphing glass menu were cut by an inscribed rectangle, whose straight edge slices a letter where the glass has an arc. The painter gains a ROUNDED clip: ClipScope::open_rounded_in keeps the bounding-box scissor and adds the lens's rect and radius, and the programs the rows draw through cut their alpha by an anti-aliased rounded-rect coverage computed in authored px from a highp varying (not gl_FragCoord, so it needs no map into the bound target). Each family gets a variant behind PLX_RCLIP, bound only while a rounded clip is live: the rect program (flat and ramp rects route to it under a clip), the plain texture program for icons, and a third slot in the existing ink text program. The plain programs are byte-identical, so every draw outside a rounded scope costs what it did. gfx holds the one record with a single writer and a generation counter; the target guards (RegionTarget, DirectPass) clear it; the rect program's uniform locations become a by-value struct so the masked twin can carry its own. Popover::morph_rows opens the lens (Frame::rect, Frame::radius) and the inscribed-rect clip, its constant and its handover easing are gone. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…s progress Three app route tests still pinned the glass menu's earlier choreography and failed since the close was retimed (bulge, separate width and height springs, the slab draining into the opener). None is a product regression: on every failing frame the product does what the droplet design says (rust-modules/ui/src/popover_morph.rs), and the tests' proxy broke. - account menu, one clock: the 06f4c07 window "the rect's progress turns up to three frames AFTER the dim" held the dim to the rect's first frames; the width now leaves on close frame 1 while the dim follows the height, which the bulge holds for two. The clock is now pinned by equality: on every frame of both legs the scrim is the morph's own dim. The dim is never on the page with no glass drawn, is out no later than the glass and within its last sliver, and after the hand-back nothing of the morph is left. The old "the glass is back on the chip" line read progress (0 at close frame 9) while the slab drains to frame 14; it now reads the hand-back frame (ground_alpha 0). - account menu, chip rect: "progress 0 means the glass IS the chip's rect" is false on the open's first glass frame (the height leads, the width waits its lag: a drop 106 px tall below the chip) and through a close's drain. The closed frame is the frame whose ground_alpha is 0; it is the chip as the bar draws it, with a circle's corner, and the begin and the end are now counted apart (one counter was satisfied by the open alone). - Sort & Filter pill order: the settled menu no longer draws the pill at all (owner decision 2026-11-17: the glass CONSUMES the opener, opener_alpha 0, the lift paints nothing), so "drawn once, after the panel, on the settled frame" cannot hold. The test now walks the real draw from the press to the surface's removal: at most one copy (the lift's), painted at exactly the morph's opener alpha, after the panel rows on the mount frames that draw both, never beside visible rows, fading out on the way in, back on the way out, and drawn again once by the page. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…it late (red); the loop's dt clamp is a named constant The glass menu's open drew two more frames ~55 and ~110 ms after its continuous run ended, with the loop asleep in between. The morph's underdamped springs (`rows`, never landed; `lens`, landed only within 6e-5) are called at rest by the frame loop's per-iteration `vel * dt` test at 16 ms, but an idle wake hands the step up to the loop's 0.05 s clamp, which is three times the travel, so a spring the loop had stopped for reports motion and one sub-pixel frame presents. The guard steps an open, and separately a close, at 16 ms until the morph is quiet by the loop's own test, then hands it one step at an idle wake's dt and asserts no motion, no landing and an unchanged frame. The open fails today (the frame still drifts); the close already holds and stays as a regression guard. The 0.05 clamp in app/run.rs becomes `plx_machine::motion::FRAME_DT_CLAMP` so the rest judgement and the clock share one number; the value is unchanged. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…it moving, so an idle wake finds nothing to present After a glass menu's open, the loop drew two more frames ~55 and ~110 ms after its continuous run, with the loop asleep between them. `rows` was never landed and `lens` landed only within 6e-5, so both rang on under the loop's quarter-pixel rest test; the idle wake that follows steps them by up to the loop's 0.05 s clamp, three times the travel the 16 ms test judged, so they reported motion and one sub-pixel frame presented. `Spring::land_if_still(target, dt)` puts a spring exactly on its target once `plx_machine::motion::moving` (the test every integrator reports Motion by) no longer calls it moving at the step's `dt`, so a spring is landed on the very step the loop would stop asking for frames, and no later step of any length can move it. Judging at the clamp instead leaves a gap (a spring quiet at 16 ms but still travelling more than a quarter pixel in 50 ms sleeps unlanded and the wake lands it, a jump that presents a frame); the guard test sits in that gap and failed on it. `Morph::step` lands w, h, rows, lens, shape, out and fold with it, in the open and the close, and `settled()` now means every spring landed (exact, with no velocity) instead of tolerances on rows, lens, out and fold. The open settles at frame 30 (500 ms) instead of 35 (583 ms); the close's `closed()` frame (14) and `closed_for(false)` frame (13) are unchanged. The snap at a landing is under the rest test's quarter pixel (about 1e-3 of the rows/lens scale, under half a pixel on the panel). Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The 2026-11-17 owner decision made the glass menu morph consume its opener, reversing design review S11/S12: the opener fades out over the first 15% of the open (`Frame::opener_alpha`, `OPENER_OUT_AT`), is not drawn while the menu stands (the panel covers it, `popover::cover_opener`) and fades back in as the droplet drains into it. Only the item hold menu's lifted card stays whole. Comments and guides across ui/ and screens/ still said the pill stays lit and the glass grows out from under it; they now say what the lift pass does at `opener_alpha`. Also corrected, all comments and docs, no behaviour change: - the rows are scaled by their own lens spring (`K_LENS`) on an open and by the shrinking slab's height on a close, not by the glass's size (the `K_ROWS` and `Morph::rows` docs and the ui guide); - the compact dim's peak is ramped by the morph (`Popover::dim` -> `Scrim::following`), not by the container's appear spring, and is gone with the slab on the hand-back frame, not "by ~110 ms"; - the bar member's lift stands on the stack's field once latched and on the host snapshot drawn clear before that (`widgets::lift_ground`), on every frame the menu owns the chip; - `fs_glass.frag`'s `v_p` is quad-local (the panel's are `v_p - u_boff`), and the ink program in `text.rs` is bound for the painter's rounded clip too, which its third slot carries. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Conflicts resolved (both intents kept; main's #1420/#1433/#1434 shapes adopted): - rust-modules/src/app/bridge.rs: Bridge::draw_chrome keeps the lane's `lifted` early return (the chip a morphing menu consumed is the lift's alone) over main's `self.retained.chrome` / `self.retained.strip` fields. - rust-modules/src/app/library_route_tests.rs: the lane's rewritten sort/filter lift test stands; main's only change in that hunk was `w.bridge` -> `w.bridge.bridge()` on lines the lane had already removed. - rust-modules/ui/src/dispatch.rs: the lane's `settle_lift` (decided before the page pass) replaces the in-draw block; main's #1420 guard (`Painter::root().is_recording()`) is ported into it, and the `set_lift_owns(false)` call goes with the global main removed (the card sections' receipt is Input's now). `draw_with`'s `lift_target` pattern takes the lane's 4-tuple. - rust-modules/ui/src/popover.rs: `Popover::release` keeps the lane's `ground_invalidate` (drops only a ground-stage snapshot) on main's counter-free body; the doc drops the `release_host` it cited, which #1420 removed. - rust-modules/ui/src/popover_host_tests.rs: the lane's "one capture for open, stay and close" test and its ground-stage guard kept; the guard takes main's `&ModalPresentation` for `begin_frame`/`page_pass`. Ports in files git merged cleanly: - ui/src/dispatch/replay_frame.rs: the replay Rig wrapper forwards the lane's `lifted` argument. - ui/src/containers/tests.rs: the lane's settle_lift test no longer reads the removed `lift_owns` flag; it grades the snapshot re-takes only. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… owner key retook it on the close's first frame main's #1420 moved the host cache's invalidation from Popover::release into bind_owner: the ModalCacheKey carries (entry, closing) per caching layer and a change of it called a full host::invalidate(). A glass menu's surface (Style::Compact caches its host) flips that bit on BACK, so the close's first frame redrew the page into the snapshot again, re-sourced the tab bar's blur and re-latched the dim field: the 131% of a 60 Hz frame's GPU budget the lane's `Popover::release` -> `ground_invalidate` change had removed. The unit test with a fixed presentation never flipped the key, so the lane's "one capture through the close" test did not see it. Red first: a_surface_that_starts_closing_keeps_the_page_snapshot_and_drops_only_a_ground_stage (real Dispatcher + ModalStack presentation) failed with ["retaken"] against ["page"]. bind_owner now drops only a GROUND-stage snapshot when the key differs only in layers that began closing (ModalCacheKey::only_began_closing); a layer that came or went, another stack, or a snapshot a navigation transition owns still drops everything. The same test also pins that a held ground composite is still dropped by that flip. Also: app/run.rs calls settle_lift on the destructured `pages` (main's #1420 restructure borrows the App's fields up front, so `app.pages` there no longer compiles). Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… host live while open (red)
surface_policy freezes the host under a Sheet, an Alert and an Opaque{snapshot:true} surface,
and a frozen page gets no Tick, so its snapshot is as old as the surface. The full invalidate()
at the Open -> Closing flip was the one retake after that stretch; keeping the snapshot for
every caching style showed the Library's old captions through Settings' exit fade. Red against
the current only_began_closing: Sheet, Alert, Opaque{snapshot:true}, and a Compact + Sheet stack
whose Sheet closes all keep the stale page; the Compact case (the existing test) must still pass.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… like its ring (red) Under a live rounded clip plain_program_for_clip hands the masked plain program to draw_tex_core_in, and the interior piece (radius 0 always qualifies) took it while the ring pieces stayed on the unmasked image program: the card's middle was cut by the lens's round edge and its ring by the scissor rectangle. Red against the current interior choice. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…starts closing 460983c kept the page's host snapshot whenever a caching layer merely began closing, for every style. But surface_policy freezes the host while a Sheet, an Alert or an Opaque{snapshot:true} surface is Open, and a frozen page gets no Tick, so the snapshot it leaves is as old as the surface: Library -> profile chip -> Settings -> change Under posters -> BACK faded Settings out over the old captions and jumped when the layer was pruned. The full invalidate() at the Open -> Closing flip was the one retake after that stretch. ModalCacheKey's layers now carry whether their style kept the host live while open, read off surface_policy(style, Open, _) rather than restated, and only_began_closing is true only when every layer that began closing did (Style::Compact, which is the Library, Watchlist and the glass menus). Any other close, alone or in a mixed stack, takes the full invalidate() as #1420 did. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…its ring
draw_tex_core_in picks the plain program once per draw through plain_program_for_clip, which under
a live rounded clip returns the MASKED variant, and the interior piece (radius 0 always takes the
plain exit) reused that pick while the ring pieces stayed on the image program, which carries no
clip slot. The card's middle was cut by the lens's round edge and its ring by the scissor
rectangle, against plain_program_for_clip's own doc ("a rounded card under a clip still keeps the
image program"). A card is now wholly bounded by its scissor: the interior reads the unmasked
PLAIN_IMAGE through interior_plain_program, and the plain programs are untouched.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The previous commit gave ModalCacheKey's layers a third fact, whether the layer's style kept the host live while open, which only_began_closing needs to know a close may keep the page's snapshot. The gate pinned the key's shape to Vec<(EntryId, bool)> and failed check-deps (screen-runtime-io). The key now holds Vec<CacheLayer>, and the gate pins CacheLayer to exactly id, closing and live_while_open, so nothing else about a surface can ride in the cache identity; the fact is read once off surface_policy when the key is made. Tests cover the new shape and both ways it can drift. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… CacheLayer" This reverts commit 8ce1651.
…on, not stored in the cache key The previous commits put a `live_while_open` fact in ModalCacheKey's layers, which ci/ui_boundaries.py rightly refuses: the key is GL cache identity only, and that fact is read off surface_policy, a policy table. The key is back to `Vec<(EntryId, bool)>` exactly as main had it, and the gate and its tests are unchanged. The decision moved to the comparison. ModalCacheKey::began_closing returns which layers STARTED closing when the two keys differ only by such flips (None for a layer that came, went or reopened, or another stack). ModalPresentation, the owner-addressed render input built from the stack, now carries the ids of its caching layers whose style kept the host live while open (surface_policy(style, Open, _).0 == Live, so only Style::Compact) and answers kept_host_live(id). bind_owner keeps the page snapshot only when every layer that began closing is one the presentation vouches for; a layer it does not hold is false, so the close takes the full invalidate() as #1420 did. A frozen-host surface's page snapshot got no Tick while it was up, and that flip is the one retake. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
GLinnik21
marked this pull request as ready for review
November 17, 2026 22:25
GLinnik21
added a commit
that referenced
this pull request
Nov 18, 2026
#1459) ## Summary The glass menus (Library and Watchlist Sort & Filter, the +N list, and the profile menu) are now frosted glass rather than a grey field: the frozen page behind the panel is blurred once, under a thin face of rgb(58,58,64) at .36 over rgb(40,40,46) at .44 (the owner's pick from the mock). The pass that follows makes the frost and the menus' existing close costs fit the TV's frame budget together. **The frost** (`gfx::FrameCache`, profiler phase `glass.frost_build`; `glass.frost` stays the name of the experimental full-resolution frost quad in `glassload.rs`): - Once per page snapshot, the region under the settled panel plus a 120 px margin (`FROST_MARGIN`, aligned to 8) is reduced 1/4 → 1/8 and blurred with two Kawase passes (d = 1.5, 2.5; σ ≈ 24 px). The panel composites that texture; nothing is blurred per frame. - Legibility keeps every contrast floor. The body is capped at `FROST_BODY_CEILING` = 0.333, derived rather than tuned: the tertiary ink reaches 3:1 at a body of 0.3372, minus 1/255. A soft knee from 0.9 of the ceiling (`y = knee + d·o/(o+d)`) keeps a bright page from reading flat; at 0.6 the frost was visibly darker than the mock. - The frost is a compile-time variant of the glass shader (`#define PLX_FROST`, `FS_GLASS_FROST`) linked with `link_optional_program`. If it fails to link, the log says `glass frost prog unavailable` and the menus keep the field face (`MENU_GLASS_FIELD_TOP/BOT`, .78/.86). The plain glass program is unchanged. The ~45 `static mut GL_*` uniform locations became a by-value `GlassUniforms`. **The body bake** (`FrameCache::frost_bake_owed`, `fs_frost_bake.frag`, phase `glass.bake`): the modal dim and the ceiling are applied once into a 1/8-resolution texture, keyed by the frost epoch, the region, the dim (field texture, `tex_ledger::revision`, tint) and the cap, instead of per pixel on every frame. The dim reaches the bake as `ModalPresentation.dim` (`ModalStack::first_dim` → `UnderlayField::dim_of`, `Dispatcher::modal_presentation_at`). A page-sourced dim that latches after the head's bake wakes exactly one corrective frame (`DimSink::dim_settled` → `popover::host::frost_body_stale`). ## The account menu's close no longer re-takes the page The account menu is a Sheet, which freezes its host while open, so `bind_owner` re-took the page on the close's first frame (14.9M GPU cycles, 133% of a refresh). Now a layer that has only started closing drops the ground stage and keeps the page snapshot for every presentation style (`ModalCacheKey::began_closing` returns whether it did; `kept_host_live` and `live_hosts` are gone). That is safe only if a page that changes under a cover says so. Pages now report a setting that moved under a cover at the head of `step`, through one shared helper (`registry::moved(&mut held, now)` plus `fx.invalidate(Provenance::Nav)`): Home, Library (including `sort_value`), Recommended (`deck_press`), Collection, Person, Search, Detail and Watchlist (caption policy and `rev`). Home damages on `FocusMoved` only when the focus or the `place()` fingerprint moved, and on `RestoreMemory` only when `projected_generation` or `place()` changed. ## The morph is frosted the whole way, and its rows show earlier The owner's direction from an iOS 26 recording: the droplet never reads as clear glass. `Frame::clear`, `clear_at` and `FROST_FROM`/`FROST_TO` are gone; the morph hands the glass only its join (clarity 0). From the first glass frame through the close's hand-back the body is the frost under `FROST_FACE`; a frame where the frost is not built yet wears the latched field under the heavier face, never the sharp page. `draw_shadowed` asks for the frost before the field check, so the build lands at the head of the open's second frame (O2) and stands when the glass first draws; nothing is added to O1. The rows fade in from `ROWS_FROM_AT` 0.05 (was 0.55; opaque at 0.8, was 0.96), first visible on the third glass frame (~33 ms) at a lens scale of ~0.2, and `content_alpha` is capped at `ground_alpha`. The close's row timing is unchanged. ## The opener is handed back the frame the droplet is gone After the profile menu closed, the "Demo" chip sat lighter for ~300 ms and then snapped darker (the owner's TV clip). The droplet's close ends ~14 frames after Back, but the surface (and with it the opener's lift, which paints the chip over the lighter latched field) was retired only when the Sheet container's spring rested, ~17 frames later. `Surface::faded` now also retires a closing surface on `Screen::handed_back`, for every style. In a sim film of the same scene the chip patch read 86 for frames 186-203 and 77 after; with the fix it reads 77 from the first hand-back frame. Regression tests: `a_morph_menus_surface_and_lift_end_on_the_frame_its_droplet_is_gone` (fails without the fix) and the rewritten `account_menu_route_tests::the_morph_begins_and_ends_on_the_chip_as_the_bar_draws_it` (asserts the surface leaves at the hand-back and the bar then draws the chip at its resting rect; red without the fix). ## Tried and reverted: folding the dim into the page The dim was folded into the held-page blit (`fs_dim_fold.frag`) to drop its separate full-screen pass. On the TV (same session, A-B-A, 11 cycles each) it COST GPU time on every dim-visible frame: Library open steady 9.36 / 9.34M with it and 9.05M without (+0.31M), account 7.60 / 7.60M against 7.19M (+0.41M), with 0.02M drift between the two fold-on runs. The `scrims` phase read 0 with the fold, but the folded draw landed in no phase, so only the frame total showed the cost. It is reverted in this branch. ## Measured on the TV All builds `ARM_PROFILE=release`, debug flavour, mock accounts only (the synthetic PMS checked before any key; the account menu signs in through the loopback plex.tv stand-in). GPU_ACTIVE from Mali HWCNT, median per frame role over 11 cycles; the budget is 11.2M per 60 Hz refresh. - **base:** main at 952d0a4 (#1444). - **frost only:** the frost before this pass (run 3). - **this branch:** the measured shape is run 6's fold-off build (ad49973 with the fold forced off; the branch's revert removes the same code). Run 5 measured ad49973 with the fold on; its pacing column is from that build. | | base | frost only | this branch | |---|---|---|---| | Library, rows visible (100-200 ms) | 10.74M | 11.48M (26 frames over) | 10.40M | | Library, open steady | 9.42M | 10.44M | 9.05M | | Library, close C3 | 10.42M | 11.81M (11 over) | 10.29M | | Library rows window, missed refreshes | 1 | 23 | 0 (run 5, fold on) | | Account, close's re-take frame (C2) | 14.90M (133%) | 14.91M | 5.10M | | Account close, missed refreshes | 25 | 33 | 1 (run 5, fold on) | | Account, open steady | 7.27M | 7.63M | 7.19M | - The frost's own build is one frame per snapshot (p50 0.68M; timed on the TV as `glass.frost`, renamed `glass.frost_build` afterwards) and the panel composite (`glass.frozen`) costs less than the base glass's (run 5: 4.19M against 4.63M). - Every program linked on the device: no `glass frost prog unavailable`, `link FAILED` or `shader compile FAILED` line in any log. - The DISPLAY captures of both menus show no banding, seam or flip. - The base and frost-only columns are from run 3, the third from run 6: different sessions. Run 6's fold-on build reproduced run 5 within 0.05M, which bounds the drift between sessions. - Not re-measured on the TV: the frosted-morph and hand-back changes (seen on the TV by the owner, not profiled), the pacing of the final shape (run 6 had no pacing leg; its frames are 0.3-0.4M cheaper than run 5's), and the commits after ad49973 (the revert, the merge of main, a test-isolation fix). ## Not fixed here - O1, the open's capture-and-latch frame, is over budget on main too (12.2-12.9M); the second frame is late in 19-21 of 21 cycles. Pre-existing, unchanged here. - The account menu's open missed 6 refreshes against 2-3 on base in run 5 (fold on). Without the fold its open frames are back at base (7.19M steady against 7.27M); its pacing was not re-measured. - `glass.bake` records at 2.0M during the dim ramp; not attributed. - The review noted that a close may rebuild the frost once (the close's first frame re-captures the page after the ground stage is dropped, which moves the page epoch). The run 5 HWCNT leg recorded one frost build per open-close cycle (11 over 11 cycles), and the close frames are under budget (Library C2 7.16M, account 5.50M), so it was left as is. - Damage under a cover not yet narrowed: Collection and Person on Enter/Uncover, `cards/grid.rs:355` and `shelf.rs:337/359`, `library/status.rs:53`, the `others_up` path (no Uncover), and the container chrome (not audited).
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.
Summary
The glass menus (Library and Watchlist Sort & Filter, the +N list, and the profile menu) now open and close like iOS 26's glass menus, fitted frame by frame to a 60 fps reference recording.
The opener is consumed. The glass detaches from the opener as a bead, and the opener fades over the first 15% of the open. The panel then stands over the opener. This reverses design review S11/S12, under which the opener was never part of the morph.
Open:
Popover::dim,Scrim::following).Close: a droplet.
u_mrg_tintinfs_glass.frag).Settling: every morph spring lands through
Spring::land_if_stillon the step where it stops moving. A late idle wake can no longer redraw a menu that has already settled.Shared mechanisms added or extended
A rounded clip in the painter.
ClipScope::open_rounded_in(p, rect, radius).rclip_setwith a generation counter.gl_FragCoordand no derivatives.#define PLX_RCLIPvariants offs_srcandfs_tex, bound only while a rounded clip is live. The plain programs are byte-identical (pinned), followingdither.glslrule 1.fs_text_ink.LOC_*statics became a by-valueRectUniforms.Popover::morph_rows.Spring::land_if_stillandmotion::FRAME_DT_CLAMP.Frame-cost fixes on a menu's close
Popover::releasedrops only the ground-stage snapshot, not the page snapshot.Dispatcher::settle_lift, before the page pass). The chip is painted on every frame throughwidgets::lift_ground.bind_ownerno longer retakes the page when a layer whose host stayed Live while open merely starts closing (ModalCacheKey::began_closing).ModalPresentation::kept_host_live), filled fromsurface_policyinModalStack::presentation().ModalCacheKeykeeps its(EntryId, bool)shape, soci/ui_boundaries.pyis unchanged.Opaque{snapshot:true}) still retakes everything, so a page changed under Settings is not shown stale during its exit. The same holds in a mixed stack.Measured on the TV
Base: main before this work (2730bef). Head: this branch's measured commit (ce48025, which already carried every frame-cost fix above except the #1420 merge follow-up). The later commits (
land_if_still, the merge of main and the review fixes) were not re-measured on the TV. Both wereARM_PROFILE=release, debug flavour, on mock accounts only.GPU cycles are a share of the 11.2M budget per 60 Hz refresh.
rclip prog unavailableorlink FAILEDline from boot through more than 12 menus.Spring::land_if_still(later in this branch) lands every morph spring exactly, and host tests pin that a late idle step wakes nothing. The TV has not confirmed it.Tests and gates
make test-crate C=plx_ui1703 passed / 0 failed;C=app T=route_tests121 passed / 0 failed;make check-nodef,ci/check-deps.shandci/test_ui_boundaries.py(33 OK) pass.make test-cratefor plx_gfx (272 / 0) and plx_screens,make test-hostsim(app and plx_media), and the ARMmakeafter the merge of main.make checkexited 0.make checkon macOS stops on two tests added by refactor(ui): enforce owned runtime and presentation events #1420 (actual_visible_player_paint_reports_typed_watch_without_mutating_itandan_unregistered_product_screen_uses_generic_navigation_and_actual_store_effects). They draw through real GL without a context and segfault in libGL. The first crashes the same way in a worktree that has refactor(ui): enforce owned runtime and presentation events #1420 but not this branch. With those two skipped, every suite passes. CI decidesmake check.fw-compat-reviewerwas not needed: there are no FFI, linkage ordynlib!changes, and the shader changes are GLSL ES 1.00 runtime sources.🤖 Generated with Claude Code