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.
117 lines
7.5 KiB
Python
117 lines
7.5 KiB
Python
"""Диск-патч волны `t_15835792` (2026-10-15): у ссылок-иконок нет базовой рамки.
|
||
|
||
Что делает (точечно, текстовыми заменами внутри блоков узлов — формат файлов сохраняется):
|
||
канон `Harvey_Monster_Team_Page.pen`
|
||
1. `EByJw` ProjectLink — снят `strokeWidth: 2` (база компонента без рамки; цвет `stroke` остаётся
|
||
инертным: MCP `Update` не умеет удалять свойство, `null` отклоняется схемой);
|
||
2. `z4XWl` PL_primary — явный `strokeWidth: 2` (рамку и заливку несёт только зелёный CTA);
|
||
3. `JIqc4` PL_focus — `strokeWidth: 4` → `2` + явный `stroke: $brand-deep` (иначе снятие базовой
|
||
рамки обесцветило бы контур фокуса; приведено к продным 2 px `--brand-deep`);
|
||
4. `APqQ5` Cap_ССЫЛКА ПРОЕКТА — подпись дополнена правилом «рамки нет ни у знаков площадок,
|
||
ни у штриховых глифов» (подпись описывает ту же анатомию).
|
||
снимок `design/Harvey_Monster_Team_Page.pen` (compact-однострочник)
|
||
5. `xv726` PL_site — сняты `stroke: $brand-deep` и `strokeWidth: 2` (рамка штрихового глифа темы);
|
||
6. `APqQ5` — та же подпись, что в каноне.
|
||
|
||
Запуск: py design/glyph-frame-2026-10-15/patch-pen-frame.py
|
||
Идемпотентности нет: скрипт ждёт исходное состояние и падает, если замена не нашлась ровно один раз.
|
||
Проверка результата — `verify-pen-frame.py`. Бэкапы — `*.pen.bak-glyphframe-20261015`.
|
||
"""
|
||
import json
|
||
import re
|
||
import sys
|
||
from pathlib import Path
|
||
|
||
ROOT = Path(__file__).resolve().parents[2]
|
||
CANON = ROOT / "Harvey_Monster_Team_Page.pen"
|
||
SNAPSHOT = ROOT / "design" / "Harvey_Monster_Team_Page.pen"
|
||
|
||
NEW_CAP = (
|
||
"ССЫЛКА ПРОЕКТА — ЗНАК БЕЗ ТЕКСТА: 48×48, знак 24×24 (12 ед., 50 % слота). "
|
||
"RuStore и VK — ОФИЦИАЛЬНЫЙ знак площадки (синий квадрат #0077FF + белый символ; геометрия — "
|
||
"src/js/main.js, в .pen символ — подстановка lucide, D15). Сайт — глобус, видео — камера "
|
||
"(штриховые глифы, тот же слот 24×24 и та же мера 12 ед.). РАМКИ НЕТ ни у знаков площадок, "
|
||
"ни у штриховых глифов — знаком служит сама кнопка; рамку и заливку несёт только зелёный CTA "
|
||
"(btn--primary)"
|
||
)
|
||
OLD_CAP_CANON = (
|
||
"ССЫЛКА ПРОЕКТА — ЗНАК БЕЗ ТЕКСТА: 48×48, знак 24×24. RuStore и VK — ОФИЦИАЛЬНЫЙ знак площадки "
|
||
"(синий квадрат #0077FF + белый символ; геометрия — src/js/main.js, в .pen символ — подстановка "
|
||
"lucide, D15). Сайт — глобус, видео — камера (штриховые)"
|
||
)
|
||
OLD_CAP_SNAPSHOT = (
|
||
"ССЫЛКА ПРОЕКТА — ЗНАК БЕЗ ТЕКСТА: квадрат 48×48, знак 24×24 (12 ед., 50 % слота), РАМКИ НЕТ — "
|
||
"знаком служит сама кнопка. RuStore и VK — ОФИЦИАЛЬНЫЙ знак площадки (синий квадрат #0077FF + "
|
||
"белый символ; геометрия — src/js/main.js, в .pen символ — подстановка lucide, D15). Сайт — "
|
||
"глобус, видео — камера: штриховые глифы в слоте 24×24, РАМКУ СОХРАНЯЮТ (она их и предъявляет)"
|
||
)
|
||
|
||
|
||
def node_block(text, node_id, quoted=True):
|
||
"""Текст объекта узла целиком (баланс скобок) — чтобы правки не задели соседей."""
|
||
anchor = '"id": "%s"' % node_id if quoted else '"id":"%s"' % node_id
|
||
assert text.count(anchor) == 1, "якорь %s встречается %d раз" % (node_id, text.count(anchor))
|
||
i = text.index(anchor)
|
||
start = text.rindex("{", 0, i)
|
||
depth, j = 0, start
|
||
while True:
|
||
if text[j] == "{":
|
||
depth += 1
|
||
elif text[j] == "}":
|
||
depth -= 1
|
||
if depth == 0:
|
||
break
|
||
j += 1
|
||
return start, j + 1, text[start:j + 1]
|
||
|
||
|
||
def splice(text, node_id, old, new, quoted=True):
|
||
"""Заменить `old` на `new` внутри блока узла; ровно одно вхождение внутри и одно снаружи-итого."""
|
||
start, end, block = node_block(text, node_id, quoted)
|
||
assert block.count(old) == 1, "%s: подстрока для замены встречается %d раз" % (node_id, block.count(old))
|
||
return text[:start] + block.replace(old, new) + text[end:]
|
||
|
||
|
||
def transform(label, path, steps):
|
||
raw = path.read_bytes()
|
||
text = raw.decode("utf-8")
|
||
print("== %s (%s): %d Б, строк %d" % (label, path.name, len(raw), text.count("\n")))
|
||
before_nodes = len(re.findall(r'"id"', text))
|
||
for name, node_id, old, new, quoted in steps:
|
||
text = splice(text, node_id, old, new, quoted)
|
||
print(" · %-28s %s: заменено 1 свойство" % (node_id, name))
|
||
parsed = json.loads(text) # валидность
|
||
after_nodes = len(re.findall(r'"id"', text))
|
||
assert before_nodes == after_nodes, "число узлов изменилось: %d → %d" % (before_nodes, after_nodes)
|
||
path.write_bytes(text.encode("utf-8"))
|
||
back = path.read_bytes().decode("utf-8")
|
||
assert back == text, "round-trip не совпал"
|
||
assert json.loads(back) == parsed, "перечитанный JSON отличается"
|
||
print(" ✓ записан, перечитан, состав узлов неизменен (%d id)" % after_nodes)
|
||
return len(raw), len(text.encode("utf-8"))
|
||
|
||
|
||
def main():
|
||
canon_sizes = transform("канон", CANON, [
|
||
("снята базовая рамка", "EByJw",
|
||
' "stroke": "$brand-deep",\n "strokeWidth": 2,\n',
|
||
' "stroke": "$brand-deep",\n', True),
|
||
("рамка осталась у CTA", "z4XWl",
|
||
' "stroke": "$brand",\n "descendants": {',
|
||
' "stroke": "$brand",\n "strokeWidth": 2,\n "descendants": {', True),
|
||
("контур фокуса 4 → 2", "JIqc4",
|
||
' "name": "PL_focus",\n "strokeWidth": 4\n',
|
||
' "name": "PL_focus",\n "strokeWidth": 2,\n "stroke": "$brand-deep"\n', True),
|
||
("подпись описывает правило", "APqQ5", OLD_CAP_CANON, NEW_CAP, True),
|
||
])
|
||
snap_sizes = transform("снимок", SNAPSHOT, [
|
||
("снята рамка глифа темы", "xv726", ',"stroke":"$brand-deep","strokeWidth":2', '', False),
|
||
("подпись описывает правило", "APqQ5", OLD_CAP_SNAPSHOT, NEW_CAP, False),
|
||
])
|
||
print("канон %d → %d Б; снимок %d → %d Б" % (canon_sizes[0], canon_sizes[1], snap_sizes[0], snap_sizes[1]))
|
||
return 0
|
||
|
||
|
||
if __name__ == "__main__":
|
||
sys.exit(main())
|