Skip to content

apple: upgrade glass token to interactive Liquid Glass, add glass-container - #62

Merged
RCmerci merged 1 commit into
mainfrom
devin/1790485205-interactive-liquid-glass
Sep 27, 2026
Merged

RCmerci merged 1 commit into
mainfrom
devin/1790485205-interactive-liquid-glass

Conversation

@RCmerci

@RCmerci RCmerci commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Upgrades the glass background token to full iOS 26 Liquid Glass so Lui_element_combine chrome — composer capsule, composer_collapsed, and the buttons action capsules (the only "glass" users) — renders interactive glass with press feedback, without each app registering a custom tweak (as chat does today via LGChatLiquidGlassTweak).

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 .regularMaterial fallback is unchanged.
  • New "glass-container" token: on iOS 26/macOS 26 wraps the node's subtree in a GlassEffectContainer so sibling glass surfaces fuse into one region. A GlassEffectContainer wraps children rather than painting a background, but content inside the surface modifier is the node's whole subtree, so the same background: wire prop covers it — no new wire contract. Below 26 it degrades to content.background(color, in: shape) (a plain container; the name resolves to nil → clear for non-surface kinds).
  • Shape fidelity: new LUIGlassShapePolicy.isPill(cornerRadius:height:) — true when corner_radius >= 999 (the sentinel composer_collapsed/n_action_button already send) or when the radius is ≥ half the declared height — selects Capsule() for the glass shape instead of a clamped RoundedRectangle. Avatars keep Circle(); 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-form background string 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

…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.
@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-27T05:05:35.960138Z 5f340d9 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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" {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Verified on iPhone 17 sim (iOS 26.5) — built the examples/components/ios-swiftui gallery app from this branch and exercised every background:"glass" surface it renders.

Glass Buttons page — all four surfaces render as translucent capsules with correct pill geometry (radius 999 → Capsule(); multi-action groups fuse into one capsule):

Glass Buttons

Interactive press confirmed — mid-press screenshots show the capsule responding (scale/highlight). Pixel-diff vs baseline: 6,256 px changed confined exactly to the capsule bounds — a non-interactive glassEffect(in:) would show zero delta:

Unpressed Pressed
unpressed pressed

Combine page — the composer capsule renders as rounded-rect glass (radius 24 correctly stays RoundedRectangle, not pill) and composer_collapsed renders as a true capsule; both respond to press-hold (17k / 5k px deltas):

Composer + collapsed pill

Regression pass on logseq_journal (linked against this lui revision via JOURNAL_LUI_PACKAGE_PATH): Cognito sign-in → E2EE unlock → timeline renders, bottom-bar glass capsules + account circle render, account menu opens, capture composer sheet presents and accepts text, block detail + back nav work, cold relaunch restores the timeline. Both apps idle at 0% CPU.

Caveats: logseq_journal itself emits no background:"glass" surfaces today (its glass chrome is native JournalChrome/SwiftUI toolbar, and its composer is a V.Sheet modal), so the modifier is verified via the gallery and journal got a runtime regression pass; the new glass-container token compiles but has no consumers yet; journal's composer sheet nav chrome doesn't render inside presented sheets on the sim — a known pre-existing host limitation, unrelated to this change.

@RCmerci
RCmerci merged commit 3ea3e52 into main Sep 27, 2026
4 checks passed
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