Skip to content

Add MatchedGeometryEffect - #923

Closed
Dark-Existed wants to merge 1 commit into
OpenSwiftUIProject:mainfrom
Dark-Existed:feature/match_geometry_effect
Closed

Dark-Existed wants to merge 1 commit into
OpenSwiftUIProject:mainfrom
Dark-Existed:feature/match_geometry_effect

Conversation

@Dark-Existed

Copy link
Copy Markdown
Contributor

Implement #922

@Dark-Existed
Dark-Existed requested a review from Kyle-Ye as a code owner June 28, 2026 15:09
@augmentcode

augmentcode Bot commented Jun 28, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: This PR adds a SwiftUI-compatible matchedGeometryEffect implementation to OpenSwiftUI, enabling views that share an id+namespace to interpolate geometry across insert/remove transitions.

Changes:

  • Introduces View.matchedGeometryEffect and the underlying _MatchedGeometryEffect modifier with support for matching position/size/frame and optional clipping.
  • Adds a matched-geometry scope (MatchedGeometryScope) that maintains per-id shared frame state and tracks source vs destination views.
  • Implements shared-frame evaluation and animation state handling (SharedFrame/MatchedSharedFrame), including listener propagation and reset handling.
  • Wires the feature into the view graph by creating a root matched-geometry scope when geometry is needed.
  • Extends ViewTransform conversion APIs to support converting points between coordinate spaces (used by geometry matching).
  • Adds an example view and a snapshot-based UI test demonstrating geometry matching during axis changes.

Technical Notes: The implementation relies on AttributeGraph rules to publish a shared frame in global space and converts it back into each view’s local space using ViewTransform during layout/display-list evaluation.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode 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.

Review completed. 1 suggestion posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

self[index].y += offset.height
}
case let .affineTransform(matrix, inverse):
let transform = inverse ? matrix.inverted() : matrix

@augmentcode augmentcode Bot Jun 28, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

MutableCollection where Element == CGPoint applies CGAffineTransform.inverted() / CGPoint.applying(_:) directly, while other affine paths in ViewTransform are guarded with #if canImport(CoreGraphics) and fall back to _openSwiftUIPlatformUnimplementedWarning().
On non-CoreGraphics platforms this can become a compile-time break (or silently change behavior compared to the existing guarded implementations).

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

@Dark-Existed
Dark-Existed force-pushed the feature/match_geometry_effect branch 2 times, most recently from e646ab9 to 901cf2e Compare June 29, 2026 11:53
@Kyle-Ye Kyle-Ye added this to the 0.20.0 milestone Jul 5, 2026
@Dark-Existed
Dark-Existed force-pushed the feature/match_geometry_effect branch from 901cf2e to bb548de Compare July 13, 2026 12:25
@Kyle-Ye Kyle-Ye modified the milestones: 0.20.0, 0.21.0 Aug 2, 2026 — with ChatGPT Codex Connector
@Dark-Existed
Dark-Existed force-pushed the feature/match_geometry_effect branch from bb548de to 24386d7 Compare August 4, 2026 15:26
@Kyle-Ye Kyle-Ye added area: animation Animation, transitions, transactions, or timing behavior. type: feature New API, behavior, platform support, or user-facing capability. labels Aug 4, 2026 — with ChatGPT Codex Connector
@Kyle-Ye

Kyle-Ye commented Aug 9, 2026 •

Copy link
Copy Markdown
Member

Close in favor of #981 .

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

Labels

area: animation Animation, transitions, transactions, or timing behavior. type: feature New API, behavior, platform support, or user-facing capability.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants