Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Xcodes/Backend/Version+.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
7 changes: 6 additions & 1 deletion Xcodes/Frontend/XcodeList/MainToolbar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,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 {
Expand All @@ -41,6 +42,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")
Expand Down
2 changes: 2 additions & 0 deletions Xcodes/Frontend/XcodeList/XcodeListCategory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ enum XcodeListCategory: String, CaseIterable, Identifiable, CustomStringConverti
case all
case release
case beta
case releasePlusNewBetas

var id: Self { self }

Expand All @@ -12,6 +13,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")
}
}

Expand Down
9 changes: 9 additions & 0 deletions Xcodes/Frontend/XcodeList/XcodeListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,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())
}
}

let latestMajor = xcodes.sorted(\.version)
Expand Down
11 changes: 11 additions & 0 deletions Xcodes/Resources/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -19646,6 +19646,17 @@
}
}
},
"ReleasePlusNewBetas" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Release & New Betas"
}
}
}
},
"Required" : {
"localizations" : {
"ar" : {
Expand Down