Skip to content

A glass or blur background resizes with its box's layout transition on iOS - #544

Open
rami-maalouf wants to merge 1 commit into
mainfrom
fix/glass-layout-transition
Open

rami-maalouf wants to merge 1 commit into
mainfrom
fix/glass-layout-transition

Conversation

@rami-maalouf

Copy link
Copy Markdown
Member

Summary

On iOS, a box with backgroundMaterial (glass or a blur) and -exact-layout-transition jumped to its new size in one frame, while its border and shadow animated. The transition sizes the painted surface each frame (applySurface), but the material is a view the node holds (materialView, or glassSlot in a glass group), and it kept the laid-out frame.

applySurface now sets the material's frame to the surface's box each frame, and endSurface gives it the laid-out bounds back. In a glass group, UIKit then draws a resizing glass merging with and separating from its neighbours.

Evidence

In an app, a glass text field in a glass group widens by 167 points when a neighbouring glass button leaves. Before the change, Simulator recordings showed the glass reach its new width between two 60 Hz frames, in both directions. After it, the glass follows the transition over about 250 ms, and the neighbour's glass pulls away from the field's end as the field shrinks.

Validation

  • BoxLayerIOSTests.testLayoutResizeSizesTheMaterialAndGivesItBack, for glass and ultra-thin: fails without the change and passes with it (bun host/apple/build.mjs --test --ios --only BoxLayerIOSTests, iOS 26 Simulator, at 29e5bbd724). All 19 tests in the class pass with the change.
  • bun host/apple/build.mjs --tvos --no-install: passed.
  • bun scripts/caps.mjs: passed.
  • No Rust changed. macOS is unchanged: the code is under os(iOS) || os(tvOS).

🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant