Add identical builds to the info pane

This commit is contained in:
Brandon Evans 2021-02-04 20:30:52 -07:00
parent 760c9f300e
commit 70ca8c37bf
No known key found for this signature in database
GPG key ID: D58A4B8DB64F8E93

View file

@ -53,6 +53,7 @@ struct InfoPane: View {
Divider()
releaseNotes(for: xcode)
identicalBuilds(for: xcode)
compatibility(for: xcode)
sdks(for: xcode)
compilers(for: xcode)
@ -80,6 +81,34 @@ struct InfoPane: View {
}
}
@ViewBuilder
private func identicalBuilds(for xcode: Xcode) -> some View {
if !xcode.identicalBuilds.isEmpty {
VStack(alignment: .leading) {
HStack {
Text("Identical Builds")
Image(systemName: "square.fill.on.square.fill")
.foregroundColor(.secondary)
.accessibility(hidden: true)
.help("Sometimes a prerelease and release version are the exact same build. Xcodes will automatically display these versions together.")
}
.font(.headline)
ForEach(xcode.identicalBuilds, id: \.description) { version in
Text("\(version.appleDescription)")
.font(.subheadline)
}
}
.frame(maxWidth: .infinity, alignment: .leading)
.accessibilityElement()
.accessibility(label: Text("Identical Builds"))
.accessibility(value: Text(xcode.identicalBuilds.map(\.appleDescription).joined(separator: ", ")))
.accessibility(hint: Text("Sometimes a prerelease and release version are the exact same build. Xcodes will automatically display these versions together."))
} else {
EmptyView()
}
}
@ViewBuilder
private func releaseNotes(for xcode: Xcode) -> some View {
if let releaseNotesURL = xcode.releaseNotesURL {