import AppKit import Foundation import SwiftUI struct SetupFeedbackView: View, SearchableSettingsPane { static let searchControls: [SettingsControl] = { [ SettingsControl( "setups.show-preserved-file", section: .setups, title: SettingsText.string("Show preserved file")) ] }() let failure: String? let recoveryURL: URL? var body: some View { VStack(alignment: .leading, spacing: 8) { if let failure { Label(SettingsText.string("Setups need attention"), systemImage: "exclamationmark.triangle") .font(.headline) Text(failure).textSelection(.enabled) .accessibilityLabel(SettingsText.string("Setup error")) .accessibilityValue(failure) .accessibilityIdentifier("setups.failure") } if let recoveryURL { Text(SettingsText.string("Preserved setup file:")) Text(recoveryURL.path).font(.caption).textSelection(.enabled) .accessibilityLabel(SettingsText.string("Preserved setup file")) .accessibilityValue(recoveryURL.path) .accessibilityIdentifier("setups.recovery") Button(Self.control("setups.show-preserved-file").title) { NSWorkspace.shared.activateFileViewerSelecting([recoveryURL]) } .settingsSearchTarget(Self.control("setups.show-preserved-file")) } } .frame(maxWidth: .infinity, alignment: .leading) } }