nomadro/scripts/probe-social-layout.py
Eric e177b50d2e ARCHIVE test12 Codex social overhaul — NEVER DEPLOY to .com/.cn.
Freeze experimental social/admin UX on test12 for reference only; see docs/archive/test12-NEVER-DEPLOY.md.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-05 19:22:12 +08:00

19 lines
898 B
Python

import asyncio
import json
from playwright.async_api import async_playwright
async def main():
async with async_playwright() as p:
browser = await p.chromium.launch()
page = await browser.new_page(viewport={'width': 390, 'height': 844}, reduced_motion='reduce')
await page.goto('http://localhost:3010/social', wait_until='domcontentloaded')
await page.wait_for_timeout(1000)
print(json.dumps(await page.evaluate('''() => [...document.querySelectorAll('body *')].filter(e=>{
const r=e.getBoundingClientRect(),s=getComputedStyle(e);
return r.right>innerWidth+2 && r.width>0 && !e.closest('svg') && s.position!=='fixed' && s.visibility!=='hidden'
}).slice(0,25).map(e=>({tag:e.tagName,c:e.className,x:e.getBoundingClientRect().x,w:e.getBoundingClientRect().width}))''')))
await browser.close()
asyncio.run(main())