Skip to content

Implement MatchedGeometryEffect API - #981

Merged
Kyle-Ye merged 2 commits into
mainfrom
feature/matched_geometry_effect
Aug 9, 2026
Merged

Kyle-Ye merged 2 commits into
mainfrom
feature/matched_geometry_effect

Conversation

@Kyle-Ye

@Kyle-Ye Kyle-Ye commented Aug 9, 2026 •

Copy link
Copy Markdown
Member

Close #922.

Summary

  • Add MatchedGeometryProperties and both matchedGeometryEffect modifier overloads.
  • Implement matched-geometry scope, shared-frame coordination, layout geometry, and display-list effects.
  • Add standalone examples for the standard and clip-shape variants.
  • Add animation snapshot cases for both example paths.

Related PR

#923

@github-actions github-actions Bot added area: animation Animation, transitions, transactions, or timing behavior. area: example Example apps, previews, sample projects, screenshots, or demo assets. area: layout Layout, geometry, safe area, alignment, stacks, or sizing. area: rendering DisplayList, render backends, renderer hosts, drawing, and effects. type: feature New API, behavior, platform support, or user-facing capability. labels Aug 9, 2026
@Kyle-Ye
Kyle-Ye marked this pull request as ready for review August 9, 2026 10:54
@Kyle-Ye Kyle-Ye mentioned this pull request Aug 9, 2026
@augmentcode

augmentcode Bot commented Aug 9, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: This PR introduces the core API and rendering pipeline for matched geometry effects.


Changes:

  • Adds MatchedGeometryProperties, including position, size, frame, and private clip-rect options.
  • Exposes the standard View.matchedGeometryEffect modifier and a private clip-shape overload.
  • Introduces a matched-geometry scope that groups views by identifier and namespace.
  • Coordinates shared frames, source selection, transition animation state, and animation listeners.
  • Applies matched layout frames and display-list clipping effects while views transition.
  • Adds standard and clip-shape example views, and makes the standard example the sample app's root content.
  • Adds disabled animation snapshot cases for both examples while rendering differences are investigated.
Technical Notes:
  • Shared geometry is expressed in global coordinates, then converted through each view transform for layout and display-list output.
  • Matched frame state is managed through AttributeGraph attributes and removable-view lifecycle hooks.

🤖 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.

@augmentcode

augmentcode Bot commented Aug 9, 2026 •

Copy link
Copy Markdown

PR Risk Analyzer Agent 🛡️

👀 Human review needed

Justification

This PR introduces a substantial new feature (type: feature) rather than a low-risk maintenance change, so it is not eligible for automatic ready-for-review approval:

  • New public API surface. Adds the frozen MatchedGeometryProperties OptionSet and two public matchedGeometryEffect(...) overloads on View (one @_spi(Private) clip-shape variant), plus the frozen public struct _MatchedGeometryEffect. Public/frozen API and @available versioning decisions warrant human sign-off.
  • Core layout + animation + rendering surface. ~734 new lines in Sources/OpenSwiftUICore/Render/GeometryEffect/MatchedGeometryEffect.swift implement matched-geometry scope, shared-frame coordination, layout geometry (MatchedFrame), animator state, and display-list clipping (MatchedDisplayList). Spans three labeled risk areas: layout, animation, rendering.
  • Low-level graph and memory operations. Uses AttributeGraph primitives directly (Attribute, StatefulRule, RemovableAttribute, ObservedAttribute) and raw pointer manipulation in MatchedSharedFrame.willRemove via UnsafeMutableRawPointer(mutating: attribute.info.body).assumingMemoryBound(...). Lifecycle/reset-seed and source-view selection logic (including a bounded retry loop and Log.externalWarning for undefined multi-source states) needs careful correctness review.
  • Public interface change. Example/Modules/Platform/cocoa/SwiftUI_SPI.swiftinterface gains a matchedGeometryEffect(..., clipShape:) declaration, affecting the exported ABI-compatibility surface.

No automatic-approval policy classifies a change of this size and sensitivity as low-risk; failing closed to human review.

Reviewed commit 415bc2b

Pair Reviewer 🧭

→ Pair Review Briefing

Reviewed commit 415bc2b

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

Deep Code Review Agent🐛

Review completed with 0 suggestions.

Reviewed commit: 415bc2b

@Kyle-Ye Kyle-Ye changed the title Implement matched geometry effects Implement MatchedGeometryEffect API Aug 9, 2026
@codecov

codecov Bot commented Aug 9, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 406 lines in your changes missing coverage. Please review.
✅ Project coverage is 26.89%. Comparing base (9bb08df) to head (415bc2b).

Files with missing lines Patch % Lines
.../Render/GeometryEffect/MatchedGeometryEffect.swift 0.00% 406 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #981      +/-   ##
==========================================
- Coverage   27.07%   26.89%   -0.19%     
==========================================
  Files         731      732       +1     
  Lines       53573    53979     +406     
==========================================
+ Hits        14507    14515       +8     
- Misses      39066    39464     +398     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tuist

tuist Bot commented Aug 9, 2026 •

Copy link
Copy Markdown

🛠️ Tuist Run Report 🛠️

Tests 🧪

Scheme Status Cache hit rate Tests Skipped Ran Commit
OpenSwiftUI ✅ 0 % 82 0 82 062631043

Builds 🔨

Scheme Status Duration Commit
OpenSwiftUI ✅ 2m 57s 062631043

@Kyle-Ye
Kyle-Ye merged commit cffef16 into main Aug 9, 2026
9 checks passed
@Kyle-Ye
Kyle-Ye deleted the feature/matched_geometry_effect branch August 9, 2026 11:52
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. area: example Example apps, previews, sample projects, screenshots, or demo assets. area: layout Layout, geometry, safe area, alignment, stacks, or sizing. area: rendering DisplayList, render backends, renderer hosts, drawing, and effects. type: feature New API, behavior, platform support, or user-facing capability.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add View.matchedGeometryEffect(id:in:properties:anchor:isSource:)

1 participant