From 0a64c8163445e27f5123fdcf083fb3a5449b5c49 Mon Sep 17 00:00:00 2001
From: Ariver <shanghai3168@gmail.com>
Date: Sat, 20 Jun 2026 03:43:08 +0800
Subject: [PATCH] Fix dark Space hover readability
---
C3.tools/round1-app-shelf-fixture-qa.sh | 62 ++++++++++++++++++++++--------
1 files changed, 45 insertions(+), 17 deletions(-)
diff --git a/C3.tools/round1-app-shelf-fixture-qa.sh b/C3.tools/round1-app-shelf-fixture-qa.sh
index bd4716f..2cb4cdb 100755
--- a/C3.tools/round1-app-shelf-fixture-qa.sh
+++ b/C3.tools/round1-app-shelf-fixture-qa.sh
@@ -104,6 +104,13 @@
print(json.dumps(report, indent=2, ensure_ascii=False), file=sys.stderr)
sys.exit(1)
+def expected_index_text(index):
+ symbols = list("1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ")
+ if index < len(symbols):
+ return symbols[index]
+ overflow = index - len(symbols)
+ return symbols[10 + (overflow // 26) % 26] + symbols[10 + overflow % 26]
+
root = report.get("rootView", {})
items = root.get("appShelfItems", [])
columns = root.get("waterfallColumns", [])
@@ -140,28 +147,35 @@
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 = next(
- (
- color
- for segment in segments
- for color in segment.get("windowBlockColors", [])
- if color.get("alpha", 0) > 0
- ),
- None
-)
-require(blue_reference is not None, "fixture must expose a Space Lane blue reference color")
+legacy_blue_reference = {"red": 135 / 255, "green": 200 / 255, "blue": 1.0, "alpha": 1.0}
hovered_title_color = columns[hover_index].get("appNameColor", {})
-for channel in ("red", "green", "blue"):
- require(
- abs(hovered_title_color.get(channel, -1) - blue_reference.get(channel, -2)) <= 0.002,
- f"hovered column title must use the same blue reference for {channel}"
- )
-require(hovered_title_color.get("alpha", 0) >= 0.98, "hovered column title color must be opaque")
+hovered_header_color = columns[hover_index].get("headerBackgroundColor", {})
+hovered_count_color = columns[hover_index].get("countColor", {})
+
+def is_legacy_blue(color):
+ return all(abs(color.get(channel, -1) - legacy_blue_reference[channel]) <= 0.01 for channel in ("red", "green", "blue"))
+
+hovered_header_channels = [hovered_header_color.get(channel, -1) for channel in ("red", "green", "blue")]
+require(not is_legacy_blue(hovered_header_color), "hovered column header must no longer use the previous blue fill")
+require(max(hovered_header_channels) - min(hovered_header_channels) <= 0.035, "hovered column header must use a neutral gray fill")
+require(0.16 <= hovered_header_color.get("alpha", 0) <= 0.30, "hovered column header gray fill must stay lightweight")
+require(hovered_title_color.get("alpha", 0) >= 0.8, "hovered column title must remain readable")
+require(hovered_count_color.get("alpha", 0) >= 0.45, "hovered column count must remain readable")
+hovered_cards = columns[hover_index].get("cards", [])
+require(hovered_cards, "hovered column must include at least one card")
+require("appLinked" in hovered_cards[0].get("visualStates", []), "hovered App column first card must expose appLinked visual state")
+require(hovered_cards[0].get("closeButtonVisible") is False, "App-linked first card must not show close button unless directly hovered")
+require(hovered_cards[0].get("shadowOpacity", 0) > 0, "App-linked first card must lift with a shadow")
+require(hovered_cards[0].get("titleBarBackgroundColor", {}).get("alpha", 0) > 0.10, "App-linked first card title bar must expose a visible highlight")
+require(all("appLinked" not in card.get("visualStates", []) for card in hovered_cards[1:]), "only the first vertical card in the hovered App column should expose appLinked")
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(not is_legacy_blue(normal_header), "non-hovered column headers must not use the previous blue fill")
+ require(all("appLinked" not in card.get("visualStates", []) for card in column.get("cards", [])), "non-hovered columns must not expose appLinked cards")
normal_items = [
item for item in items
@@ -170,6 +184,14 @@
require(normal_items, "fixture must include normal app items")
require(all(item.get("iconFrame", {}).get("width") == expected_icon_size for item in normal_items), "normal app icons must match expected fixture icon size")
require(all(item.get("labelTruncationMode") == "middle" for item in items), "all App Shelf labels must use middle truncation")
+require(all(item.get("indexVisible") is True for item in items), "all App Shelf items must expose a visible hand-written index marker")
+require(all(item.get("indexText") == expected_index_text(index) for index, item in enumerate(items)), "App Shelf index markers must follow 1234567890ABCDEFG order")
+require(all(item.get("indexFontSize", 0) >= 14 for item in items), "App Shelf index markers must keep readable font size")
+require(all(0.38 <= item.get("indexColor", {}).get("alpha", 0) <= 0.62 for item in items), "App Shelf index markers must stay low-noise but fully readable")
+require(all(item.get("indexOpacity", 0) == 1 for item in items), "App Shelf index markers must avoid double alpha fading")
+require(all(item.get("indexFrame", {}).get("width", 0) >= 16 for item in items), "App Shelf index markers must reserve enough width")
+require(all(item.get("indexFrame", {}).get("height", 0) >= 22 for item in items), "App Shelf index markers must reserve enough height to avoid bottom clipping")
+require(all(item.get("indexFrame", {}).get("x", 99) < item.get("iconFrame", {}).get("x", -99) for item in items), "App Shelf index markers must sit beside the icon, not over the icon center")
row_y_values = {round(item.get("frame", {}).get("y", 0), 2) for item in items}
require(len(row_y_values) == expected_rows, "fixture App Shelf visible rows must match expected rows")
@@ -187,8 +209,13 @@
"selectedIcon": items[0].get("iconFrame"),
"hoveredIndex": root.get("appShelfHoveredIndex"),
"hoveredIcon": items[hover_index].get("iconFrame"),
+ "hoveredColumnHeaderColor": hovered_header_color,
"hoveredColumnTitleColor": hovered_title_color,
- "blueReference": blue_reference,
+ "hoveredColumnCountColor": hovered_count_color,
+ "legacyBlueReference": legacy_blue_reference,
+ "hoveredFirstCardStates": hovered_cards[0].get("visualStates"),
+ "hoveredFirstCardTitleBarColor": hovered_cards[0].get("titleBarBackgroundColor"),
+ "firstIndexes": [item.get("indexText") for item in items[:min(12, len(items))]],
"selectedZ": selected_z,
"hoverZ": hover_z,
"scrollable": root.get("appShelfScrollable"),
@@ -214,6 +241,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