From 9114595d7575b8d79328f7dc0e3401f65414de63 Mon Sep 17 00:00:00 2001
From: Ariver <shanghai3168@gmail.com>
Date: Fri, 19 Jun 2026 15:52:33 +0800
Subject: [PATCH] Fix keyboard focused card title highlight

---
 C3.tools/round1-keyboard-navigation-fixture-qa.sh         |    6 +++++-
 C3.tools/round1-vertical-keyboard-app-focus-fixture-qa.sh |    5 +++++
 C1.source/Sources/Aligner/QuickSwitchRootView.swift       |   13 ++++++++++---
 C1.source/Resources/Aligner-Info.plist                    |    4 ++--
 4 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/C1.source/Resources/Aligner-Info.plist b/C1.source/Resources/Aligner-Info.plist
index a097353..d116ea3 100644
--- a/C1.source/Resources/Aligner-Info.plist
+++ b/C1.source/Resources/Aligner-Info.plist
@@ -17,9 +17,9 @@
 	<key>CFBundlePackageType</key>
 	<string>APPL</string>
 	<key>CFBundleShortVersionString</key>
-	<string>0.0.73</string>
+	<string>0.0.74</string>
 	<key>CFBundleVersion</key>
-	<string>20260619.1408</string>
+	<string>20260619.1537</string>
 	<key>LSMinimumSystemVersion</key>
 	<string>26.0</string>
 	<key>NSHighResolutionCapable</key>
diff --git a/C1.source/Sources/Aligner/QuickSwitchRootView.swift b/C1.source/Sources/Aligner/QuickSwitchRootView.swift
index f7cbfa2..e7676c3 100644
--- a/C1.source/Sources/Aligner/QuickSwitchRootView.swift
+++ b/C1.source/Sources/Aligner/QuickSwitchRootView.swift
@@ -4524,9 +4524,12 @@
                 transform: nil
             )
             : nil
-        card.titleBarLayer.backgroundColor = appLinked
-            ? spaceLaneOccupiedColor.withAlphaComponent(0.18).cgColor
-            : NSColor.clear.cgColor
+        card.titleBarLayer.backgroundColor = (selected
+            ? spaceLaneOccupiedColor.withAlphaComponent(0.22)
+            : appLinked
+                ? spaceLaneOccupiedColor.withAlphaComponent(0.18)
+                : NSColor.clear
+        ).cgColor
         card.titleBarLayer.borderColor = NSColor.clear.cgColor
         card.titleBarLayer.borderWidth = 0
         card.shineLayer.opacity = selected ? 1 : 0
@@ -5072,6 +5075,10 @@
             return true
         }
 
+        if keyboardFocusedWindowID != nil {
+            return false
+        }
+
         return waterfallColumns
             .first(where: { $0.column.appGroupIndex == card.item.appGroupIndex })?
             .cards
diff --git a/C3.tools/round1-keyboard-navigation-fixture-qa.sh b/C3.tools/round1-keyboard-navigation-fixture-qa.sh
index 380e376..e84db9c 100755
--- a/C3.tools/round1-keyboard-navigation-fixture-qa.sh
+++ b/C3.tools/round1-keyboard-navigation-fixture-qa.sh
@@ -160,7 +160,11 @@
 require("selectedVisualSuppressed" not in selected_cards[0].get("visualStates", []), "keyboard-selected Waterfall card must not suppress selected visual state")
 require(selected_cards[0].get("shineVisible") is True, "keyboard-selected Waterfall card must expose shine")
 require(selected_cards[0].get("zPosition", 0) > 0, "keyboard-selected Waterfall card must float above normal cards")
-require("appLinked" in selected_column.get("cards", [])[0].get("visualStates", []), "App-focused vertical column must keep its first card linked to App hover")
+require(selected_cards[0].get("titleBarBackgroundColor", {}).get("alpha", 0) > 0.10, "keyboard-selected Waterfall card title bar must expose blue fill")
+first_selected_column_card = selected_column.get("cards", [])[0]
+if first_selected_column_card.get("windowID") != expected_selected_window_id:
+    require("appLinked" not in first_selected_column_card.get("visualStates", []), "App-linked first card must yield to keyboard-focused window")
+    require(first_selected_column_card.get("titleBarBackgroundColor", {}).get("alpha", 0) <= 0.01, "first card title bar must clear App hover fill while another window has keyboard focus")
 
 selected_items = [item for item in items if item.get("isSelected") is True]
 require(len(selected_items) == 1, "App Shelf must expose exactly one selected App")
diff --git a/C3.tools/round1-vertical-keyboard-app-focus-fixture-qa.sh b/C3.tools/round1-vertical-keyboard-app-focus-fixture-qa.sh
index c25cc9a..2520ff9 100755
--- a/C3.tools/round1-vertical-keyboard-app-focus-fixture-qa.sh
+++ b/C3.tools/round1-vertical-keyboard-app-focus-fixture-qa.sh
@@ -205,6 +205,11 @@
     require("selected" in selected_card.get("visualStates", []), "keyboard-focused selected card must expose selected visual")
     require("keyboardFocused" in selected_card.get("visualStates", []), "keyboard-focused selected card must expose keyboardFocused state")
     require(selected_card.get("shineVisible") is True, "keyboard-focused selected card must expose shine")
+    require(selected_card.get("titleBarBackgroundColor", {}).get("alpha", 0) > 0.10, "keyboard-focused selected card title bar must expose blue fill")
+    first_selected_column_card = selected_column.get("cards", [])[0]
+    if first_selected_column_card.get("windowID") != selected_card.get("windowID"):
+        require("appLinked" not in first_selected_column_card.get("visualStates", []), "App-linked first card must yield to keyboard-focused window")
+        require(first_selected_column_card.get("titleBarBackgroundColor", {}).get("alpha", 0) <= 0.01, "first card title bar must clear App hover fill while another window has keyboard focus")
     header_frame = selected_column.get("headerFrame", {})
     clip_frame = selected_column.get("cardsClipFrame", {})
     column_frame = selected_column.get("visibleFrame", {})

--
Gitblit v1.9.3