Sessions Integration Feature

Nucleic-Session: FC94353F-9F0D-4BCC-AD7C-0FB14E38C2E5
Co-authored-by: Nucleic <[email protected]>
This commit is contained in:
2026-07-05 01:55:02 -07:00
co-authored by Nucleic
parent 36e6725434
commit e156ea2e59
@@ -787,16 +787,25 @@ final class RemoteStore: ObservableObject {
send(.unsubscribe(target)) send(.unsubscribe(target))
markOpened(target) // everything up to now has been seen markOpened(target) // everything up to now has been seen
guard openSessionID == target else { return } guard openSessionID == target else { return }
activeConnection?.openSessionID = nil connection(owningSession: target)?.openSessionID = nil
openSessionID = nil openSessionID = nil
openSessionHostID = nil
openEvents = [] openEvents = []
openApprovals = [] openApprovals = []
openDiff = nil openDiff = nil
diffLoading = false diffLoading = false
// Context reverts to the aggregate now that no transcript is open.
if !demoMode { rebuildAggregate() }
} }
func respond(_ approval: ApprovalRequest, _ decision: Decision) { func respond(_ approval: ApprovalRequest, _ decision: Decision) {
send(.approvalRespond(approval.id, decision)) // Route to the Mac that owns the approval's session (the approval message carries no
// sessionID of its own). Demo resolves locally.
if demoMode {
demoHandle(.approvalRespond(approval.id, decision))
} else {
connection(owningSession: approval.sessionID)?.send(.approvalRespond(approval.id, decision))
}
openApprovals.removeAll { $0.id == approval.id } // optimistic dismiss; host confirms openApprovals.removeAll { $0.id == approval.id } // optimistic dismiss; host confirms
} }