field_ios

In-the-field app for Radroots on iOS
git clone https://radroots.dev/git/field_ios.git
Log | Files | Refs | LICENSE

commit 8395046f2ab6a6bfc11d26a3c1ce15a23e07806c
parent c19cfabd6d0209f9a753615a1f191ad6e99726e9
Author: triesap <tyson@radroots.org>
Date:   Thu, 11 Jun 2026 18:55:50 -0700

ui: connect Nostr after identity setup

- activate relay connection startup after generated or imported identities
- expose relay counters and configured URLs as accessibility values
- keep setup completion on the shared app activation path
- support outer XCUITest verification of relay connectivity

Diffstat:
MRadroots/Views/RelaysView.swift | 22++++++++++++++++++++--
MRadroots/Views/SetupView.swift | 4++--
2 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/Radroots/Views/RelaysView.swift b/Radroots/Views/RelaysView.swift @@ -11,12 +11,23 @@ struct RelaysView: View { var body: some View { List { Section("Relays") { - RelayMetricRow(label: "Connected", systemImage: "dot.radiowaves.left.and.right", value: app.relayConnectedCount) - RelayMetricRow(label: "Connecting", systemImage: "antenna.radiowaves.left.and.right", value: app.relayConnectingCount) + RelayMetricRow( + label: "Connected", + systemImage: "dot.radiowaves.left.and.right", + value: app.relayConnectedCount, + accessibilityID: "field_ios.relays.connected_count" + ) + RelayMetricRow( + label: "Connecting", + systemImage: "antenna.radiowaves.left.and.right", + value: app.relayConnectingCount, + accessibilityID: "field_ios.relays.connecting_count" + ) if let last = app.relayLastError { Text(last) .foregroundStyle(.red) .font(.footnote) + .accessibilityIdentifier("field_ios.relays.last_error") } } @@ -28,12 +39,14 @@ struct RelaysView: View { ForEach(configuredRelays, id: \.self) { url in Text(url) .font(.callout.monospaced()) + .accessibilityIdentifier("field_ios.relays.configured_url") } } } } .listStyle(.insetGrouped) .inlineNavigationTitle("Relays") + .accessibilityIdentifier("field_ios.relays") } } @@ -41,6 +54,7 @@ private struct RelayMetricRow: View { let label: String let systemImage: String let value: UInt32 + let accessibilityID: String var body: some View { HStack { @@ -48,5 +62,9 @@ private struct RelayMetricRow: View { Spacer() Text("\(value)") } + .accessibilityElement(children: .ignore) + .accessibilityLabel(label) + .accessibilityValue("\(value)") + .accessibilityIdentifier(accessibilityID) } } diff --git a/Radroots/Views/SetupView.swift b/Radroots/Views/SetupView.swift @@ -48,7 +48,7 @@ struct SetupView: View { Task { @MainActor in do { try keys.generateAndPersist(runtime: rt) - app.refresh() + app.activateAfterKeyGeneration() onSuccess?() } catch { errorMessage = String(describing: error) @@ -71,7 +71,7 @@ struct SetupView: View { throw NSError(domain: "Setup", code: -1, userInfo: [NSLocalizedDescriptionKey: "Clipboard is empty."]) } try keys.importSecretHex(hex: hex, runtime: rt) - app.refresh() + app.activateAfterKeyGeneration() onSuccess?() } catch { errorMessage = String(describing: error)