fix(ios): fix quick setup sheet layout design (#93751)

* fix(ios): simplify quick setup sheet layout

* fix(ios): restore quick setup card chrome
This commit is contained in:
Sash Zats
2026-06-16 16:45:24 -04:00
committed by GitHub
parent 2a6c0ab5bf
commit c5b79e3b7a

View File

@@ -30,27 +30,13 @@ struct GatewayQuickSetupSheet: View {
}
if let candidate = self.bestCandidate {
VStack(alignment: .leading, spacing: 6) {
Text(verbatim: candidate.name)
.font(.headline)
Text(verbatim: candidate.debugID)
.font(.footnote)
.foregroundStyle(.secondary)
VStack(alignment: .leading, spacing: 2) {
// Use verbatim strings so Bonjour-provided values can't be interpreted as
// localized format strings (which can crash with Objective-C exceptions).
Text(verbatim: "Discovery: \(self.gatewayController.discoveryStatusText)")
Text(verbatim: "Status: \(self.appModel.gatewayDisplayStatusText)")
Text(verbatim: "Node: \(self.appModel.nodeStatusText)")
Text(verbatim: "Operator: \(self.appModel.operatorStatusText)")
}
.font(.footnote)
.foregroundStyle(.secondary)
}
.padding(12)
.background(.thinMaterial)
.clipShape(RoundedRectangle(cornerRadius: 14))
GatewayQuickSetupCandidatePanel(
name: candidate.name,
debugID: candidate.debugID,
discoveryStatusText: self.gatewayController.discoveryStatusText,
gatewayDisplayStatusText: self.appModel.gatewayDisplayStatusText,
nodeStatusText: self.appModel.nodeStatusText,
operatorStatusText: self.appModel.operatorStatusText)
Button {
self.connectError = nil
@@ -169,3 +155,43 @@ struct GatewayQuickSetupSheet: View {
self.connectError = err
}
}
private struct GatewayQuickSetupCandidatePanel: View {
private static let readableMonospaceWidth: CGFloat = 72 * 8
let name: String
let debugID: String
let discoveryStatusText: String
let gatewayDisplayStatusText: String
let nodeStatusText: String
let operatorStatusText: String
var body: some View {
VStack(alignment: .leading, spacing: 6) {
Text(verbatim: self.name)
.font(.system(.headline, design: .monospaced))
.foregroundStyle(.primary)
Text(verbatim: self.debugID)
.font(.system(.footnote, design: .monospaced))
.foregroundStyle(.secondary)
VStack(alignment: .leading, spacing: 2) {
// Use verbatim strings so Bonjour-provided values can't be interpreted as
// localized format strings (which can crash with Objective-C exceptions).
Text(verbatim: "Discovery: \(self.discoveryStatusText)")
Text(verbatim: "Status: \(self.gatewayDisplayStatusText)")
Text(verbatim: "Node: \(self.nodeStatusText)")
Text(verbatim: "Operator: \(self.operatorStatusText)")
}
.font(.system(.footnote, design: .monospaced))
.foregroundStyle(.secondary)
}
.frame(maxWidth: Self.readableMonospaceWidth, alignment: .leading)
.padding(.vertical, 14)
.padding(.horizontal, 16)
.frame(maxWidth: .infinity, alignment: .leading)
.textSelection(.enabled)
.background(.thinMaterial)
.clipShape(RoundedRectangle(cornerRadius: 14))
}
}