From 51e09a1e326fb0a58b34a1d61bcbaaa61b6946ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o?= Date: Wed, 30 Sep 2026 17:14:52 +0200 Subject: [PATCH] fix(css): repoint the two stylesheet links the split left behind MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Splitting style.css deleted it, and two files outside static/ still named it: - scripts/verify_background_research_cards.mjs injected `` into the page it builds. A stylesheet that 404s does not fail — the script kept checking card layout against an unstyled page and kept reporting pass. It now reads the shell's tags out of index.html, the way tests/css_snapshot/capture.mjs already does, so the set cannot drift out from under it again. - tests/css_snapshot/bench.html's hand-open fallback linked the same deleted file. Replaced with the ordered set index.html ships. test_every_stylesheet_referenced_by_shipped_html_exists only walked static/*.html, which is why neither showed up. Extend it over the bench page: the bench's whole output is computed styles, so a dead link there is worth more than an unstyled page nobody looks at. --- scripts/verify_background_research_cards.mjs | 20 ++++++++++++++++-- tests/css_snapshot/bench.html | 22 +++++++++++++++++++- tests/test_static_stylesheet_manifest.py | 13 ++++++++++-- 3 files changed, 50 insertions(+), 5 deletions(-) diff --git a/scripts/verify_background_research_cards.mjs b/scripts/verify_background_research_cards.mjs index 16d580fba..158bc9b2e 100644 --- a/scripts/verify_background_research_cards.mjs +++ b/scripts/verify_background_research_cards.mjs @@ -1,10 +1,26 @@ /** Card layout and reconciliation against the served assets; no user mutations. */ import { chromium } from 'playwright'; + +const ORIGIN = 'http://127.0.0.1:7011'; + +/** The `` tags the app shell ships, in shell order. */ +async function shellStylesheets() { + const response = await fetch(`${ORIGIN}/static/index.html`); + if (!response.ok) throw new Error(`static/index.html returned ${response.status}`); + const links = (await response.text()).match(/]*rel=["']stylesheet["'][^>]*>/gi) || []; + if (!links.length) throw new Error('no stylesheet links found in static/index.html'); + return links.join(''); +} + const browser = await chromium.launch({ headless: true }); try { const page = await browser.newPage({ viewport: { width: 390, height: 844 } }); - await page.goto('http://127.0.0.1:7011/static/test-fixtures/browser-catalog.html'); - await page.setContent('

Existing conversation

'); + await page.goto(`${ORIGIN}/static/test-fixtures/browser-catalog.html`); + // Read the shell's stylesheets out of index.html rather than naming one + // here. style.css is now a set of ordered fragments, and a hardcoded link + // to a file that has moved does not fail - it renders unstyled and the + // layout checks below pass against nothing. + await page.setContent(`${await shellStylesheets()}

Existing conversation

`); const checks = await page.evaluate(async () => { const { renderResearchCards } = await import('/static/js/backgroundToolJobs.js'); const box = document.querySelector('#chat-history'); diff --git a/tests/css_snapshot/bench.html b/tests/css_snapshot/bench.html index a992f20ff..50e11d4cc 100644 --- a/tests/css_snapshot/bench.html +++ b/tests/css_snapshot/bench.html @@ -9,7 +9,27 @@ for opening the page by hand; it is deliberately unversioned so the cache-bust string has one home (tests/test_static_stylesheet_manifest.py pins the shipped ones). --> - + + + + + + + + + + + + + + + + + + + + +