Skip to content

Update geometry and shape style#910

Merged
Kyle-Ye merged 6 commits into
mainfrom
bugfix/geometry_reader
Jun 14, 2026
Merged

Update geometry and shape style#910
Kyle-Ye merged 6 commits into
mainfrom
bugfix/geometry_reader

Conversation

@Kyle-Ye

@Kyle-Ye Kyle-Ye commented Jun 14, 2026

Copy link
Copy Markdown
Member

Summary

Close #474

  • Refine GeometryReader geometry handling and update the related example/UI test coverage.
  • Add container shape support, including ContainerRelativeShape and container shape propagation.
  • Add anchored shape style support and update background/overlay shape-style behavior.
  • Improve background style propagation through view inputs so primary content receives the correct environment updates.

@github-actions github-actions Bot added area: graphics Color, shape, gradient, image, symbols, and graphics primitives. area: layout Layout, geometry, safe area, alignment, stacks, or sizing. area: view View APIs, modifiers, AnyView, ForEach, DynamicView, and related behavior. type: feature New API, behavior, platform support, or user-facing capability. labels Jun 14, 2026
@Kyle-Ye Kyle-Ye changed the title Update geometry and shape style compatibility Update geometry and shape style Jun 14, 2026
@Kyle-Ye Kyle-Ye marked this pull request as ready for review June 14, 2026 18:15
@Kyle-Ye Kyle-Ye merged commit 5497a70 into main Jun 14, 2026
6 of 7 checks passed
@Kyle-Ye Kyle-Ye deleted the bugfix/geometry_reader branch June 14, 2026 18:15
@augmentcode

augmentcode Bot commented Jun 14, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: This PR completes GeometryReader geometry handling and expands shape-style/background/overlay behavior to match SwiftUI semantics, including container-relative shapes and anchored shape styles.

Changes:

  • Updates GeometryReader/GeometryProxy to properly resolve anchors, frames, scroll-view clipping, and sized coordinate-space bounds.
  • Implements sized coordinate-space discovery in ViewTransform to support bounds(of:)-style queries.
  • Adds container-shape infrastructure: ContainerRelativeShape, propagation via view inputs, and ImplicitContainerShape behavior.
  • Introduces anchored shape style support via _AnchoredShapeStyle (including resolved paint plumbing).
  • Reworks background modifiers to support style/shape backgrounds (and safe-area behavior) while propagating background style through view inputs.
  • Extends overlay modifiers with style/shape overlays and adds a convenience border implementation.
  • Updates GeometryReader UI tests/examples to use shared example views and refreshed snapshot coverage.

Technical Notes: Background/overlay style rendering is now anchored to view bounds and constrained by the current container shape, improving environment propagation to primary content.

🤖 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. 2 suggestions posted.

Fix All in Augment

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

_openSwiftUIUnimplementedFailure()
Update.perform {
var rect = r
placementContext.map { rect.convert(from: $0, to: coordinateSpace) }

@augmentcode augmentcode Bot Jun 14, 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.

GeometryProxy.rect(_:in:) returns the input rect unchanged when placementContext is nil, which can make frame(in:) report a local-space rect even when the caller requests a different coordinate space (previously this path returned .zero). Consider handling the nil-context case consistently to avoid silently incorrect frames.

Severity: medium

Fix This in Augment

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

_openSwiftUIUnimplementedFailure()
// TBA: ViewTransform
transform.convert(.localToSpace(coordinateSpace.coordinateSpace), point: globalPoint)
}

@augmentcode augmentcode Bot Jun 14, 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.

GeometryProxy.convert(globalPoint:to:) takes a globalPoint but calls transform.convert(.localToSpace(...), point: globalPoint), which looks like an inverted conversion direction for this API and could yield incorrect coordinates. If this is intentional, it might be worth clarifying the expected input space here.

Severity: medium

Fix This in Augment

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

@codecov

codecov Bot commented Jun 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0.22676% with 440 lines in your changes missing coverage. Please review.
✅ Project coverage is 26.11%. Comparing base (ec8d089) to head (8178409).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...ore/Modifier/ViewModifier/BackgroundModifier.swift 0.00% 211 Missing ⚠️
Sources/OpenSwiftUICore/Shape/ContainerShape.swift 0.00% 127 Missing ⚠️
...wiftUICore/Shape/ShapeStyle/AnchorShapeStyle.swift 0.00% 40 Missing ⚠️
...UICore/Modifier/ViewModifier/OverlayModifier.swift 0.00% 29 Missing ⚠️
...enSwiftUICore/Layout/Geometry/GeometryReader.swift 3.70% 26 Missing ⚠️
...es/OpenSwiftUICore/Layout/View/ViewTransform.swift 0.00% 4 Missing ⚠️
...urces/OpenSwiftUICore/Layout/Geometry/Anchor.swift 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #910      +/-   ##
==========================================
- Coverage   26.35%   26.11%   -0.24%     
==========================================
  Files         710      712       +2     
  Lines       49537    49960     +423     
==========================================
- Hits        13053    13047       -6     
- Misses      36484    36913     +429     

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

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

Labels

area: graphics Color, shape, gradient, image, symbols, and graphics primitives. area: layout Layout, geometry, safe area, alignment, stacks, or sizing. area: view View APIs, modifiers, AnyView, ForEach, DynamicView, and related 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.

GeometryReader + safeAreaIssue issue

1 participant