From 0754f2706a79128e87b65867e1d33096d53687fa Mon Sep 17 00:00:00 2001
From: Ariver <shanghai3168@gmail.com>
Date: Fri, 12 Jun 2026 17:19:21 +0800
Subject: [PATCH] Use fixed height horizontal waterfall cards

---
 C1.source/Sources/Aligner/QuickSwitchSessionController.swift |   23 ++++++++++++++++++++++-
 1 files changed, 22 insertions(+), 1 deletions(-)

diff --git a/C1.source/Sources/Aligner/QuickSwitchSessionController.swift b/C1.source/Sources/Aligner/QuickSwitchSessionController.swift
index 51ff663..13457a2 100644
--- a/C1.source/Sources/Aligner/QuickSwitchSessionController.swift
+++ b/C1.source/Sources/Aligner/QuickSwitchSessionController.swift
@@ -19,7 +19,7 @@
     private let windowCloseService: any WindowCloseServiceProtocol
     private let systemCriticalWindowDetector: any SystemCriticalWindowDetecting
     private let disableScreenshotRefresh: Bool
-    private let waterfallViewMode: QuickSwitchWaterfallViewMode
+    private var waterfallViewMode: QuickSwitchWaterfallViewMode
     private var closeConfirmationRequired: Bool
     private let onCloseConfirmationDisabled: (() -> Void)?
     private let debugOverlayWidth: CGFloat?
@@ -86,6 +86,7 @@
     private var lifecycleResidualOverlayWindows = 0
     private var lifecycleResidualVisibleOverlayWindows = 0
     var onSnapshotUpdated: (() -> Void)?
+    var onOpenSettings: (() -> Void)?
 
     private struct PendingCloseVerification {
         let request: QuickSwitchCloseRequest
@@ -212,6 +213,9 @@
         view.onBackgroundClick = { [weak self] in
             self?.handleBackgroundClick() ?? false
         }
+        view.onOpenSettings = { [weak self] in
+            self?.onOpenSettings?()
+        }
         view.setSuppressEventInput(!debugMouseSequence.isEmpty || !debugKeySequence.isEmpty)
         view.onRequestClose = { [weak self] request in
             self?.requestClose(request)
@@ -279,6 +283,23 @@
         show()
     }
 
+    func setWaterfallViewMode(_ mode: QuickSwitchWaterfallViewMode) {
+        guard waterfallViewMode != mode else { return }
+
+        waterfallViewMode = mode
+        DevelopmentDiagnostics.log("quickSwitch.session.waterfallViewModeChanged", [
+            "mode": mode.rawValue,
+            "visible": isVisible,
+            "hasViewModel": currentViewModel != nil
+        ])
+
+        view.setWaterfallViewMode(mode)
+        if isVisible, let currentViewModel {
+            view.applyProjected(viewModel: currentViewModel)
+        }
+        onSnapshotUpdated?()
+    }
+
     func reportDictionary() -> [String: Any] {
         let spaceCount = currentViewModel?.spaceCount ?? 0
         let appCount = currentViewModel?.appShelf.count ?? 0

--
Gitblit v1.9.3