Skip to content

feat(environment): update control size support - #1133

Merged
Kyle-Ye merged 1 commit into
mainfrom
feature/control_size
Oct 9, 2026
Merged

Kyle-Ye merged 1 commit into
mainfrom
feature/control_size

Conversation

@Kyle-Ye

@Kyle-Ye Kyle-Ye commented Oct 9, 2026

Copy link
Copy Markdown
Member

Summary

  • Move the control-size API into OpenSwiftUICore and distinguish an explicit size from the default regular size.
  • Add the explicit environment value and cached graph input, and make the view modifier nonisolated.
  • Match platform availability across SwiftPM and Xcode, refresh the lockfile, and document lockfile regeneration after manifest changes.

Validation

Scoped compilation, API access checks, and focused environment behavior checks passed with cached dependencies. Full package and UI builds were not run.

@augmentcode

augmentcode Bot commented Oct 9, 2026

Copy link
Copy Markdown

PR Risk Analyzer Agent 🛡️

👀 Human review needed

Justification

This PR modifies AGENTS.md, which is in the opted-out agent-configuration category (**/AGENTS.md) that always requires full human review — these files govern how agents verify work in this repository, so the policy fails closed to human review regardless of other factors.

Beyond the opt-out, the change is broad and touches sensitive build/dependency surfaces:

  • Package manifest & lockfile: Package.swift adds two availability macros (OpenSwiftUI_iOS_v3_0, OpenSwiftUI_watchOS_v4_0) and Package.resolved is regenerated (originHash change). Manifest/lockfile changes warrant human verification that the lockfile was regenerated correctly rather than hand-edited.
  • Xcode build configs: both OpenSwiftUI.xcconfig and SwiftUI.xcconfig add matching availability macros; these must stay in sync with the SwiftPM manifest.
  • Module relocation + behavioral change: ControlSize moves from OpenSwiftUI into OpenSwiftUICore, the ControlSizeKey default changes from eager .regular to nil with a computed ?? .regular fallback, a new package explicitControlSize accessor and cached _GraphInputs.controlSize graph input are added, and controlSize(_:) becomes nonisolated. The default-value and isolation changes affect public/package API semantics and merit human review.

Static analysis only; CI owns build and test verification.

Reviewed commit d2b49b8

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

Reviewed commit: d2b49b8

case extraLarge

public static var allCases: [ControlSize] {
[.mini, .small, .regular, .large, .extraLarge]

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🐛

allCases is always available but now returns .large and .extraLarge, whose cases are gated by later availability. Callers targeting earlier supported OS versions can observe those values without an availability check, which breaks the API availability contract.

Severity: medium


🤖 Was this useful? React with 👍 or 👎

set { self[ControlSizeKey.self] = newValue }
}

package var explicitControlSize: ControlSize? {

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🐛

This change adds the new explicitControlSize semantics, but there is no committed test that distinguishes an unset value (controlSize == .regular with explicitControlSize == nil) from an explicitly set .regular. That distinction is the main behavior added here, so future environment-key changes could regress it without CI coverage.

Severity: medium


🤖 Was this useful? React with 👍 or 👎

@github-actions github-actions Bot added area: data-flow State, binding, environment, preference, observation, or property data flow. type: feature New API, behavior, platform support, or user-facing capability. labels Oct 9, 2026
@codecov

codecov Bot commented Oct 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 26.56%. Comparing base (4fa6573) to head (d2b49b8).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...SwiftUICore/Data/EnvironmentKeys/ControlSize.swift 0.00% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1133      +/-   ##
==========================================
- Coverage   30.89%   26.56%   -4.33%     
==========================================
  Files         880      821      -59     
  Lines       71040    61722    -9318     
==========================================
- Hits        21945    16399    -5546     
+ Misses      49095    45323    -3772     

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

@Kyle-Ye
Kyle-Ye merged commit 1a0297c into main Oct 9, 2026
5 of 7 checks passed
@Kyle-Ye
Kyle-Ye deleted the feature/control_size branch October 9, 2026 16:28
@tuist

tuist Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

🛠️ Tuist Run Report 🛠️

Tests 🧪

Scheme Status Ran test modules Commit
OpenSwiftUI ✅ 7 4cdf1589b

Builds 🔨

Scheme Status Duration Commit
OpenSwiftUI ✅ 30.9s 4cdf1589b

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

Labels

area: data-flow State, binding, environment, preference, observation, or property data flow. type: feature New API, behavior, platform support, or user-facing capability.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant