from pathlib import Path import hashlib,json,os base=Path(__file__).parent rows=[] styles=''' /* Explicit review-reminder recipient identity; IDs stay readable at every DPI. */ #stage .assistant-recipient-card { display:grid; grid-template-columns:40px minmax(0,1fr); gap:12px; margin:14px 0; padding:16px; border:1px solid #c4d5f0; border-radius:14px; background:#f5f8ff; color:var(--ink); min-width:0; } #stage .assistant-recipient-icon { display:flex; align-items:center; justify-content:center; width:40px; height:40px; border-radius:12px; background:#e4edff; color:#355da8; } #stage .assistant-recipient-icon svg { width:22px; height:22px; } #stage .assistant-recipient-copy { min-width:0; } #stage .assistant-recipient-heading { display:flex; align-items:center; flex-wrap:wrap; gap:8px 12px; margin-bottom:8px; } #stage .assistant-recipient-tag { display:inline-block; padding:3px 8px; border-radius:6px; background:#e4edff; color:#35558d; font-size:12px; font-weight:700; line-height:1.5; } #stage .assistant-recipient-kind { color:var(--muted); font-size:12px; } #stage .assistant-recipient-name { display:block; color:var(--ink); font-size:18px; font-weight:700; line-height:1.5; white-space:normal; overflow-wrap:anywhere; } #stage .assistant-recipient-name.is-unknown { color:#875600; font-size:16px; } #stage .assistant-recipient-identity { display:flex; flex-wrap:wrap; align-items:baseline; gap:3px 8px; margin-top:7px; font-size:13px; line-height:1.6; color:var(--muted); min-width:0; } #stage .assistant-recipient-id { font-family:ui-monospace,Consolas,monospace; font-size:13px; color:#566786; font-variant-numeric:tabular-nums; white-space:normal; overflow-wrap:anywhere; word-break:break-word; min-width:0; max-width:100%; } #stage .assistant-recipient-card.is-empty { background:#f8f9fc; border-color:#d9e0eb; } @media (max-width:640px) { #stage .assistant-recipient-card { grid-template-columns:32px minmax(0,1fr); gap:10px; padding:12px; } #stage .assistant-recipient-icon { width:32px; height:32px; } } ''' for tag,root in [('production',Path('C:/wechat_rpa')),('source',Path('C:/kefu/wechat_rpa'))]: folder=base/'frontend-before'/tag;folder.mkdir(parents=True,exist_ok=True) for name in ['console-app.js','console-review.css']: p=root/'assets/ui'/name backup=folder/name if backup.exists(): raise RuntimeError('Backup already exists; refuse to overwrite '+str(backup)) backup.write_bytes(p.read_bytes()) p=root/'assets/ui/console-app.js';text=p.read_text(encoding='utf-8') start=text.index('function reviewAssistantPanel(a){');end=text.index('\n}\n',start)+2 before=text[start:end];panel=before marker=' const canToggle = canChoose && (recipient.id || r.enabled);' assert panel.count(marker)==1 panel=panel.replace(marker,marker+''' const recipientId = String(recipient.id || "").trim(); const recipientName = String(recipient.displayName || "").trim() || String(recipient.name || "").trim(); const nameKnown = recipient.nameKnown !== false && Boolean(recipientName) && recipientName !== "微信联系人"; const recipientTitle = !recipientId ? "尚未选择助理私人微信" : nameKnown ? recipientName : "昵称未读取,请核对联系编号"; ''') old='