Skip to content

Conversation

@Kyle-Ye
Copy link
Collaborator

@Kyle-Ye Kyle-Ye commented Feb 8, 2026

No description provided.

@github-actions github-actions bot added enhancement New feature or request Testing labels Feb 8, 2026
@augmentcode
Copy link

augmentcode bot commented Feb 8, 2026

🤖 Augment PR Summary

Summary: This PR adds end-to-end support for context-driven ForegroundStyle and BackgroundStyle rendering in OpenSwiftUI, including environment plumbing and snapshot UI coverage.

Changes:

  • Implemented BackgroundStyle resolution, including environment keys for background overrides and background grouping/layering state.
  • Added View.backgroundStyle(_:) plus internal helpers _addingBackgroundGroup() / _addingBackgroundLayer() to influence default background behavior.
  • Implemented View.foregroundStyle overloads (single/pair/triple) and corresponding primitive modifiers that write resolved styles into the environment.
  • Updated foreground-style resolution defaults to use hierarchical primary style behavior when no explicit style exists.
  • Completed OffsetShapeStyle multi-level .resolveStyle handling and removed the now-redundant standalone ForegroundStyle modifier file.
  • Introduced new shape-style helpers (ShapeStylePair, ShapeStyleTriple, InterpolatedShapeStyle) to support multi-level and animated style packs.
  • Added snapshot UI tests validating default and nested foreground/background style behaviors.

Technical Notes: Style resolution is driven via _ShapeStyle_Shape operations and produces _ShapeStyle_Pack entries for requested level ranges, enabling hierarchical style selection and animation via pack AnimatableData.

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

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.

) -> Color.Resolved {
switch scheme {
case .light:
let combined = info.groupCount + context.rawValue
Copy link

Choose a reason for hiding this comment

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

systemBackgroundColor(info:context:scheme:)’s .light branch ignores info.layer, so _addingBackgroundLayer() won’t affect the computed background color in light mode (only in .dark). If layers are meant to model the system’s “secondary/tertiary background” behavior, you may need to incorporate info.layer into the light-mode calculation too.

Severity: medium

Fix This in Augment

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

for level in levels {
var innerShape = shape
base(level: level, env: shape.environment)._apply(to: &innerShape)
let style = innerShape.stylePack[name, 0]
Copy link

Choose a reason for hiding this comment

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

In BackgroundStyle._apply’s generic .resolveStyle(name, levels) case, reading innerShape.stylePack[name, 0] assumes the inner application wrote at level 0; if levels.lowerBound isn’t 0 (e.g. via offset(by:)), this will likely read .clear and populate incorrect entries. Consider indexing using the level actually written (like levels.lowerBound or level) so offset ranges resolve correctly.

Severity: medium

Fix This in Augment

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

@codecov
Copy link

codecov bot commented Feb 8, 2026

Codecov Report

❌ Patch coverage is 0% with 312 lines in your changes missing coverage. Please review.
✅ Project coverage is 13.04%. Comparing base (9916291) to head (0be3007).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...nSwiftUICore/Shape/ShapeStyle/ShapeStylePair.swift 0.00% 88 Missing ⚠️
...SwiftUICore/Shape/ShapeStyle/BackgroundStyle.swift 0.00% 86 Missing ⚠️
...SwiftUICore/Shape/ShapeStyle/ForegroundStyle.swift 0.00% 70 Missing ⚠️
...Core/Shape/ShapeStyle/InterpolatedShapeStyle.swift 0.00% 44 Missing ⚠️
...wiftUICore/Shape/ShapeStyle/OffsetShapeStyle.swift 0.00% 24 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #785      +/-   ##
==========================================
- Coverage   13.13%   13.04%   -0.09%     
==========================================
  Files         620      621       +1     
  Lines       36773    37040     +267     
==========================================
+ Hits         4829     4831       +2     
- Misses      31944    32209     +265     

☔ View full report in Codecov by Sentry.
📢 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.

@Kyle-Ye Kyle-Ye merged commit 6989e7b into main Feb 8, 2026
6 of 8 checks passed
@Kyle-Ye Kyle-Ye deleted the feature/shape_style branch February 8, 2026 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request Testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant