This commit is contained in:
Jayson Rhynas 2025-08-27 09:45:53 -04:00 committed by GitHub
commit 4ba901799d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 33 additions and 1 deletions

View file

@ -31,4 +31,9 @@ public extension Version {
var isPrerelease: Bool { prereleaseIdentifiers.isEmpty == false }
var isNotPrerelease: Bool { prereleaseIdentifiers.isEmpty == true }
/// Returns a new Version instance without any `prereleaseIdentifiers` or `buildMetadataIdentifiers`
func withoutIdentifiers() -> Version {
Version(major, minor, patch)
}
}

View file

@ -46,7 +46,8 @@ struct MainToolbarModifier: ViewModifier {
switch category {
case .all: category = .release
case .release: category = .beta
case .beta: category = .all
case .beta: category = .releasePlusNewBetas
case .releasePlusNewBetas: category = .all
}
}) {
switch category {
@ -60,6 +61,10 @@ struct MainToolbarModifier: ViewModifier {
Label("BetaOnly", systemImage: "line.horizontal.3.decrease.circle.fill")
.labelStyle(.trailingIcon)
.foregroundColor(.accentColor)
case .releasePlusNewBetas:
Label("ReleasePlusNewBetas", systemImage: "line.horizontal.3.decrease.circle.fill")
.labelStyle(.trailingIcon)
.foregroundColor(.accentColor)
}
}
.help("FilterAvailableDescription")

View file

@ -5,6 +5,7 @@ enum XcodeListCategory: String, CaseIterable, Identifiable, CustomStringConverti
case all
case release
case beta
case releasePlusNewBetas
var id: Self { self }
@ -13,6 +14,7 @@ enum XcodeListCategory: String, CaseIterable, Identifiable, CustomStringConverti
case .all: return localizeString("All")
case .release: return localizeString("Release")
case .beta: return localizeString("Beta")
case .releasePlusNewBetas: return localizeString("ReleasePlusNewBetas")
}
}

View file

@ -28,6 +28,15 @@ struct XcodeListView: View {
xcodes = appState.allXcodes.filter { $0.version.isNotPrerelease }
case .beta:
xcodes = appState.allXcodes.filter { $0.version.isPrerelease }
case .releasePlusNewBetas:
let releases = Set(
appState.allXcodes
.filter(\.version.isNotPrerelease)
.map { $0.version.withoutIdentifiers() }
)
xcodes = appState.allXcodes.filter {
$0.version.isNotPrerelease || !releases.contains($0.version.withoutIdentifiers())
}
}
if architecture == .appleSilicon {

View file

@ -20131,6 +20131,17 @@
}
}
},
"ReleasePlusNewBetas" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Release & New Betas"
}
}
}
},
"Required" : {
"localizations" : {
"ar" : {