Skip to content

Add MatchedGeometryEffect#923

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

Add MatchedGeometryEffect#923
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 from e941aa6 to e646ab9 Compare June 28, 2026 15:14
@Dark-Existed Dark-Existed force-pushed the feature/match_geometry_effect branch from e646ab9 to 901cf2e Compare June 29, 2026 11:53
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