Conversation
WalkthroughLowered platform minimum deployment targets in Package.swift across all platforms (iOS, macOS, macCatalyst, tvOS, watchOS by 2–3 versions each). Added availability annotations to public declarations across Actions, AppKit, RadiantKit, and RadiantProgress modules, gating features to macOS 13.0+/iOS 16.0+/watchOS 9.0+/tvOS 16.0+ or macOS 14.0+/iOS 17.0+/watchOS 10.0+/tvOS 17.0+ depending on module. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
Sources/RadiantDocs/AppKit/OpenFilePanel.swift (1)
40-40: Reconsider platform availability for AppKit-specific code.This code is wrapped in
#if canImport(AppKit), which is macOS-only. The availability annotation includes iOS, watchOS, and tvOS versions, which are unnecessary since AppKit is never available on those platforms.Consider simplifying to:
- @available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *) + @available(macOS 13.0, *)The same applies to line 73.
Sources/RadiantProgress/SetupPublishers.swift (1)
47-47: Optional: Fix typo in method name.The method name has a typo:
setupDownloadPublsihersshould besetupDownloadPublishers. While this doesn't affect functionality, correcting it would improve code clarity.Apply this diff to fix the typo:
- private func setupDownloadPublsihers( + private func setupDownloadPublishers( _ downloader: ObservableDownloader ) -> [AnyCancellable] {Also update the call site at line 124:
- cancellables.append(contentsOf: setupDownloadPublsihers(downloader)) + cancellables.append(contentsOf: setupDownloadPublishers(downloader))
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (20)
Package.swift(1 hunks)Sources/RadiantDocs/Actions/OpenFileURLAction.swift(3 hunks)Sources/RadiantDocs/Actions/OpenWindowWithAction.swift(1 hunks)Sources/RadiantDocs/Actions/OpenWindowWithValueAction.swift(1 hunks)Sources/RadiantDocs/AppKit/NewFilePanel.swift(2 hunks)Sources/RadiantDocs/AppKit/OpenAnyFilePanel.swift(2 hunks)Sources/RadiantDocs/AppKit/OpenFilePanel.swift(2 hunks)Sources/RadiantKit/TransformedValueObject.swift(1 hunks)Sources/RadiantKit/ViewExtensions/SingleWindowView.swift(1 hunks)Sources/RadiantKit/Views/GuidedLabeledContent.swift(2 hunks)Sources/RadiantKit/Views/SliderStepperView.swift(1 hunks)Sources/RadiantKit/Views/ValueTextBubble.swift(1 hunks)Sources/RadiantKit/Views/VerticalLabelStyle.swift(1 hunks)Sources/RadiantProgress/CopyOperation.swift(2 hunks)Sources/RadiantProgress/DownloadOperation.swift(1 hunks)Sources/RadiantProgress/FileOperationProgress.swift(1 hunks)Sources/RadiantProgress/ObservableDownloader.swift(1 hunks)Sources/RadiantProgress/ProgressOperationProperties.swift(2 hunks)Sources/RadiantProgress/ProgressOperationView.swift(1 hunks)Sources/RadiantProgress/SetupPublishers.swift(3 hunks)
🧰 Additional context used
🧬 Code graph analysis (12)
Sources/RadiantProgress/DownloadOperation.swift (1)
Sources/RadiantProgress/SetupPublishers.swift (3)
macOS(45-75)macOS(84-103)macOS(112-137)
Sources/RadiantKit/Views/GuidedLabeledContent.swift (1)
Sources/RadiantProgress/SetupPublishers.swift (3)
macOS(45-75)macOS(84-103)macOS(112-137)
Sources/RadiantKit/Views/VerticalLabelStyle.swift (1)
Sources/RadiantProgress/SetupPublishers.swift (3)
macOS(45-75)macOS(84-103)macOS(112-137)
Sources/RadiantProgress/CopyOperation.swift (1)
Sources/RadiantProgress/SetupPublishers.swift (3)
macOS(45-75)macOS(84-103)macOS(112-137)
Sources/RadiantProgress/ProgressOperationView.swift (1)
Sources/RadiantProgress/SetupPublishers.swift (3)
macOS(45-75)macOS(84-103)macOS(112-137)
Sources/RadiantProgress/FileOperationProgress.swift (1)
Sources/RadiantProgress/SetupPublishers.swift (3)
macOS(45-75)macOS(84-103)macOS(112-137)
Sources/RadiantProgress/ProgressOperationProperties.swift (1)
Sources/RadiantProgress/SetupPublishers.swift (3)
macOS(45-75)macOS(84-103)macOS(112-137)
Sources/RadiantDocs/Actions/OpenWindowWithValueAction.swift (1)
Sources/RadiantProgress/SetupPublishers.swift (3)
macOS(45-75)macOS(84-103)macOS(112-137)
Sources/RadiantDocs/Actions/OpenWindowWithAction.swift (1)
Sources/RadiantProgress/SetupPublishers.swift (3)
macOS(45-75)macOS(84-103)macOS(112-137)
Sources/RadiantProgress/ObservableDownloader.swift (1)
Sources/RadiantProgress/SetupPublishers.swift (3)
macOS(45-75)macOS(84-103)macOS(112-137)
Package.swift (1)
Sources/RadiantProgress/SetupPublishers.swift (3)
macOS(45-75)macOS(84-103)macOS(112-137)
Sources/RadiantKit/TransformedValueObject.swift (1)
Sources/RadiantProgress/SetupPublishers.swift (3)
macOS(45-75)macOS(84-103)macOS(112-137)
🔇 Additional comments (19)
Sources/RadiantProgress/FileOperationProgress.swift (1)
35-35: Verify that macOS 14.0+ requirement aligns with PR objectives.This class is gated to macOS 14.0+, but the PR title indicates support for macOS 12, and Package.swift sets the minimum to macOS 12. The
@Observablemacro does require macOS 14.0+, so this availability annotation is technically correct for the implementation.However, consider whether this API should be refactored to support earlier platforms using older patterns (e.g.,
ObservableObjectinstead of@Observable) if macOS 12-13 support is a goal. Otherwise, document that this specific module requires macOS 14.0+ despite the package's broader platform support.Sources/RadiantKit/Views/VerticalLabelStyle.swift (1)
70-70: Availability annotation is correct.The
LabeledContentStyleprotocol was introduced in macOS 13.0/iOS 16.0, so this availability annotation appropriately matches the API requirements.Sources/RadiantKit/Views/SliderStepperView.swift (1)
44-44: Verify the macOS 13.0+ requirement.The availability annotation gates this view to macOS 13.0+, but the package minimum is macOS 12. The code uses
LabeledContent(line 73), which was introduced in macOS 13.0, so this annotation appears correct.However, if macOS 12 support is a primary goal, consider documenting which components are available on macOS 12 vs. 13+ in the package README or API documentation.
Sources/RadiantProgress/DownloadOperation.swift (1)
40-40: macOS 14.0+ requirement limits earlier platform support.Similar to
FileOperationProgress, this class uses the@Observablemacro which requires macOS 14.0+. While technically correct, this means users on macOS 12-13 (which the package now claims to support) cannot use this API.Ensure this is documented and consider whether the RadiantProgress module should have a higher minimum platform version than the base package, or provide alternative implementations for earlier platforms.
Sources/RadiantKit/ViewExtensions/SingleWindowView.swift (1)
65-65: Availability annotation is appropriate.The
WindowGroupinitializer withPresentedWindowContentwas introduced in macOS 13.0/iOS 16.0, so this availability gate correctly reflects the API requirements.Package.swift (1)
33-38: Verify platform version compatibility strategy across the package.The verification confirms your analysis is accurate. The codebase declares package minimums of macOS 12, iOS 15, watchOS 8, and tvOS 15, but publicly available APIs have higher requirements:
- RadiantProgress (FileOperationProgress, DownloadOperation, etc.): macOS 14.0+/iOS 17.0+
- RadiantKit (SliderStepperView, VerticalLabelStyle, GuidedLabeledContent): macOS 13.0+/iOS 16.0+
- RadiantDocs (file panels, actions): macOS 13.0+/iOS 16.0+
Developers targeting the package's declared minimum versions will encounter unavailable APIs. Choose one of your suggested approaches and implement it:
- Document which features require which versions in README/API docs
- Adjust package minimums upward or create separate products with tiered versions
- Provide conditional implementations for earlier platforms where feasible
Sources/RadiantDocs/AppKit/OpenAnyFilePanel.swift (1)
41-99: Availability gate matches OpenWindowAction support.Annotating both the panel and the forwarding extension avoids exposing
OpenWindowActionon macOS 12/iOS 15 builds, so this lines up with the SDK’s actual availability. Nice catch.Also applies to: 82-99
Sources/RadiantDocs/AppKit/NewFilePanel.swift (1)
41-75: Availability matches dependency chain.Bringing both the panel and the helper extension under the macOS 13/iOS 16 umbrella keeps their
OpenWindowActionusage from leaking onto lower deployment targets while still compiling the module for macOS 12 overall. Looks good.Also applies to: 77-89
Sources/RadiantDocs/Actions/OpenWindowWithValueAction.swift (1)
38-70: Correctly gated to the OpenWindowAction introduction.
OpenWindowActiononly exists on macOS 13 / iOS 16+, so tagging the wrapper struct with the same availability keeps consumers honest while letting the package target older OSes. Nicely aligned.Sources/RadiantProgress/CopyOperation.swift (1)
42-181: Observation-based operation correctly restricted.Because
@Observablelives in the Observation framework (macOS 14 / iOS 17+), aligning both the class and its conformance with that floor avoids build issues on the newly-supported lower targets. Looks solid.Sources/RadiantKit/TransformedValueObject.swift (1)
38-123: Availability now mirrors Observation framework requirements.
@Observableforces macOS 14 / iOS 17+, so tagging the class ensures builds for the lower deployment target don’t fail while keeping availability accurate. Good adjustment.Sources/RadiantKit/Views/GuidedLabeledContent.swift (1)
47-99: Gating aligns with LabeledContent availability.Since
LabeledContentshowed up in macOS 13 / iOS 16, this annotation keeps the view and its convenience init from leaking onto unsupported deployments while still letting the package target earlier systems elsewhere. 👍Also applies to: 74-99
Sources/RadiantDocs/Actions/OpenWindowWithAction.swift (1)
39-58: Typealias and helpers gated with their backing API.Tying both the alias and its convenience initialiser to macOS 13 / iOS 16 matches
OpenWindowWithValueAction’s availability and prevents accidental usage on older deployments. Looks consistent.Also applies to: 44-58
Sources/RadiantDocs/Actions/OpenFileURLAction.swift (1)
39-86: Environment plumbing correctly availability-gated.Every piece here (
OpenFileURLKey, the typealiases, and the Scene/View hooks) sits on top ofOpenWindowAction, so fencing them at macOS 13 / iOS 16 keeps the environment value from being emitted on deployments where the underlying action is missing. Nicely synchronized.Sources/RadiantProgress/ProgressOperationView.swift (1)
40-41: LGTM! Availability annotation correctly applied.The availability constraint appropriately gates this SwiftUI view to platforms where the required features are available, while allowing the package to support older deployment targets.
Sources/RadiantProgress/ObservableDownloader.swift (1)
36-39: LGTM! Required availability annotation for @observable macro.The availability constraint is necessary because the
@Observablemacro requires macOS 14.0+ / iOS 17.0+. This correctly gates the class while allowing the package to maintain broader platform support.Sources/RadiantProgress/ProgressOperationProperties.swift (2)
35-36: LGTM! Consistent availability gating.The availability annotation correctly aligns with the ProgressOperationView it supports and maintains consistency across the RadiantProgress module.
69-70: LGTM! Extension availability matches base type.The extension correctly uses the same availability constraint as the
ProgressOperationViewstruct it extends.Sources/RadiantProgress/SetupPublishers.swift (1)
45-49: LGTM! Consistent availability with ObservableDownloader dependency.All three methods correctly apply the same availability constraint as
ObservableDownloader, which they depend on as a parameter type. This ensures proper compilation and usage boundaries.Also applies to: 84-88, 112-116
| public import SwiftUI | ||
|
|
||
| /// A SwiftUI view that displays a value with a formatted text bubble. | ||
| @available(iOS 15.0, *) |
There was a problem hiding this comment.
Incomplete availability annotation—specify all relevant platforms.
The availability annotation only specifies iOS 15.0, but this SwiftUI view should be available across multiple Apple platforms. Other files in this PR use comprehensive platform lists (e.g., macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0).
Apply this diff to specify complete availability:
- @available(iOS 15.0, *)
+ @available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)Note: Adjust the specific version numbers based on which platform APIs this view actually requires (e.g., if it requires FormatStyle features, verify their minimum versions).
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| @available(iOS 15.0, *) | |
| @available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *) |
🤖 Prompt for AI Agents
In Sources/RadiantKit/Views/ValueTextBubble.swift around line 37, the @available
annotation currently lists only iOS 15.0; update it to a full multi-platform
availability annotation matching this PR’s conventions (e.g., macOS 13.0, iOS
16.0, watchOS 9.0, tvOS 16.0) or to the correct minimums for any APIs used;
replace the single-platform annotation with the comprehensive list so the view
is correctly gated across all Apple platforms.
Summary by CodeRabbit
Release Notes