You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Overall this is a small, safe change: the "New Version" button is now gated behind a capability check and gains a test hook. No crashes or logic errors introduced. A few low-severity notes:
[IMPROVEMENT]
Severity: [LOW]
File: AppDetailView.swift (line 123)
Description: The button is fully hidden when canCreateAppStoreVersion is false. Hiding is the right call if the restriction is state-based (e.g., an editable version already exists), but if it's permission-based (user role in App Store Connect), hiding removes discoverability — the user has no way to learn why the action is unavailable, and no else branch explains it.
Suggestion: If this is a permissions gate, consider rendering the button in a disabled state with a .help("...") tooltip or an explanatory label, e.g.:
Button("New Version"){releaseSection.newVersionRequested=true}.buttonStyle(.launchPrimary).controlSize(.small).disabled(!reviewsVM.canCreateAppStoreVersion).help(reviewsVM.canCreateAppStoreVersion?"":"Requires the App Manager or Admin role").accessibilityIdentifier("review.new-version")
[BUG]
Severity: [LOW]
File: AppDetailView.swift (line 123)
Description: If canCreateAppStoreVersion is derived from asynchronously loaded data (roles/permissions fetched from the App Store Connect API), the button will pop into the layout after the view appears (causing a layout shift and potentially intercepting a tap), or — worse, if the default is true before the fetch completes — briefly appear for users who can't actually create a version. This is speculative since the VM isn't in the diff, but worth verifying.
Suggestion: Confirm the flag's initial value is false (fail-closed) and only flips to true after the capability data loads. If load order isn't guaranteed, gate the header controls on a loaded state to avoid flicker.
[BEST PRACTICE]
Severity: [LOW]
File: AppDetailView.swift (line 123)
Description: A release/release-train action ("New Version") is gated by a property living on reviewsVM, which appears to own a different feature (review submissions). This couples the release UI to an unrelated view model; if the release section is ever shown without reviewsVM being populated, the button silently disappears.
Suggestion: Consider exposing the capability from a shared permissions/entitlements object or the release section's own view model, so the gate's lifetime matches the UI it controls.
[SECURITY]
Severity: [LOW]
File: AppDetailView.swift (line 123)
Description: Hiding a button is a UX control, not a security boundary — the flag only stops the UI from setting newVersionRequested.
Suggestion: Ensure the actual version-creation path (the flow triggered by newVersionRequested / the API layer) also validates the capability server-side or before issuing the request, so a stale or bypassed UI state can't trigger creation for unauthorized users.
Positive notes: 👍 Adding accessibilityIdentifier("review.new-version") is great for UI test stability. Longer term, consider centralizing identifiers in a constants enum rather than string literals scattered through views. The conditional-wrapping itself is correct SwiftUI — modifiers are cleanly scoped inside the if block.
No blocking issues — safe to merge after considering the hidden-vs-disabled UX question above.
Automated review by Ollama Cloud. The diff is untrusted input; findings may be inaccurate. If this review seems wrong, please provide feedback.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📋 PR Description
Hide the App Store Versions toolbar action when the selected app is not eligible to create another version.
What changed?
ReviewsViewModel.canCreateAppStoreVersionto conditionally show the toolbar's New Version button.review.new-versionaccessibility identifier to the toolbar action for UI-test targeting.Test Scenarios Covered
Ollama Cloud Review
Pending automated review after PR creation.
Checklist
Verification
plutil -lint "App Store.xcodeproj/project.pbxproj"xcodebuild test -project "App Store.xcodeproj" -scheme "App Store" -destination 'platform=macOS' -only-testing:"App Store Tests/ValidationTests/testVersionCaseStateUsesSpecifiedLivePendingAndIgnoredStates" CODE_SIGNING_ALLOWED=NO -skipMacroValidationxcodebuild -project "App Store.xcodeproj" -scheme "App Store" -sdk macosx -configuration Debug CODE_SIGNING_ALLOWED=NO CODE_SIGN_IDENTITY="" build -skipMacroValidation🤖 Automated Review Notice