Ariver
2026-06-18 1fcf6730652d509e78de4b80888772083f5b124a
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import Foundation
import AlignerCore
 
enum QuickSwitchCloseRequest {
    case app(QuickSwitchAppShelfItemViewModel)
    case window(QuickSwitchWindowCardViewModel)
 
    var kindDescription: String {
        switch self {
        case .app:
            return "app"
        case .window:
            return "window"
        }
    }
 
    var appGroupIndex: Int {
        switch self {
        case .app(let item):
            return item.appGroupIndex
        case .window(let card):
            return card.appGroupIndex
        }
    }
 
    var windowID: UInt32? {
        switch self {
        case .app:
            return nil
        case .window(let card):
            return card.window.id
        }
    }
 
    var appName: String {
        switch self {
        case .app(let item):
            return item.app.name
        case .window(let card):
            return card.window.app.name
        }
    }
 
    var title: String {
        switch self {
        case .app(let item):
            return item.app.name
        case .window(let card):
            let trimmedTitle = card.window.title.trimmingCharacters(in: .whitespacesAndNewlines)
            return trimmedTitle.isEmpty ? "Untitled Window" : trimmedTitle
        }
    }
 
    var app: AlignerApp {
        switch self {
        case .app(let item):
            return item.app
        case .window(let card):
            return card.window.app
        }
    }
 
    var window: AlignerWindow? {
        switch self {
        case .app:
            return nil
        case .window(let card):
            return card.window
        }
    }
}