Files
zeekayandGitHub ea43c5a975 Type lib, scripts, v2, home and app under strict (#8)
* Type scripts under strict

Playwright's API the checks use is declared in host.ts (the package is
the app repo's); caught errors read through why(). tabs-tree.test waits
for the typed tabsTree.

Claude-Session: https://claude.ai/code/session_015XYKLix9PSyn6Jw2HWKprk

* Type the shared components under strict

Window globals (__lenis, __hzHold, google) and the two react-dom calls
are declared in components/*.d.ts, since @types/react-dom is not a
dependency and the lockfile is frozen.

Claude-Session: https://claude.ai/code/session_015XYKLix9PSyn6Jw2HWKprk

* Type components/v2 under strict

Props, state, refs and DOM events in the 93 v2 files. A2Motion's easing
tuples are as const. Two real bugs: x-archimedes/MaskLines imported a
NoJs that does not exist, and x-hypatia/PinChapters returned the element
from a ref callback, which React 19 reads as a cleanup. AppSheet no
longer sets aria-label to a JSX label.

Claude-Session: https://claude.ai/code/session_015XYKLix9PSyn6Jw2HWKprk

* Type components/home under strict

The race, cost and frontier figures, the plan cards, the repository card
and the product stories take Run, Models and Plan types from lib.

Claude-Session: https://claude.ai/code/session_015XYKLix9PSyn6Jw2HWKprk

* Type the hero devices and the app routes under strict

HeroScene and its parts describe hero-scenes.json; the [slug] pages take
params as a Promise, and metadata and viewport carry Next's types.

Claude-Session: https://claude.ai/code/session_015XYKLix9PSyn6Jw2HWKprk

* Give the integrations previews their Preview type

Claude-Session: https://claude.ai/code/session_015XYKLix9PSyn6Jw2HWKprk

* Use the bench Card type for the closing cards

Claude-Session: https://claude.ai/code/session_015XYKLix9PSyn6Jw2HWKprk
2026-11-14 01:34:34 -08:00

25 lines
2.8 KiB
TypeScript

// Debug: which listeners sit on the Products heading, and does hovering it reach our handler?
import puppeteer from 'puppeteer-core';
import { lock } from './lock.ts';
await lock();
const b = await puppeteer.launch({ executablePath: '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome', headless: true });
const page = await b.newPage(); await page.setViewport({ width: 1470, height: 900 });
await page.evaluateOnNewDocument(() => { try { sessionStorage.setItem('hz-arrived', '1'); localStorage.setItem('hz-consent', '{"necessary":true}'); } catch {} });
await page.goto('http://127.0.0.1:4180/about/', { waitUntil: 'domcontentloaded', timeout: 180000 });
await page.waitForSelector('header button[aria-controls="x-nav-panel"]', { timeout: 60000 }); await new Promise((r) => setTimeout(r, 3000));
const btn = await page.evaluateHandle(() => [...document.querySelectorAll('header button')].find((x) => x.textContent.trim() === 'Products') as HTMLElement);
const cdp = await page.createCDPSession();
const { result } = await cdp.send('Runtime.evaluate', { expression: "[...document.querySelectorAll('header button')].find((x) => x.textContent.trim() === 'Products')" });
const { listeners } = await cdp.send('DOMDebugger.getEventListeners', { objectId: result.objectId! });
console.log('listeners on Products:', listeners.map((l) => l.type).join(', '));
const all = await page.evaluate(() => ({ wired: document.querySelectorAll('[aria-controls="x-nav-panel"]').length, firstHeaderIsSite: !!document.querySelector('header')?.closest('.x-page'), siteButtons: [...document.querySelectorAll('.x-page > div > header button, header button')].slice(0, 9).map((b) => b.textContent.trim() + (b.getAttribute('aria-controls') ? '*' : '')).join('|') }));
console.log(all);
const doc = await cdp.send('Runtime.evaluate', { expression: 'document' });
console.log('document listeners:', (await cdp.send('DOMDebugger.getEventListeners', { objectId: doc.result.objectId! })).listeners.map((l) => l.type).slice(0, 12).join(','));
const w = await cdp.send('Runtime.evaluate', { expression: "document.querySelector('[aria-controls=\"x-nav-panel\"]')" });
if (w.result.objectId) console.log('listeners on first wired button:', (await cdp.send('DOMDebugger.getEventListeners', { objectId: w.result.objectId })).listeners.map((l) => l.type).join(','));
const r = await btn.evaluate((e) => { const x = e.getBoundingClientRect(); return { x: x.left + x.width / 2, y: x.top + x.height / 2 }; });
await page.mouse.move(r.x, r.y + 200); await page.mouse.move(r.x, r.y, { steps: 5 }); await new Promise((r) => setTimeout(r, 500));
console.log(await page.evaluate(() => { const h = document.querySelector<HTMLElement>('header')!; return { enter: h.dataset.dbgEnter, fire: h.dataset.dbgFire, panel: !!document.getElementById('x-nav-panel'), headers: document.querySelectorAll('header').length }; }));
await b.close();