apple: upgrade glass token to interactive Liquid Glass, add glass-container - #62
Conversation
…tainer - "glass" now applies .glassEffect(.regular.interactive(), in:) on iOS 26/macOS 26 so Lui_element_combine chrome (composer capsule, composer_collapsed, action-button capsules) gets press feedback without a per-app tweak; below 26 the .regularMaterial fallback is unchanged. - New "glass-container" background token wraps the node's subtree in a GlassEffectContainer on iOS 26/macOS 26 so sibling glass surfaces fuse; on older OSes it degrades to the resolved background (a plain container). - Glass surfaces whose wire corner_radius is effectively a full pill — the 999 sentinel or a radius at least half the declared height — now use Capsule() instead of a clamped RoundedRectangle; non-glass shape computation is untouched.
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5f340d9662
ℹ️ 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".
| content.background(.regularMaterial, in: shape) | ||
| content.background(.regularMaterial, in: glassShape) | ||
| } | ||
| } else if name == "glass-container" { |
There was a problem hiding this comment.
Exclude glass containers from surface clipping
When glass-container is applied to a row or column used to group child glass surfaces, LUIClipRenderingPolicy still treats the non-transparent background name as visible and the later LUIOptionalClipModifier clips this entire wrapped subtree to a zero-radius rectangle. Child Liquid Glass halos, shadows, or animated fusion reaching the grouping node's bounds will therefore be cut off; special-case this container token as non-painting when deciding whether to clip.
Useful? React with 👍 / 👎.
Summary
Upgrades the
glassbackground token to full iOS 26 Liquid Glass soLui_element_combinechrome — composer capsule,composer_collapsed, and thebuttonsaction capsules (the only"glass"users) — renders interactive glass with press feedback, without each app registering a custom tweak (as chat does today viaLGChatLiquidGlassTweak).Three changes, all inside
LUIBackgroundStyleModifier/LUISurfaceModifier:"glass":content.glassEffect(in: shape)→content.glassEffect(.regular.interactive(), in: glassShape)on iOS 26/macOS 26. Below 26 the.regularMaterialfallback is unchanged."glass-container"token: on iOS 26/macOS 26 wraps the node's subtree in aGlassEffectContainerso siblingglasssurfaces fuse into one region. AGlassEffectContainerwraps children rather than painting a background, butcontentinside the surface modifier is the node's whole subtree, so the samebackground:wire prop covers it — no new wire contract. Below 26 it degrades tocontent.background(color, in: shape)(a plain container; the name resolves to nil → clear for non-surface kinds).LUIGlassShapePolicy.isPill(cornerRadius:height:)— true whencorner_radius >= 999(the sentinelcomposer_collapsed/n_action_buttonalready send) or when the radius is ≥ half the declared height — selectsCapsule()for the glass shape instead of a clampedRoundedRectangle. Avatars keepCircle(); non-glass surfaces' shape computation is untouched.Other backends ignore the new token gracefully (Flutter/Qt/WinUI resolve unknown background names to transparent), and
"glass-container"flows through the free-formbackgroundstring prop — no OCaml/wire changes.Verified:
swift build,swift test(133),dune build,dune runtest(28) all green on macOS 26.5 / Swift 6.3.3.Link to Devin session: https://app.devin.ai/sessions/cb54102d1f9b42c19804df4506305ac6
Open in Devin Desktop: https://app.devin.ai/desktop/session/cb54102d1f9b42c19804df4506305ac6?variant=devin
Requested by: @RCmerci