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/QuickSwitchSnapshotLoader.swift |  137 +++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 137 insertions(+), 0 deletions(-)

diff --git a/C1.source/Sources/Aligner/QuickSwitchSnapshotLoader.swift b/C1.source/Sources/Aligner/QuickSwitchSnapshotLoader.swift
index ea38b1a..121e38f 100644
--- a/C1.source/Sources/Aligner/QuickSwitchSnapshotLoader.swift
+++ b/C1.source/Sources/Aligner/QuickSwitchSnapshotLoader.swift
@@ -1,3 +1,4 @@
+import CoreGraphics
 import Foundation
 import AlignerCore
 
@@ -15,6 +16,8 @@
     case candidateFiltering
     case activation
     case spaceFilter
+    case splitView
+    case multiPageIdentity
 }
 
 final class LiveQuickSwitchSnapshotLoader: QuickSwitchSnapshotLoading {
@@ -86,6 +89,12 @@
         }
         if mode == .spaceFilter {
             return spaceFilterSnapshot()
+        }
+        if mode == .splitView {
+            return splitViewSnapshot()
+        }
+        if mode == .multiPageIdentity {
+            return multiPageIdentitySnapshot()
         }
 
         return layoutSnapshot()
@@ -494,4 +503,132 @@
             currentSpaceIDs: [1, 4]
         )
     }
+
+    private func splitViewSnapshot() -> QuickSwitchSnapshotLoad {
+        let displayUUID = "fixture-display-a"
+        let displays = [
+            AlignerDisplay(
+                uuid: displayUUID,
+                physical: true,
+                spaces: [
+                    AlignerSpace(id: 1, type: .user, displayUUID: displayUUID, index: 1),
+                    AlignerSpace(id: 2, type: .fullscreen, displayUUID: displayUUID, index: 2),
+                    AlignerSpace(id: 3, type: .fullscreen, displayUUID: displayUUID, index: 3)
+                ]
+            )
+        ]
+
+        let normalApp = AlignerApp(
+            bundleIdentifier: "com.example.split.normal",
+            name: "普通窗口",
+            category: .generic,
+            processIdentifier: 60_001
+        )
+        let leftApp = AlignerApp(
+            bundleIdentifier: "com.example.split.left",
+            name: "左侧应用",
+            category: .finder,
+            processIdentifier: 60_002
+        )
+        let rightApp = AlignerApp(
+            bundleIdentifier: "com.example.split.right",
+            name: "右侧应用",
+            category: .documentNotes,
+            processIdentifier: 60_003
+        )
+        let singleFullscreenApp = AlignerApp(
+            bundleIdentifier: "com.example.split.single",
+            name: "单全屏",
+            category: .generic,
+            processIdentifier: 60_004
+        )
+
+        let windows = [
+            AlignerWindow(
+                id: 60_101,
+                app: normalApp,
+                title: "普通窗口",
+                frame: CGRect(x: 80, y: 120, width: 900, height: 620),
+                spaceIDs: [1]
+            ),
+            AlignerWindow(
+                id: 60_202,
+                app: rightApp,
+                title: "右侧 Split View",
+                isFullscreen: true,
+                frame: CGRect(x: 960, y: 0, width: 960, height: 1080),
+                spaceIDs: [2]
+            ),
+            AlignerWindow(
+                id: 60_201,
+                app: leftApp,
+                title: "左侧 Split View",
+                isFullscreen: true,
+                frame: CGRect(x: 0, y: 0, width: 960, height: 1080),
+                spaceIDs: [2]
+            ),
+            AlignerWindow(
+                id: 60_301,
+                app: singleFullscreenApp,
+                title: "单全屏",
+                isFullscreen: true,
+                frame: CGRect(x: 0, y: 0, width: 1920, height: 1080),
+                spaceIDs: [3]
+            )
+        ]
+
+        return QuickSwitchSnapshotLoad(
+            snapshot: QuickSwitchSnapshotBuilder.snapshot(displays: displays, windows: windows),
+            currentSpaceIDs: [1]
+        )
+    }
+
+    private func multiPageIdentitySnapshot() -> QuickSwitchSnapshotLoad {
+        let displayUUID = "fixture-display-a"
+        let displays = [
+            AlignerDisplay(
+                uuid: displayUUID,
+                physical: true,
+                spaces: [
+                    AlignerSpace(id: 1, type: .user, displayUUID: displayUUID, index: 1)
+                ]
+            )
+        ]
+
+        let app = AlignerApp(
+            bundleIdentifier: "com.example.multipage.identity",
+            name: "Multi Page App",
+            category: .generic,
+            processIdentifier: 70_001
+        )
+
+        let windows = [
+            AlignerWindow(
+                id: 70_101,
+                app: app,
+                title: "Shared Page",
+                frame: CGRect(x: 120, y: 120, width: 920, height: 640),
+                spaceIDs: [1]
+            ),
+            AlignerWindow(
+                id: 70_102,
+                app: app,
+                title: "Shared Page",
+                frame: CGRect(x: 160, y: 140, width: 920, height: 640),
+                spaceIDs: [1]
+            ),
+            AlignerWindow(
+                id: 70_103,
+                app: app,
+                title: "Shared Page",
+                frame: CGRect(x: 200, y: 160, width: 920, height: 640),
+                spaceIDs: [1]
+            )
+        ]
+
+        return QuickSwitchSnapshotLoad(
+            snapshot: QuickSwitchSnapshotBuilder.snapshot(displays: displays, windows: windows),
+            currentSpaceIDs: [1]
+        )
+    }
 }

--
Gitblit v1.9.3