From 70ca8c37bfacd22456e986068e253e82af51c3a4 Mon Sep 17 00:00:00 2001 From: Brandon Evans Date: Thu, 4 Feb 2021 20:30:52 -0700 Subject: [PATCH] Add identical builds to the info pane --- Xcodes/Frontend/XcodeList/InfoPane.swift | 29 ++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/Xcodes/Frontend/XcodeList/InfoPane.swift b/Xcodes/Frontend/XcodeList/InfoPane.swift index 382138b..4cbabf6 100644 --- a/Xcodes/Frontend/XcodeList/InfoPane.swift +++ b/Xcodes/Frontend/XcodeList/InfoPane.swift @@ -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 {