mirror of
https://github.com/wu736139669/hapi.git
synced 2026-11-12 02:28:05 +00:00
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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user