Ariver
2026-06-20 a3d82000231b8a8e3709e1a6708dbbdaf81412dc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import Foundation
 
protocol SpaceActivationServiceProtocol: AnyObject {
    func activate(spaceID: UInt64) -> PrivateSpaceFocusOutcome
}
 
final class PrivateSpaceActivationService: SpaceActivationServiceProtocol {
    private let bridge: PrivateSpaceActivationBridge?
 
    init(bridge: PrivateSpaceActivationBridge? = .shared) {
        self.bridge = bridge
    }
 
    func activate(spaceID: UInt64) -> PrivateSpaceFocusOutcome {
        guard let outcome = bridge?.focus(spaceIDs: [spaceID]) else {
            return PrivateSpaceFocusOutcome(
                targetSpaceID: spaceID,
                displayIdentifier: nil,
                previousCurrentSpaceID: nil,
                didRequestFocus: false,
                error: "spaceActivationBridgeUnavailable"
            )
        }
 
        return outcome
    }
}
 
final class DebugSpaceActivationService: SpaceActivationServiceProtocol {
    func activate(spaceID: UInt64) -> PrivateSpaceFocusOutcome {
        PrivateSpaceFocusOutcome(
            targetSpaceID: spaceID,
            displayIdentifier: "debug",
            previousCurrentSpaceID: nil,
            didRequestFocus: true,
            error: nil
        )
    }
}