site: no sideways scroll at 450-1020 px (hero clips the demo glow), overflow test for 320-1440 px light and dark, css ?v bump

This commit is contained in:
CRTkafa 2026-10-12 01:38:42 +08:00
parent 0547433c2f
commit 179e4d3815
4 changed files with 57 additions and 3 deletions

View file

@ -25,7 +25,7 @@
<meta name="twitter:title" content="storebound · take your app or game from zero to Submit for review"> <meta name="twitter:title" content="storebound · take your app or game from zero to Submit for review">
<meta name="twitter:description" content="For mobile apps and games: app records, in-app products and subscriptions, listings in every language, every questionnaire, privacy, icons, screenshots. One config and your AI coding agent."> <meta name="twitter:description" content="For mobile apps and games: app records, in-app products and subscriptions, listings in every language, every questionnaire, privacy, icons, screenshots. One config and your AI coding agent.">
<meta name="twitter:image" content="https://storebound.dev/og.png?v=2"> <meta name="twitter:image" content="https://storebound.dev/og.png?v=2">
<link rel="stylesheet" href="style.css?v=20261012"> <link rel="stylesheet" href="style.css?v=20261012b">
<script>document.documentElement.classList.add('js')</script> <script>document.documentElement.classList.add('js')</script>
<script src="main.js?v=0ac6422" defer></script> <script src="main.js?v=0ac6422" defer></script>
</head> </head>

View file

@ -290,7 +290,9 @@ a:hover .ext{opacity:1}
/* ---------- hero ---------- */ /* ---------- hero ---------- */
.fine { font-size: 13.5px; color: var(--muted); margin-top: 14px; } .fine { font-size: 13.5px; color: var(--muted); margin-top: 14px; }
.fine a { color: inherit; } .fine a { color: inherit; }
.hero { position: relative; isolation: isolate; padding: 48px 0 0; /* overflow-x: clip keeps the demo glow (.demo::before reaches 4% past the window and blurs) from widening the page
at 450-1020px, where the gutter is narrower than that; it clips at the viewport edge, where body already did */
.hero { position: relative; isolation: isolate; padding: 48px 0 0; overflow-x: clip;
background: radial-gradient(55% 60% at 78% 0%, color-mix(in srgb, var(--accent) 13%, transparent), transparent 70%); } background: radial-gradient(55% 60% at 78% 0%, color-mix(in srgb, var(--accent) 13%, transparent), transparent 70%); }
.hero-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; .hero-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none;
background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);

View file

@ -0,0 +1,51 @@
// The site (site/index.html) never scrolls sideways: at every viewport width from 320 to 1440 px (10 px steps), in the
// light and the dark theme, document.documentElement.scrollWidth stays within innerWidth. On a failure it names the
// elements whose right edge passes the viewport outside any scroll container (pseudo-elements show as their owner).
// Uses the bundled playwright-core with its Chromium (or Google Chrome); skips when neither can launch.
import { afterAll, describe, expect, test } from 'bun:test';
import { join } from 'node:path';
const page = 'file://' + join(import.meta.dir, '..', 'site', 'index.html');
// eslint-disable-next-line @typescript-eslint/no-explicit-any
let browser: any = null;
let skipWhy = '';
try {
const { chromium } = await import('playwright-core');
try { browser = await chromium.launch({ headless: true }); } catch { browser = await chromium.launch({ headless: true, channel: 'chrome' }); }
} catch (e) { skipWhy = (e as Error).message.split('\n')[0]!; }
if (!browser) console.warn(`site overflow test skipped: no Chromium could launch (${skipWhy}). Run \`bunx playwright install chromium\`.`);
afterAll(async () => { await browser?.close(); });
describe.skipIf(!browser)('site: no horizontal overflow', () => {
for (const scheme of ['light', 'dark'] as const) {
test(`320-1440 px, ${scheme}`, async () => {
const ctx = await browser.newContext({ colorScheme: scheme, viewport: { width: 1440, height: 900 } });
const p = await ctx.newPage();
await p.goto(page, { waitUntil: 'load' });
const bad: string[] = [];
for (let w = 320; w <= 1440; w += 10) {
await p.setViewportSize({ width: w, height: 900 });
const r = await p.evaluate(() => {
const iw = innerWidth, sw = document.documentElement.scrollWidth;
if (sw <= iw) return null;
const els: string[] = [];
for (const el of document.querySelectorAll('body *')) {
const rc = el.getBoundingClientRect();
if (rc.width === 0 || rc.right <= iw + 0.5) continue;
let clipped = false;
for (let a = el.parentElement; a && a !== document.body; a = a.parentElement) {
if (getComputedStyle(a).overflowX !== 'visible') { clipped = true; break; }
}
if (!clipped) els.push(`${el.tagName.toLowerCase()}${el.id ? '#' + el.id : ''}${[...el.classList].map(c => '.' + c).join('')} right=${Math.round(rc.right)}`);
}
return `${iw}px: page ${sw - iw}px too wide${els.length ? ' (' + els.slice(0, 5).join(', ') + ')' : ' (a pseudo-element or transform)'}`;
});
if (r) bad.push(r);
}
await ctx.close();
expect(bad).toEqual([]);
}, 120_000);
}
});

View file

@ -2,7 +2,8 @@
// Everything CI runs, in order; stops at the first failure. bun run ci // Everything CI runs, in order; stops at the first failure. bun run ci
// `bun test` covers the CLI and the desktop webview (apps/desktop/tests: model, i18n, theme contrast, webview rules), // `bun test` covers the CLI and the desktop webview (apps/desktop/tests: model, i18n, theme contrast, webview rules),
// the desktop boot check (tools/desktop-boot-check.ts: the built window in headless Chromium, needs playwright's // the desktop boot check (tools/desktop-boot-check.ts: the built window in headless Chromium, needs playwright's
// browser or Google Chrome), and the no-hand-written-SVG guard (tests/no-handmade-svg.test.ts: visx charts, Phosphor icons, simple-icons store marks, Mermaid diagrams). // browser or Google Chrome), the site overflow check (tests/site-overflow.test.ts: no sideways scroll at 320-1440 px,
// light and dark; skips without Chromium), and the no-hand-written-SVG guard (tests/no-handmade-svg.test.ts: visx charts, Phosphor icons, simple-icons store marks, Mermaid diagrams).
// The desktop Rust host (cargo test, clippy // The desktop Rust host (cargo test, clippy
// with warnings as errors) runs when cargo is installed; set STOREBOUND_CI_RUST=0 to skip it on a machine without Rust. // with warnings as errors) runs when cargo is installed; set STOREBOUND_CI_RUST=0 to skip it on a machine without Rust.
import { join } from 'node:path'; import { join } from 'node:path';