Filters: the panel is a bar (status segment, always visible) plus a body that lives as a layer under it - collapsed by default, expands on hover/focus/tap and never moves the case grid; the reset control appears only when a facet is limited; width capped at 720px (measured 45px slack against 477px before). Facet research report is included. Links: project links in the mini card and in the project window are icon-only buttons with a uniform slot (16px card / 18px window) and the accessible name in aria-label; studio contacts (mail, VK, RuStore) live outside the cards. Team and page: real photos from the public TITANS team page go to the member window while the card keeps the mascot; the portfolio gains the First Step Radio card and genre values, the process block became an individual-approach section, plus a cookie bar and a removable ticker. Design folders under design/ keep reports, measurements, scripts and the .pen; probe and before/after screenshot dumps, editor backups and caches are removed. Background-variant and palette previews stay until the client picks one.
138 lines
7.6 KiB
Python
138 lines
7.6 KiB
Python
"""Проверка .pen после персиста знаков: точечность правки и целевые свойства.
|
||
|
||
Доказательства:
|
||
1. оба файла парсятся; формат совпадает с исходным (indent 2 + CRLF для канона, компакт для снимка);
|
||
2. переменная brand-mark = #0077FF;
|
||
3. мастер ProjectLink = квадрат 48×48, подложка MarkPlate ПОД знаком, знак 24×24, подпись выключена;
|
||
4. инстансы: знак площадки — белый символ на синей подложке 24×24 (окно) / 20×20 (карточка, квадрат 36);
|
||
5. подписи строк обновлены и называют источник геометрии;
|
||
6. ТОЧЕЧНОСТЬ: единственная структурная разница с бэкапом — вставленный p40tIo; все остальные узлы
|
||
совпадают с бэкапом, кроме перечисленного списка свойств.
|
||
|
||
Запуск: py design/brand-marks-2026-10-14/verify-pen-marks.py
|
||
"""
|
||
import json
|
||
import os
|
||
import sys
|
||
from pathlib import Path
|
||
|
||
# ⚠️ ИСТОРИЧЕСКАЯ ЗАПИСЬ ВОЛНЫ `t_ecca48e2` (2026-10-14). Скрипт доказывал состояние `.pen` того дня
|
||
# относительно бэкапа `*.bak-brandmarks-20261014` (компакт 36×36 со знаком 20×20 и т.д.). Канон с тех пор
|
||
# переписывался, а волна `t_15835792` (2026-10-15) сняла базовую рамку `ProjectLink`, поэтому на текущем
|
||
# файле скрипт даёт ложные провалы. Действующая проверка `.pen` — `py design/glyph-frame-2026-10-15/verify-pen-frame.py`.
|
||
if os.environ.get("HISTORICAL") != "1":
|
||
print("историческая проверка .pen волны t_ecca48e2 (бэкап bak-brandmarks-20261014, компакт 36×36)")
|
||
print("действующая: py design/glyph-frame-2026-10-15/verify-pen-frame.py")
|
||
print("запуск этой записи как есть: HISTORICAL=1 py design/brand-marks-2026-10-14/verify-pen-marks.py")
|
||
sys.exit(0)
|
||
|
||
ROOT = Path("G:/Project/Haevey_Monster_Team_Page")
|
||
STAMP = "bak-brandmarks-20261014"
|
||
FILES = [(ROOT / "Harvey_Monster_Team_Page.pen", " "),
|
||
(ROOT / "design" / "Harvey_Monster_Team_Page.pen", None)]
|
||
PLATE, MASTER, MARK, LABEL = "p40tIo", "EByJw", "z4oNC", "B9oDO"
|
||
WIN = ["PLyfk", "O5Vf0"]
|
||
CARD = ["C1esB", "zqgsI"]
|
||
CAPS = ["APqQ5", "X6kox", "c9IKO7"]
|
||
|
||
FAILS = []
|
||
|
||
|
||
def find(node, nid):
|
||
if isinstance(node, dict):
|
||
if node.get("id") == nid:
|
||
return node
|
||
for c in node.get("children") or []:
|
||
r = find(c, nid)
|
||
if r is not None:
|
||
return r
|
||
return None
|
||
|
||
|
||
def index(node, acc=None):
|
||
acc = {} if acc is None else acc
|
||
if isinstance(node, dict):
|
||
if node.get("id"):
|
||
acc[node["id"]] = {k: v for k, v in node.items() if k != "children"}
|
||
for c in node.get("children") or []:
|
||
index(c, acc)
|
||
return acc
|
||
|
||
|
||
def check(cond, msg):
|
||
print((" ok " if cond else " FAIL ") + msg)
|
||
if not cond:
|
||
FAILS.append(msg)
|
||
|
||
|
||
for path, indent in FILES:
|
||
print("===", path.as_posix())
|
||
raw = path.read_text(encoding="utf-8")
|
||
doc = json.loads(raw)
|
||
bak = path.with_suffix(".pen." + STAMP)
|
||
|
||
fresh = json.dumps(doc, ensure_ascii=False, indent=indent,
|
||
separators=None if indent else (",", ":"))
|
||
want = (fresh.replace("\n", "\r\n") if indent else fresh).encode("utf-8")
|
||
check(path.read_bytes() == want,
|
||
"формат файла совпадает с исходным по байтам (" + ("indent=2+CRLF" if indent else "компакт") + ")")
|
||
|
||
v = (doc.get("variables") or {}).get("brand-mark")
|
||
check(v == {"type": "color", "value": "#0077FF"}, "переменная brand-mark = #0077FF: " + json.dumps(v))
|
||
|
||
m = find(doc, MASTER)
|
||
check(m.get("width") == 48 and m.get("height") == 48, "мастер ProjectLink — квадрат 48×48")
|
||
check(m.get("padding") == [0, 0] and m.get("gap") == 0, "мастер: padding [0,0], gap 0")
|
||
check(m.get("justifyContent") == "center" and m.get("alignItems") == "center", "мастер: знак по центру")
|
||
kids = m.get("children") or []
|
||
check(kids and kids[0].get("id") == PLATE, "подложка MarkPlate — ПЕРВЫМ ребёнком (под знаком)")
|
||
p = find(doc, PLATE)
|
||
check(p and p.get("type") == "rectangle" and p.get("enabled") is False,
|
||
"подложка — rectangle, по умолчанию выключена")
|
||
check(p and p.get("fill") == "$brand-mark" and p.get("width") == 24 and p.get("height") == 24,
|
||
"подложка мастера: 24×24, заливка $brand-mark")
|
||
check(find(doc, MARK).get("width") == 24 and find(doc, MARK).get("height") == 24, "знак мастера 24×24")
|
||
check(find(doc, LABEL).get("enabled") is False, "подпись мастера выключена (знак без текста)")
|
||
|
||
for iid in WIN:
|
||
d = (find(doc, iid).get("descendants") or {})
|
||
check(d.get(MARK, {}).get("fill") == "#FFFFFF" and d.get(MARK, {}).get("width") == 24,
|
||
iid + ": знак площадки белый 24×24")
|
||
check(d.get(PLATE, {}).get("enabled") is True, iid + ": синяя подложка включена")
|
||
for iid in CARD:
|
||
inst = find(doc, iid)
|
||
d = (inst.get("descendants") or {})
|
||
check(inst.get("width") == 36 and inst.get("height") == 36, iid + ": компакт — квадрат 36×36")
|
||
check(d.get(MARK, {}).get("fill") == "#FFFFFF" and d.get(MARK, {}).get("width") == 20,
|
||
iid + ": знак площадки белый 20×20")
|
||
check(d.get(PLATE, {}).get("enabled") is True and d.get(PLATE, {}).get("width") == 20,
|
||
iid + ": синяя подложка 20×20 включена")
|
||
for cid in CAPS:
|
||
txt = (find(doc, cid) or {}).get("content", "")
|
||
check("ОФИЦИАЛЬНЫЙ" in txt or "знак без подписи" in txt or "КВАДРАТ" in txt.upper(),
|
||
cid + ": подпись обновлена")
|
||
check("src/js/main.js" in (find(doc, "APqQ5") or {}).get("content", ""),
|
||
"APqQ5: подпись называет источник геометрии (src/js/main.js)")
|
||
|
||
# точечность: сравнение с бэкапом по id
|
||
if bak.exists():
|
||
old = index(json.loads(bak.read_text(encoding="utf-8")))
|
||
new = index(doc)
|
||
added = sorted(set(new) - set(old))
|
||
removed = sorted(set(old) - set(new))
|
||
print(" узлов: было", len(old), "стало", len(new), "| добавлено", added, "| удалено", removed)
|
||
check(added == [PLATE] and not removed, "структурно изменён ровно один узел — подложка")
|
||
diff = [i for i in sorted(set(old) & set(new)) if old[i] != new[i]]
|
||
print(" узлы с изменёнными свойствами:", diff)
|
||
expected = {MASTER, MARK, LABEL, "PLyfk", "O5Vf0", "C1esB", "zqgsI", "APqQ5", "X6kox", "c9IKO7"}
|
||
check(set(diff) == expected, "изменены ровно задуманные узлы (" + str(len(diff)) +
|
||
"): " + ("" if set(diff) == expected else str(sorted(set(diff) ^ expected))))
|
||
else:
|
||
check(False, "нет бэкапа для сравнения")
|
||
print()
|
||
|
||
print("Провалено:", len(FAILS))
|
||
for f in FAILS:
|
||
print(" -", f)
|
||
raise SystemExit(1 if FAILS else 0)
|