tracker
All repositories: gitoria
4.6 KB
// tests/realdata-check.mjs — mission 047 REAL-DATA check (NOT part of the gate): a dev server on :8730 over a COPY of Byrodin's// storage/, a session file for the creator (az5b2) whose id is in .scratch/real-sid (STATUS.md has the procedure). Times// / , /my/* and the first followed show (direct + CLIENT-SIDE from /my/shows), expands/collapses a season, checks every// check svg is a drawn SVG, screenshots 390 + 1280 into /tmp/w047/real/. Run: node tests/realdata-check.mjsimport { writeFileSync, readFileSync } from 'node:fs';import { launchBrowser } from '../tests/cdp.mjs';process.env.HL_CHROME ||= '/opt/google/chrome/chrome';const BASE = 'http://127.0.0.1:8730', OUT = '/tmp/w047/real', SID = readFileSync('.scratch/real-sid', 'utf8').trim();const browser = await launchBrowser({ debugPortRange: [8731, 8731] });const page = await browser.newPage();const ev = (e) => page.evaluate(e);await page.send('Network.enable', {});await page.send('Network.setCookie', { name: 'trackersid', value: SID, url: BASE });const hydrated = () => page.waitFor('!!window.__hl && window.__hl.socket && window.__hl.socket.readyState === 1 && document.readyState === "complete"', { timeout: 30000, label: 'hydrated' });const shot = async (n) => writeFileSync(`${OUT}/${n}.png`, Buffer.from((await page.send('Page.captureScreenshot', { format: 'png' })).data, 'base64'));const svgState = () => ev(`JSON.stringify((() => { const s = Array.from(document.querySelectorAll('button.checkicon svg, season-caret svg'));return { checks: document.querySelectorAll('button.checkicon').length, badNs: s.filter(e => e.namespaceURI !== 'http://www.w3.org/2000/svg').length,undrawn: Array.from(document.querySelectorAll('button.checkicon svg circle')).filter(c => !(c.getBoundingClientRect().width > 0)).length }; })())`);const res = [];for (const [w, h, mobile] of [[390, 844, true], [1280, 900, false]]) {await page.send('Emulation.setDeviceMetricsOverride', { width: w, height: h, deviceScaleFactor: mobile ? 2 : 1, mobile });let showPath = null;for (const [name, path] of [['home', '/'], ['my-shows', '/my/shows'], ['my-unwatched', '/my/unwatched'], ['my-schedule', '/my/schedule']]) {const t = Date.now();await page.goto(BASE + path, { timeout: 60000 });await hydrated();if (name === 'my-shows') await page.waitFor(`Array.from(document.querySelectorAll('img.myshow-poster')).every(i => i.complete)`, { timeout: 30000 });const ms = Date.now() - t;const info = await ev(`JSON.stringify({ rows: document.querySelectorAll('my-show-row, unwatched-row, schedule-row').length, user: !!document.querySelector('#logout'), scrollW: document.documentElement.scrollWidth, headerH: document.querySelector('application-header').getBoundingClientRect().height })`);res.push(`${w} ${path} ${ms} ms ${info}`);await shot(`${name}-${w}`);if (name === 'my-shows') showPath = await ev(`document.querySelector('a.myshow-title').getAttribute('href')`);}// direct load of that showlet t = Date.now();await page.goto(BASE + showPath); await hydrated();res.push(`${w} ${showPath} (direct) ${Date.now() - t} ms ${await svgState()}`);await shot(`show-direct-${w}`);// CLIENT-SIDE: /my/shows → click the first titleawait page.goto(BASE + '/my/shows'); await hydrated();await ev(`window.__w047 = 'same document'`);t = Date.now();await page.click('a.myshow-title');await page.waitFor(`location.pathname === ${JSON.stringify(showPath)} && !!document.querySelector('button.checkicon svg circle')`, { timeout: 20000, label: 'client nav' });res.push(`${w} client-side nav → ${showPath} ${Date.now() - t} ms marker=${await ev('window.__w047')} ${await svgState()}`);await shot(`show-clientnav-${w}`);// expand the first collapsed season, then collapse it againconst sid = await ev(`(() => { const r = document.querySelector('season-row.collapsed button.season-toggle'); return r ? r.value : null })()`);if (sid) {await page.click(`button.season-toggle[value="${sid}"]`);await page.waitFor(`document.querySelector('button.season-toggle[value="${sid}"]').closest('season-row').classList.contains('expanded')`, { timeout: 20000 });res.push(`${w} after expand ${await svgState()}`);await shot(`show-expanded-${w}`);await page.click(`button.season-toggle[value="${sid}"]`);await page.waitFor(`document.querySelector('button.season-toggle[value="${sid}"]').closest('season-row').classList.contains('collapsed')`, { timeout: 20000 });res.push(`${w} after collapse ${await svgState()}`);}}console.log(res.join('\n'));console.log('problems', JSON.stringify(page.problems ? page.problems() : []));await browser.close();
Branches
- mainmain branch
Latest commits
- b8bd1157tracker#14: README + STATUS (search, real-data numbers, gate, merge notes)mre
- 65c694a8tracker#14: search — header magnifier, /search/<text> (in-memory word-prefix index over titles + people), Fetch from web (TMDB search/multi, ours left out), Add = import via syncShow; gate +25 checks, real-data scriptmre
- cbdc4ea7tracker#12: link icons TMDB/IMDb/TVDB/TVmaze; sync fills missing ids (TVmaze lookup); movies fetched via /movie/mre
- b105bcd8tracker#11: Hybriel master ff51cf46 (checks no longer vanish), mobile-first styles, carets, follow button, sign-in modal, inverted check, orange castmre
- 31b758aatracker#10: installable app (manifest, service worker, offline shell), own icon + faviconmre
- 2fa9d997tracker#9: TMDB sync (followed shows: seasons, episodes, posters), tools/sync-tmdb.hl + daily run 04:00 UTC, fake TMDB in gatemre
- 49e1f61edeploy.sh: back up live storage/.sessions/.env before every deploy (newest 5 kept)mre
- 54070a4etracker#8: /my/unwatched + /my/schedule (301 from old), S01E01, title (year), 1 episode, watched-set lookup (unwatched 15s -> 1s)mre
- 3251488atracker#7: /my/shows (followed shows, newest follow first, poster, title, last watched SxxEyy); gate can take screenshots (TRACKER_GATE_SHOTS)mre
- 44b7d9f9tracker#6: /schedule — upcoming episodes of followed shows, soonest firstmre
- 91c9fc8ctracker#5: /unwatched — unwatched released episodes of followed shows, newest firstmre
- a97c0295tracker#4: show page /shows/:slug (header, seasons, episodes, watch checks) + tools/relink-episode-seasons.hlmre
- 05f407c5tracker: no border on any button except inverted ones (Log out, ident status and identities too); header brand weight 100mre
- 17375427tracker#2: tools/migrate.hl + tools/verify.hl — old MongoDB data into mpackdb with new idsmre
- 31aac936tracker#3: no border on the header and on filled buttons; inverted buttons keep theirsmre
- 2ad9d29ctracker#1: login exactly like calendar (identity selector in the header, empty homepage)mre
- 3691e176tracker#1: empty tracker with the ident login (state of 2026-09-27)mre