Archived
fix: close Nearlight release blockers
This commit is contained in:
1 parent
5577162594
commit
b7cec80a99
7 files changed
+310
-179
No files matched your search
@@ -1,3 +1,4 @@
|
||||
import AVFoundation
|
||||
import SwiftUI
|
||||
|
||||
/// Owns one session across all tabs. Changing tabs never ends a conversation.
|
||||
@@ -7,7 +8,6 @@ struct ConversationView: View {
|
||||
@State private var activeServerURL: String
|
||||
@State private var pendingServerURL: String?
|
||||
@State private var isReplacingSession = false
|
||||
@State private var sessionID = UUID()
|
||||
@State private var selectedTab = 0
|
||||
|
||||
init(settings: SettingsStore) {
|
||||
@@ -28,6 +28,15 @@ struct ConversationView: View {
|
||||
session.transcriptHandler.receiveDataTranscript(role: .agent, text: "Let’s leave some room to breathe. A walk, a good book, and time for your favorite music would be a lovely start.")
|
||||
session.taskStore.injectSampleEvents()
|
||||
}
|
||||
if ProcessInfo.processInfo.arguments.contains("--ui-long-transcript") {
|
||||
for index in 1...30 {
|
||||
let role: TranscriptEvent.Role = index.isMultiple(of: 2) ? .agent : .user
|
||||
session.transcriptHandler.receiveDataTranscript(
|
||||
role: role,
|
||||
text: "Earlier message \(index): a deliberately long restored transcript row for reading-position verification."
|
||||
)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return session
|
||||
}
|
||||
@@ -44,7 +53,6 @@ struct ConversationView: View {
|
||||
ActivityTab(taskStore: session.taskStore, settings: settings, session: session)
|
||||
.tag(1)
|
||||
}
|
||||
.id(sessionID)
|
||||
.tint(Nearlight.rosewood)
|
||||
.onChange(of: settings.textMode) { _, enabled in
|
||||
Task { await session.applyTextMode(enabled) }
|
||||
@@ -77,7 +85,6 @@ struct ConversationView: View {
|
||||
await session.disconnect()
|
||||
activeServerURL = next
|
||||
session = Self.makeSession(next, settings: settings)
|
||||
sessionID = UUID()
|
||||
}
|
||||
isReplacingSession = false
|
||||
}
|
||||
@@ -290,10 +297,11 @@ private struct ConversationContent: View {
|
||||
}
|
||||
|
||||
private var micDenied: Bool {
|
||||
// Only the explicit permission-denied wording from enableMicrophone
|
||||
// counts; other mic errors keep their real message without a
|
||||
// Settings deep link.
|
||||
session.state == .ready && (session.micError?.lowercased().contains("denied") ?? false)
|
||||
guard session.state == .ready, let micError = session.micError else {
|
||||
return false
|
||||
}
|
||||
return AVAudioApplication.shared.recordPermission == .denied
|
||||
|| micError.localizedCaseInsensitiveContains("denied")
|
||||
}
|
||||
|
||||
private var failureTitle: String {
|
||||
@@ -543,7 +551,7 @@ private struct ConversationContent: View {
|
||||
if case .failed(let message) = session.state { return message }
|
||||
return nil
|
||||
}
|
||||
private var failureNotice: String? { failureMessage }
|
||||
private var failureNotice: String? { session.micError ?? failureMessage }
|
||||
|
||||
private var statusTitle: String {
|
||||
switch session.state {
|
||||
|
||||
Reference in new issue
Block a user