From 4e9fef02a574f16bb6fe3f7cef4f967e009d2a5d Mon Sep 17 00:00:00 2001
From: Ariver <shanghai3168@gmail.com>
Date: Thu, 18 Jun 2026 20:48:55 +0800
Subject: [PATCH] Add App Shelf index markers

---
 C1.source/Sources/Aligner/QuickSwitchSessionController.swift |   28 ++++++++++++++++++++++++----
 1 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/C1.source/Sources/Aligner/QuickSwitchSessionController.swift b/C1.source/Sources/Aligner/QuickSwitchSessionController.swift
index 7fa4f39..18d84f0 100644
--- a/C1.source/Sources/Aligner/QuickSwitchSessionController.swift
+++ b/C1.source/Sources/Aligner/QuickSwitchSessionController.swift
@@ -86,7 +86,7 @@
     private var lifecycleResidualOverlayWindows = 0
     private var lifecycleResidualVisibleOverlayWindows = 0
     var onSnapshotUpdated: (() -> Void)?
-    var onOpenSettings: (() -> Void)?
+    var onToggleWaterfallViewMode: (() -> Void)?
 
     private struct PendingCloseVerification {
         let request: QuickSwitchCloseRequest
@@ -213,8 +213,8 @@
         view.onBackgroundClick = { [weak self] in
             self?.handleBackgroundClick() ?? false
         }
-        view.onOpenSettings = { [weak self] in
-            self?.onOpenSettings?()
+        view.onToggleWaterfallViewMode = { [weak self] in
+            self?.onToggleWaterfallViewMode?()
         }
         view.setSuppressEventInput(!debugMouseSequence.isEmpty || !debugKeySequence.isEmpty)
         view.onRequestClose = { [weak self] request in
@@ -280,7 +280,27 @@
 
     func retriggerFromShortcut() {
         DevelopmentDiagnostics.log("quickSwitch.session.retriggerFromShortcut")
-        show()
+        guard isVisible else {
+            show()
+            return
+        }
+
+        guard currentViewModel != nil else {
+            DevelopmentDiagnostics.log("quickSwitch.session.retriggerFromShortcut.noSnapshot", [
+                "action": "fallbackShow"
+            ])
+            show()
+            return
+        }
+
+        let didCycle = view.hoverNextAppGroupIndex()
+        DevelopmentDiagnostics.log("quickSwitch.session.retriggerFromShortcut.hoverApp", [
+            "didCycle": didCycle
+        ])
+
+        if !didCycle {
+            show()
+        }
     }
 
     func setWaterfallViewMode(_ mode: QuickSwitchWaterfallViewMode) {

--
Gitblit v1.9.3