From ae0f48a9d9543d43b120674f0e58164d7cce95ad Mon Sep 17 00:00:00 2001
From: Ariver <shanghai3168@gmail.com>
Date: Sun, 14 Jun 2026 21:06:22 +0800
Subject: [PATCH] Refine Quick Switch UI states

---
 C3.tools/round1-app-shelf-fixture-qa.sh |   41 ++++++++++++++++++++++++++++++++++++++---
 1 files changed, 38 insertions(+), 3 deletions(-)

diff --git a/C3.tools/round1-app-shelf-fixture-qa.sh b/C3.tools/round1-app-shelf-fixture-qa.sh
index 59151e8..e066efc 100755
--- a/C3.tools/round1-app-shelf-fixture-qa.sh
+++ b/C3.tools/round1-app-shelf-fixture-qa.sh
@@ -106,6 +106,8 @@
 
 root = report.get("rootView", {})
 items = root.get("appShelfItems", [])
+columns = root.get("waterfallColumns", [])
+segments = root.get("spaceLaneSegments", [])
 
 require(report.get("snapshotLoaded") is True, "snapshotLoaded must be true")
 require(report.get("appCount") == fixture_app_count, "fixture appCount must match requested count")
@@ -125,14 +127,42 @@
     require(root.get("appShelfContentWidth", 0) <= root.get("appShelfVisibleWidth", 0), "non-scrollable fixture App Shelf content must fit visible width")
     require(root.get("appShelfMaxScrollOffset", 0) == 0, "non-scrollable fixture App Shelf must expose zero max scroll offset")
 require(root.get("appShelfHoveredIndex") == hover_index, "fixture App Shelf must expose requested hovered index")
+require(len(columns) == fixture_app_count, "Waterfall column reports must match fixture count")
 require(sum(1 for item in items if item.get("isSelected") is True) == 1, "App Shelf must expose one selected app")
 require(sum(1 for item in items if item.get("isHovered") is True) == 1, "App Shelf must expose one hovered app")
+require(sum(1 for column in columns if column.get("isHovered") is True) == 1, "Waterfall must expose one hovered column")
 require(items[0].get("isSelected") is True, "fixture first app should be selected")
 require(items[hover_index].get("isHovered") is True, "fixture requested app should be hovered")
-require("selected" in items[0].get("visualStates", []), "selected app must expose selected visual state")
+require(columns[hover_index].get("isHovered") is True, "fixture requested app column should be hovered")
+require("selectedVisualSuppressed" in items[0].get("visualStates", []), "non-hovered selected app must suppress selected visual state")
 require("hover" in items[hover_index].get("visualStates", []), "hovered app must expose hover visual state")
-require(items[0].get("iconFrame", {}).get("width") == 68, "selected app icon must be 68pt")
+require("hover" in columns[hover_index].get("visualStates", []), "hovered column must expose hover visual state")
+require(items[0].get("iconFrame", {}).get("width") == expected_icon_size, "non-hovered selected app icon must match normal fixture icon size")
 require(items[hover_index].get("iconFrame", {}).get("width") == 68, "hovered app icon must be 68pt")
+
+blue_reference = {"red": 135 / 255, "green": 200 / 255, "blue": 1.0, "alpha": 1.0}
+hovered_title_color = columns[hover_index].get("appNameColor", {})
+hovered_header_color = columns[hover_index].get("headerBackgroundColor", {})
+hovered_count_color = columns[hover_index].get("countColor", {})
+for channel in ("red", "green", "blue"):
+    require(
+        abs(hovered_header_color.get(channel, -1) - blue_reference.get(channel, -2)) <= 0.002,
+        f"hovered column header must use #87C8FF for {channel}"
+    )
+require(hovered_header_color.get("alpha", 0) >= 0.98, "hovered column header blue fill must be opaque")
+for color_name, color in (("title", hovered_title_color), ("count", hovered_count_color)):
+    for channel in ("red", "green", "blue", "alpha"):
+        require(abs(color.get(channel, -1) - 1.0) <= 0.002, f"hovered column {color_name} text must be pure white for {channel}")
+for index, column in enumerate(columns):
+    if index == hover_index:
+        continue
+    require(column.get("isHovered") is False, "non-hovered columns must not be marked hovered")
+    require("hover" not in column.get("visualStates", []), "non-hovered columns must not expose hover visual state")
+    normal_header = column.get("headerBackgroundColor", {})
+    require(
+        any(abs(normal_header.get(channel, -1) - blue_reference[channel]) > 0.05 for channel in ("red", "green", "blue")),
+        "non-hovered column headers must not use the hover blue fill"
+    )
 
 normal_items = [
     item for item in items
@@ -148,7 +178,7 @@
 selected_z = items[0].get("zPosition", 0)
 hover_z = items[hover_index].get("zPosition", 0)
 normal_z = normal_items[0].get("zPosition", 0)
-require(selected_z > hover_z, "selected App Shelf item must stay above non-selected hover item")
+require(selected_z == normal_z, "non-hovered selected App Shelf item must not float above normal items")
 require(hover_z > normal_z, "hover App Shelf item must stay above normal items")
 
 print(json.dumps({
@@ -158,6 +188,10 @@
     "selectedIcon": items[0].get("iconFrame"),
     "hoveredIndex": root.get("appShelfHoveredIndex"),
     "hoveredIcon": items[hover_index].get("iconFrame"),
+    "hoveredColumnHeaderColor": hovered_header_color,
+    "hoveredColumnTitleColor": hovered_title_color,
+    "hoveredColumnCountColor": hovered_count_color,
+    "blueReference": blue_reference,
     "selectedZ": selected_z,
     "hoverZ": hover_z,
     "scrollable": root.get("appShelfScrollable"),
@@ -183,6 +217,7 @@
     --round01-open-quick-switch
     --round01-fixture-app-count="$app_count"
     --round01-disable-screenshot-refresh
+    --round01-waterfall-view-mode=vertical
     --round01-debug-hover-app-index="$hover_index"
     --round01-quick-switch-report="$report"
   )

--
Gitblit v1.9.3