Files
Harvey_Team_Page/design/glyph-slot-2026-10-14/verify-pen-glyphslot.py
T
FastD e352335822 Filter bar with hover layer, icon-only project links, design reports
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.
2026-10-15 05:50:52 +03:00

120 lines
5.2 KiB
Python

"""Доказательство, что диск-патч §10.28 изменил РОВНО заданные свойства и ничего больше.
Сравнивает пропатченный .pen с бэкапом (patch-pen-glyphslot.py):
- список путей, где значения разошлись, должен совпасть с ожидаемым перечнем;
- число узлов и порядок верхнеуровневых фреймов — без изменений;
- ids уникальны, fileToken тот же, файл парсится.
Запуск: py design/glyph-slot-2026-10-14/verify-pen-glyphslot.py
"""
import json
import re
import sys
from pathlib import Path
ROOT = Path("G:/Project/Haevey_Monster_Team_Page")
FILES = [ROOT / "Harvey_Monster_Team_Page.pen", ROOT / "design" / "Harvey_Monster_Team_Page.pen"]
STAMP = "bak-glyphslot-20261014"
EXPECTED = {
("EByJw", "padding"), ("EByJw", "gap"), ("EByJw", "height"),
("B9oDO", "fontSize"), ("B9oDO", "letterSpacing"),
("z4oNC", "width"), ("z4oNC", "height"),
# переопределения экземпляров: на диске они лежат картой descendants.<id мастера>.<свойство>
("O5Vf0", "descendants.B9oDO.content"),
("C1esB", "padding"), ("C1esB", "height"),
("C1esB", "descendants.B9oDO.content"), ("C1esB", "descendants.B9oDO.fontSize"),
("C1esB", "descendants.B9oDO.letterSpacing"),
("C1esB", "descendants.z4oNC.width"), ("C1esB", "descendants.z4oNC.height"),
("zqgsI", "padding"), ("zqgsI", "height"),
("zqgsI", "descendants.B9oDO.content"), ("zqgsI", "descendants.B9oDO.fontSize"),
("zqgsI", "descendants.B9oDO.letterSpacing"),
("zqgsI", "descendants.z4oNC.width"), ("zqgsI", "descendants.z4oNC.height"),
("APqQ5", "content"), ("c9IKO7", "content"),
}
def walk(node, path=""):
"""Плоский список (id, prop, значение) по всей структуре."""
out = []
if isinstance(node, dict):
nid = node.get("id")
for k, v in node.items():
if k in ("children", "descendants"):
continue
out.append((nid, k, json.dumps(v, ensure_ascii=False, sort_keys=True)))
for cid, cval in (node.get("descendants") or {}).items():
for k, v in (cval or {}).items():
out.append((nid, "descendants." + cid + "." + k, json.dumps(v, ensure_ascii=False, sort_keys=True)))
for c in node.get("children") or []:
out.extend(walk(c, path))
return out
def count_nodes(node):
if isinstance(node, dict):
return 1 + sum(count_nodes(c) for c in node.get("children") or [])
return 0
def find_by_name(node, name):
if isinstance(node, dict):
if node.get("name") == name:
return node
for c in node.get("children") or []:
r = find_by_name(c, name)
if r is not None:
return r
return None
fails = []
for path in FILES:
print("=" * 70)
print(path.name)
bak = Path(str(path) + "." + STAMP)
if not bak.exists():
fails.append(f"{path.name}: backup {bak.name} missing")
continue
raw = path.read_text(encoding="utf-8")
doc = json.loads(raw)
old = json.loads(bak.read_text(encoding="utf-8"))
now = {(i, p): v for i, p, v in walk(doc)}
was = {(i, p): v for i, p, v in walk(old)}
changed = {k for k in set(now) | set(was) if now.get(k) != was.get(k)}
unexpected = {k for k in changed if k not in EXPECTED}
print(f" узлов: {count_nodes(old)} -> {count_nodes(doc)}")
print(f" изменённых свойств: {len(changed)} (ожидалось ≤ {len(EXPECTED)})")
for i, p in sorted(changed):
print(f" {i}.{p}: {was.get((i, p))} -> {now.get((i, p))}")
if count_nodes(old) != count_nodes(doc):
fails.append(f"{path.name}: число узлов изменилось")
if unexpected:
fails.append(f"{path.name}: незапланированные изменения {sorted(unexpected)}")
if not changed:
fails.append(f"{path.name}: патч не применён (изменений нет)")
if doc.get("fileToken") != old.get("fileToken"):
fails.append(f"{path.name}: fileToken изменился")
tops_now = [n.get("name") for n in doc.get("children") or []]
tops_old = [n.get("name") for n in old.get("children") or []]
if tops_now != tops_old:
fails.append(f"{path.name}: верхнеуровневые фреймы изменились")
ids = re.findall(r'"id":\s*"([^"]+)"', raw)
if len(ids) != len(set(ids)):
fails.append(f"{path.name}: дубли id")
if (find_by_name(doc, "Components") or {}).get("children").__len__() != \
(find_by_name(old, "Components") or {}).get("children").__len__():
fails.append(f"{path.name}: Components изменился по составу")
if (find_by_name(doc, "States") or {}).get("children").__len__() != \
(find_by_name(old, "States") or {}).get("children").__len__():
fails.append(f"{path.name}: States изменился по составу")
print("=" * 70)
print("FAILS:", len(fails))
for f in fails:
print(" -", f)
sys.exit(1 if fails else 0)