Files
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

97 lines
3.9 KiB
Python

"""Prove the .pen disk patch is purely ADDITIVE: strip the new nodes from the
patched file and compare the rest byte-for-byte with the backup, then check
line endings and fileToken.
Run: python design/project-links-2026-10-14/verify-pen-patch.py
"""
import json
import sys
from pathlib import Path
ROOT = Path("G:/Project/Haevey_Monster_Team_Page")
TARGETS = [ROOT / "Harvey_Monster_Team_Page.pen", ROOT / "design" / "Harvey_Monster_Team_Page.pen"]
STAMP = "bak-20261014"
NEW = {"EByJw", "z4oNC", "B9oDO", "zPfME", "APqQ5", "OBLsJ", "xv726", "PLyfk", "O5Vf0", "z4XWl",
"NiCYg", "X6kox", "S88VV", "ESknH", "lkOok", "tn69z", "JIqc4", "HZiiG", "P1wTl", "c9IKO7",
"QtK4W", "C1esB", "zqgsI"}
fails = []
def strip(node):
if isinstance(node, dict):
if node.get("id") in NEW:
return None
out = {k: v for k, v in node.items() if k != "children"}
if "children" in node:
kids = [x for x in (strip(c) for c in node["children"]) if x is not None]
out["children"] = kids
return out
if isinstance(node, list):
return [x for x in (strip(c) for c in node) if x is not None]
return node
def count(node):
if isinstance(node, dict):
return 1 + sum(count(c) for c in node.get("children") or [])
return 0
for path in TARGETS:
bak = Path(str(path) + "." + STAMP)
print("=" * 70)
print(path.name, "| backup:", bak.stat().st_size, "-> patched:", path.stat().st_size)
before = json.loads(bak.read_text(encoding="utf-8"))
raw = path.read_text(encoding="utf-8")
after = json.loads(raw)
if before.get("fileToken") != after.get("fileToken"):
fails.append(f"{path.name}: fileToken changed")
grown = count(after) - count(before)
print(f" nodes: {count(before)} -> {count(after)} (+{grown})")
if grown != 23:
fails.append(f"{path.name}: expected +23 nodes, got +{grown}")
if strip(after) == before:
print(" additive check: OK — the rest of the document is untouched")
else:
fails.append(f"{path.name}: structure changed outside the new nodes")
# line endings: the two files legitimately differ (canon CRLF, snapshot minified)
lone_lf = raw.count("\n") - raw.count("\r\n")
print(f" newlines: {raw.count(chr(10))} total, {raw.count(chr(13) + chr(10))} CRLF, {lone_lf} lone LF, "
f"backup lone LF: {bak.read_text(encoding='utf-8').count(chr(10)) - bak.read_text(encoding='utf-8').count(chr(13) + chr(10))}")
b = bak.read_text(encoding="utf-8")
if (b.count("\n") - b.count("\r\n") == 0) != (lone_lf == 0):
fails.append(f"{path.name}: line-ending style changed (backup lone-LF vs patched {lone_lf})")
# the new nodes are complete
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:
return r
return None
master = find(after, "EByJw")
if not master or master.get("reusable") is not True or len(master.get("children") or []) != 2:
fails.append(f"{path.name}: ProjectLink master incomplete")
for nid, kind in (("z4oNC", "icon"), ("B9oDO", "text")):
n = find(after, nid)
if not n or n.get("id") not in {c.get("id") for c in master.get("children") or []}:
fails.append(f"{path.name}: {nid} not a child of the master")
refs = [find(after, nid) for nid in ("xv726", "PLyfk", "O5Vf0", "z4XWl", "ESknH", "lkOok", "tn69z",
"JIqc4", "HZiiG", "C1esB", "zqgsI")]
if any(r is None or r.get("type") != "ref" or r.get("ref") != "EByJw" for r in refs):
fails.append(f"{path.name}: an instance does not point at the master")
print("=" * 70)
print("FAILS:", len(fails))
for f in fails:
print(" -", f)
sys.exit(1 if fails else 0)