fix(ios): refine pairing and session list UX

- Pairing now allows direct entry/scan with inline progress and error feedback
- PairingConfirmView is now deep-link-only for security confirmations
- Session list rows: move thinking spinner and unread indicator to trailing edge
- Extracted shared PairingAttempt state for reuse
- Updated strings: "Continue" → "Pair" button label
- Removed unused PendingPairing.source

Claude-Session: https://claude.ai/code/session_01ViH4oaLSpTcksxDFEMQgeD
This commit is contained in:
weishu
2026-08-27 11:16:53 +08:00
parent 4f407a5b9d
commit bc9df82dc6
7 changed files with 139 additions and 90 deletions
+5 -13
View File
@@ -4,20 +4,13 @@ import HapiProtocol
import Observation
import SwiftUI
/// A pairing that awaits user confirmation — from a deep link, a scanned QR,
/// or manual entry. Drives the confirm sheet.
struct PendingPairing: Identifiable, Hashable {
enum Source: Hashable {
case deepLink
case qrScan
case manual
}
/// A pairing that awaits user confirmation — from a deep link. Drives the
/// confirm sheet.
struct PendingPairing: Identifiable {
let id = UUID()
/// Hub URL as carried by the link/entry (normalized during `pair`).
/// Hub URL as carried by the link (normalized during `pair`).
let hubUrl: String
let accessToken: String
let source: Source
}
/// Root application state: which hubs are paired, which one is active, and
@@ -184,8 +177,7 @@ final class AppModel {
showAddHub = false
pendingPairing = PendingPairing(
hubUrl: link.hubUrl,
accessToken: link.accessToken,
source: .deepLink
accessToken: link.accessToken
)
return true
}