| | |
| | | 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} |
| | | legacy_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}") |
| | | |
| | | 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( |
| | | 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" |
| | | ) |
| | | 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 |
| | |
| | | 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) >= 13 for item in items), "App Shelf index markers must keep readable font size") |
| | | require(all(0 < item.get("indexColor", {}).get("alpha", 0) <= 0.5 for item in items), "App Shelf index markers must stay low-noise with light alpha") |
| | | require(all(item.get("indexFrame", {}).get("width", 0) >= 14 for item in items), "App Shelf index markers must reserve enough width") |
| | | 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} |
| | |
| | | "hoveredColumnHeaderColor": hovered_header_color, |
| | | "hoveredColumnTitleColor": hovered_title_color, |
| | | "hoveredColumnCountColor": hovered_count_color, |
| | | "blueReference": blue_reference, |
| | | "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, |