Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 50 additions & 50 deletions .goldens/manifest.tsv

Large diffs are not rendered by default.

40 changes: 40 additions & 0 deletions scripts/audit/page-shots.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Full-page screenshots of a built dist/client, served locally, JavaScript off,
// so two builds can be compared pixel for pixel. Usage: PLAYWRIGHT=... CHROMIUM=... node scripts/audit/page-shots.cjs dist/client OUTDIR PORT
// Run it on the build before a change and after, then compare with pixel-diff.py.
// Run "before" twice: pages whose two before shots differ are noisy (reels, video posters).
const http = require('http'), fs = require('fs'), path = require('path');
const { chromium } = require(process.env.PLAYWRIGHT || 'playwright');
const [dist, out, port] = [process.argv[2], process.argv[3], Number(process.argv[4] || 8931)];
const TYPES = { '.html': 'text/html', '.css': 'text/css', '.js': 'text/javascript', '.webp': 'image/webp', '.avif': 'image/avif', '.png': 'image/png', '.jpg': 'image/jpeg', '.svg': 'image/svg+xml', '.woff2': 'font/woff2', '.ico': 'image/x-icon', '.json': 'application/json', '.mp4': 'video/mp4', '.webm': 'video/webm' };
const server = http.createServer((req, res) => {
let p = decodeURIComponent(req.url.split('?')[0]);
let f = path.join(dist, p);
if (p.endsWith('/')) f = path.join(dist, p, 'index.html');
else if (!path.extname(p)) f = f + '.html';
fs.readFile(f, (e, b) => { if (e) { res.writeHead(404); res.end(); return; } res.writeHead(200, { 'content-type': TYPES[path.extname(f)] || 'application/octet-stream' }); res.end(b); });
}).listen(port);
const PAGES = ['/', '/work', '/chere', '/process', '/insights/coos-county-website-audit', '/web-design-coos-bay', '/work/stainslayer-ai', '/work/seabreeze', '/pricing', '/contact', '/services', '/work/baseline-marketing', '/services/ai-automation'];
(async () => {
fs.mkdirSync(out, { recursive: true });
const b = await chromium.launch(process.env.CHROMIUM ? { executablePath: process.env.CHROMIUM } : {});
for (const w of [390, 1280]) {
const ctx = await b.newContext({ viewport: { width: w, height: 900 }, javaScriptEnabled: false, reducedMotion: 'reduce' });
const pg = await ctx.newPage();
for (const u of PAGES) {
await pg.goto(`http://127.0.0.1:${port}${u}`, { waitUntil: 'networkidle' });
// Lazy images and backgrounds load only near the viewport, so a full-page shot
// is a race unless every image is made eager and decoded first.
await pg.evaluate(async () => {
document.querySelectorAll('img[loading="lazy"]').forEach((i) => { i.loading = 'eager'; });
await Promise.all([...document.images].map((i) => (i.complete ? null : new Promise((r) => { i.onload = i.onerror = r; }))));
await Promise.all([...document.images].map((i) => i.decode().catch(() => null)));
await document.fonts.ready;
});
await pg.waitForLoadState('networkidle');
await pg.waitForTimeout(300);
await pg.screenshot({ path: path.join(out, `${w}${u.replace(/\//g, '_') || '_'}.png`), fullPage: true });
}
await ctx.close();
}
await b.close(); server.close(); console.log('SHOTS-DONE', out);
})();
13 changes: 13 additions & 0 deletions scripts/audit/pixel-diff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env python3
"""Compare two folders of screenshots pixel for pixel. Prints each file as SAME,
or DIFF with the size change and the bounding box of changed pixels.
Usage: python3 scripts/audit/pixel-diff.py BEFORE_DIR AFTER_DIR"""
import sys, os
from PIL import Image, ImageChops
a, b = sys.argv[1], sys.argv[2]
for f in sorted(os.listdir(a)):
x, y = Image.open(os.path.join(a, f)).convert('RGB'), Image.open(os.path.join(b, f)).convert('RGB')
if x.size != y.size:
print(f'DIFF {f:50s} size {x.size} -> {y.size}'); continue
box = ImageChops.difference(x, y).getbbox()
print(f"{'SAME' if box is None else 'DIFF'} {f:50s} {'' if box is None else box}")
59 changes: 59 additions & 0 deletions scripts/audit/run-together.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#!/usr/bin/env python3
"""Find words that join across a tag with no space between them, the way a text
extractor, a copy and paste, or a reader that drops visually hidden text sees them.
Usage: python3 scripts/audit/run-together.py dist/client (after a build)
Inline seams (two inline elements, no space) are the ones to fix; seams across
block elements read as separate lines in every extractor.
Prints page, the joined text, and the two tags at the seam."""
import sys, glob, re
from html.parser import HTMLParser

VOID = {'br', 'img', 'hr', 'input', 'meta', 'link', 'source', 'wbr'}
SKIP = {'script', 'style', 'noscript', 'svg', 'template', 'head'}

class P(HTMLParser):
def __init__(self):
super().__init__(convert_charrefs=True)
self.stack, self.nodes, self.since = [], [], []
def handle_starttag(self, t, a):
cls = dict(a).get('class') or ''
if t in VOID:
self.since.append(t); return
self.stack.append((t, 'sr-only' in cls.split() or 'visually-hidden' in cls.split()))
self.since.append('<' + t)
def handle_endtag(self, t):
for i in range(len(self.stack) - 1, -1, -1):
if self.stack[i][0] == t:
del self.stack[i:]; break
self.since.append('/' + t)
def handle_data(self, d):
if any(t in SKIP for t, _ in self.stack): return
hidden = any(h for _, h in self.stack)
if not d.strip():
if d: self.nodes.append((' ', False, list(self.since))); self.since = []
return
self.nodes.append((d, hidden, list(self.since))); self.since = []

BLOCK = set('p div li ul ol dd dt dl h1 h2 h3 h4 h5 h6 section article header footer nav details '
'summary br tr td th figcaption figure blockquote main aside table tbody thead form '
'fieldset legend label button option select'.split())
# Same skip as og-cards.mjs: /lamp is Preston's own page outside the business site.
SKIP_PAGES = {'/lamp.html'}
hits = 0
root = sys.argv[1].rstrip('/')
for f in sorted(glob.glob(root + '/**/*.html', recursive=True)):
page = f[len(root):]
if page in SKIP_PAGES: continue
p = P(); p.feed(open(f, encoding='utf-8').read())
vis = [(d, s) for d, h, s in p.nodes if not h] # what an extractor that drops sr-only sees
seen = set()
for (a, _), (b, tags) in zip(vis, vis[1:]):
if a == ' ' or b == ' ' or not tags or a[-1].isspace() or b[0].isspace(): continue
if {t.strip('</') for t in tags} & BLOCK: continue
if not (re.search(r'[A-Za-z0-9.,:;!?)]$', a) and re.match(r'[A-Za-z0-9(]', b)): continue
key = (a[-24:], b[:24])
if key in seen: continue
seen.add(key); hits += 1
print(f"{page:44s} ...{a[-24:]!r} | {b[:24]!r} {' '.join(tags)[:60]}")
print('SEAMS', hits)
sys.exit(1 if hits else 0)
29 changes: 29 additions & 0 deletions scripts/audit/work-scores-test.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// /work live scores: how the card chip and the details row react to the /api/workshop
// feed in five cases (real, dated and newer, undated fallback, dated and older, down).
// Usage: PLAYWRIGHT=... CHROMIUM=... node scripts/audit/work-scores-test.cjs https://HOST
// Expected: real and dated-newer replace the numbers and the date; the other three keep
// the stored, dated read.
const { chromium } = require(process.env.PLAYWRIGHT || 'playwright');
const base = process.argv[2];
const row = (pg) => pg.evaluate(() => {
const c = document.querySelector('[data-chip-site="grand-management"]');
return c ? { chip: c.querySelector('[data-chip-perf]')?.textContent, nums: c.querySelector('[data-lh-nums]')?.textContent, at: c.querySelector('[data-lh-at]')?.textContent } : null;
});
(async () => {
const b = await chromium.launch(process.env.CHROMIUM ? { executablePath: process.env.CHROMIUM } : {});
const run = async (name, fulfil) => {
const pg = await (await b.newContext()).newPage();
if (fulfil) await pg.route('**/api/workshop', (r) => fulfil(r));
await pg.goto(base + '/work', { waitUntil: 'networkidle' });
await pg.waitForTimeout(800);
console.log(name.padEnd(28), JSON.stringify(await row(pg)));
await pg.close();
};
const quad = (p) => [p, 100, 100, 100];
await run('live feed (real)', null);
await run('dated, newer, grand 91', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ lighthouse: { grand: quad(91), measured_at: '2026-11-23T08:00:00Z' }, security: { sites: {} } }) }));
await run('undated fallback, grand 98', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ lighthouse: { grand: quad(98), measured: 'within 12 hours' }, security: { sites: {} } }) }));
await run('dated, older, grand 80', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ lighthouse: { grand: quad(80), measured_at: '2026-06-24T00:00:00Z' }, security: { sites: {} } }) }));
await run('feed down (500)', (r) => r.fulfill({ status: 500, body: '' }));
await b.close();
})();
4 changes: 2 additions & 2 deletions src/components/home/WhyMe.astro
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ const VALUES: { icon: 'keep' | 'all' | 'lock' | 'found'; head: string; body: str
<figure class="wm-meter" data-meter>
<figcaption class="wm-meter-cap">Google's mobile test, out of 100</figcaption>
<div class="wm-bar">
<div class="wm-bar-label"><span>Coos County business sites, average</span><b>61</b></div>
<div class="wm-bar-label"><span>Coos County business sites, average</span>{' '}<b>61</b></div>
<div class="wm-track"><span class="wm-fill wm-fill-county"></span></div>
</div>
<div class="wm-bar">
<div class="wm-bar-label"><span>Every site I build</span><b class="wm-mine">90+</b></div>
<div class="wm-bar-label"><span>Every site I build</span>{' '}<b class="wm-mine">90+</b></div>
<div class="wm-track"><span class="wm-fill wm-fill-mine"></span><span class="wm-tick" aria-hidden="true"></span></div>
</div>
<p class="wm-meter-note">From my audit of 169 Coos County business sites. <a href="/wall">Mine, live on the Wall</a></p>
Expand Down
4 changes: 2 additions & 2 deletions src/components/layout/Footer.astro
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const legalLinks: L[] = [
<div class="wc-foot-folds">
{lines.filter((ln) => ln.title).map((ln) => (
<details class="wc-foot-fold" data-foot-fold>
<summary><span>{ln.title}</span><span class="wc-foot-count">{ln.links.length}</span></summary>
<summary><span>{ln.title}</span>{' '}<span class="wc-foot-count">{ln.links.length}</span></summary>
<nav class="wc-foot-line" aria-label={ln.aria}>
<ul>
{ln.links.map((l) => <li><a href={l.href}>{l.label}</a></li>)}
Expand All @@ -109,7 +109,7 @@ const legalLinks: L[] = [
no bottom padding under it (TextBar). -->
<div class="wc-foot-chrome" data-textbar-hide>
<nav class="wc-foot-legal" aria-label="Legal">
{legalLinks.map((l) => <a href={l.href}>{l.label}</a>)}
{legalLinks.map((l) => <>{' '}<a href={l.href}>{l.label}</a></>)}
</nav>
<div class="wc-foot-copy">&copy; {year} Winters Code · Bandon, Oregon</div>
<p class="wc-foot-fine">
Expand Down
2 changes: 1 addition & 1 deletion src/components/layout/Header.astro
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const navItems = [
<!-- Desktop horizontal nav, hidden on mobile/tablet -->
<nav class="topnav-links" aria-label="Primary">
{navItems.map(({ href, label }) => (
<a href={href}>{label}</a>
<>{' '}<a href={href}>{label}</a></>
))}
</nav>

Expand Down
12 changes: 6 additions & 6 deletions src/components/layout/KeyboardShortcuts.astro
Original file line number Diff line number Diff line change
Expand Up @@ -49,27 +49,27 @@

<dl class="kbd-list">
<div class="kbd-row">
<dt><kbd>g</kbd><kbd>h</kbd></dt>
<dt><kbd>g</kbd> <kbd>h</kbd></dt>
<dd>Home</dd>
</div>
<div class="kbd-row">
<dt><kbd>g</kbd><kbd>w</kbd></dt>
<dt><kbd>g</kbd> <kbd>w</kbd></dt>
<dd>Work</dd>
</div>
<div class="kbd-row">
<dt><kbd>g</kbd><kbd>s</kbd></dt>
<dt><kbd>g</kbd> <kbd>s</kbd></dt>
<dd>Services</dd>
</div>
<div class="kbd-row">
<dt><kbd>g</kbd><kbd>a</kbd></dt>
<dt><kbd>g</kbd> <kbd>a</kbd></dt>
<dd>About</dd>
</div>
<div class="kbd-row">
<dt><kbd>g</kbd><kbd>l</kbd></dt>
<dt><kbd>g</kbd> <kbd>l</kbd></dt>
<dd>The Wall</dd>
</div>
<div class="kbd-row">
<dt><kbd>g</kbd><kbd>c</kbd></dt>
<dt><kbd>g</kbd> <kbd>c</kbd></dt>
<dd>Contact</dd>
</div>
<div class="kbd-row kbd-row-divider">
Expand Down
2 changes: 1 addition & 1 deletion src/components/sections/ChereFeature.astro
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ const mediaUrl = (file: string) => {

{(variant === 'work' || variant === 'page') && (
<div class="chf-tags" role="list">
{p.tags.map((t) => <span class="chf-tag" role="listitem">{t}</span>)}
{p.tags.map((t) => <>{' '}<span class="chf-tag" role="listitem">{t}</span></>)}
</div>
)}

Expand Down
4 changes: 2 additions & 2 deletions src/components/sections/Contact.astro
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ const sms = smsHref(Astro.url.pathname);

<div class="closer-keys" data-textbar-hide>
<a class="wc-btn wc-btn--primary closer-key" href={sms}>
<span class="closer-stack"><span class="closer-label">Text Preston</span><span class="closer-num">{phoneDisplay}</span></span>
<span class="closer-stack"><span class="closer-label">Text Preston</span>{' '}<span class="closer-num">{phoneDisplay}</span></span>
<Arrow size={22} />
</a>
<a class="wc-btn wc-btn--ghost closer-key" href={telHref}>
<span class="closer-stack"><span class="closer-label">Call</span><span class="closer-num">{phoneDisplay}</span></span>
<span class="closer-stack"><span class="closer-label">Call</span>{' '}<span class="closer-num">{phoneDisplay}</span></span>
</a>
</div>

Expand Down
8 changes: 6 additions & 2 deletions src/components/ui/Fold.astro
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const { title, meta, open = false, group, id, tone = 'dark' } = Astro.props;
---
<details class:list={['wfold', `wfold--${tone}`]} open={open} name={group} id={id}>
<summary class="wfold-q">
<span class="wfold-t">{title}{meta && <><span class="sr-only">, </span><span class="wfold-meta">{meta}</span></>}</span>
<span class="wfold-t"><span>{title}</span>{meta && <><span class="sr-only">,</span>{' '}<span class="wfold-meta">{meta}</span></>}</span>
<span class="wfold-x" aria-hidden="true"></span>
</summary>
<div class="wfold-a"><slot /></div>
Expand Down Expand Up @@ -53,7 +53,11 @@ const { title, meta, open = false, group, id, tone = 'dark' } = Astro.props;
.wfold-q::-webkit-details-marker { display: none; }
.wfold-q:focus-visible { outline: 2px solid var(--color-wc-green); outline-offset: 2px; }
/* The meta line sits beside the title on screen; a hidden comma keeps a screen
reader and a copied line from running the two together ("meansplainly"). */
reader from running the two together ("meansplainly"), and a real space
between them does the same for copied text and for readers that skip hidden
text ("Coos Bay6 services", S339 round 5). The title sits in its own span so
that space falls between two flex items, where it takes no room; beside bare
title text it would widen the gap. */
.wfold-t { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.wfold-meta { font-size: 13.5px; font-weight: 400; color: var(--color-ash-300); }
.wfold--paper .wfold-meta { color: var(--wc-ink-soft); }
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/Steps.astro
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const { steps, label = 'How it goes' } = Astro.props;
{steps.map((s) => (
<li class="wsteps-step">
<span class="wsteps-node" aria-hidden="true"></span>
<span class="wsteps-t">{s.title}{s.meta && <span class="wsteps-m">{s.meta}</span>}</span>
<span class="wsteps-t">{s.title}{s.meta && <>{' '}<span class="wsteps-m">{s.meta}</span></>}</span>
<span class="wsteps-b">{s.body}</span>
</li>
))}
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/TextCta.astro
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const sms = about ? smsAboutHref(Astro.url.pathname, about) : smsHref(Astro.url.
{lead && <p class="tcta-lead" set:html={lead} />}
<div class="tcta-row">
<a href={sms} class="wc-btn wc-btn--primary tcta-btn">
<span class="tcta-stack"><span class="tcta-label">{label}</span><span class="tcta-num">{phoneDisplay}</span></span>
<span class="tcta-stack"><span class="tcta-label">{label}</span>{' '}<span class="tcta-num">{phoneDisplay}</span></span>
<Arrow size={20} />
</a>
{links.map((l) => (
Expand Down
21 changes: 11 additions & 10 deletions src/lib/sites.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ export interface MeasuredSite {
secFallback?: { grade: string; score: number };
}

// S339, 2026-11-05: every lhFallback refreshed from the Wall's live
// /api/workshop read (measured_at 2026-11-05T15:01Z), so a failed live read
// never shows a buyer an older, lower number than the Wall does.
// S339, 2026-11-22: every lhFallback and secFallback refreshed from the Wall's
// live /api/workshop read (Lighthouse measured_at below), so a page that paints
// before the live read, or without one, shows the Wall's numbers and says when.
export const LH_FALLBACK_AT = '2026-11-22T21:50:29Z';
export const SITES: MeasuredSite[] = [
{
// S339, 2026-10-28: newest client, live on www since 2026-10-27 (the apex
Expand All @@ -49,7 +50,7 @@ export const SITES: MeasuredSite[] = [
// 2026-10-09 (wc-grandmgmt's first commit), live Tue 2026-10-27.
key: 'grand', label: 'grandmgmt', name: 'Grand Management Services',
href: 'https://www.grandmgmt.com', portfolioSlug: 'grand-management', builtDays: 13,
published: true, lhFallback: [98, 100, 100, 100], secFallback: { grade: 'A+', score: 125 },
published: true, lhFallback: [100, 100, 100, 100], secFallback: { grade: 'A+', score: 125 },
},
{
// S339: newest client, live on www since 2026-10-19 (the apex 301s to www,
Expand All @@ -59,7 +60,7 @@ export const SITES: MeasuredSite[] = [
// Preston 2026-10-22: signed Tue 10-13, live on her go email Mon 10-19.
key: 'makai', label: 'makaipainting', name: 'Makai Painting',
href: 'https://www.makaipainting.com', portfolioSlug: 'makai-painting', builtDays: 5,
published: true, lhFallback: [99, 100, 100, 100], secFallback: { grade: 'A+', score: 125 },
published: true, lhFallback: [93, 100, 100, 100], secFallback: { grade: 'A+', score: 125 },
},
{
// S339: South Coast Cuisine, live since 2026-09-22 on the apex (www 301s
Expand All @@ -68,7 +69,7 @@ export const SITES: MeasuredSite[] = [
// three with the client editor; the larger figure is the one shown.
key: 'jen', label: 'southcoastcuisine', name: 'South Coast Cuisine',
href: 'https://southcoastcuisine.net', portfolioSlug: 'south-coast-cuisine', builtDays: 3,
published: true, lhFallback: [99, 100, 100, 100], secFallback: { grade: 'A+', score: 140 },
published: true, lhFallback: [97, 100, 100, 100], secFallback: { grade: 'A+', score: 140 },
},
{
// Cutover done 2026-09-11 (S230): the apex serves this build.
Expand All @@ -86,12 +87,12 @@ export const SITES: MeasuredSite[] = [
{
key: 'seabreeze', label: 'seabreeze', name: 'SeaBreeze Landscape Care and Home Repair',
href: 'https://seabreeze.llc', portfolioSlug: 'seabreeze', builtDays: 7,
published: true, lhFallback: [95, 100, 100, 100], secFallback: { grade: 'A+', score: 125 },
published: true, lhFallback: [97, 100, 100, 100], secFallback: { grade: 'A+', score: 125 },
},
{
key: 'bbtd', label: 'bandon', name: 'Bandon By The Dunes Realtee',
href: 'https://www.bandonbythedunesrealtee.net', portfolioSlug: 'bandon-by-the-dunes', builtDays: 18,
published: true, lhFallback: [97, 100, 100, 100], secFallback: { grade: 'A+', score: 135 },
published: true, lhFallback: [100, 100, 100, 100], secFallback: { grade: 'A+', score: 135 },
},
{
// PSI 2026-09-05 after the contrast pass. One business day, per Preston.
Expand All @@ -102,7 +103,7 @@ export const SITES: MeasuredSite[] = [
{
key: 'sogn', label: 'sogn', name: 'Sogn Contracting',
href: 'https://www.sogncontracting.com', portfolioSlug: 'sogn-contracting', builtDays: 3,
published: true, lhFallback: [99, 100, 100, 100], secFallback: { grade: 'A+', score: 125 },
published: true, lhFallback: [98, 100, 100, 100], secFallback: { grade: 'A+', score: 125 },
},
{
key: 'baseline', label: 'baseline', name: 'Baseline Marketing',
Expand All @@ -112,7 +113,7 @@ export const SITES: MeasuredSite[] = [
{
key: 'winterscode', label: 'winterscode', name: 'Winters Code',
href: 'https://winterscode.com',
published: true, lhFallback: [99, 100, 100, 100], secFallback: { grade: 'A+', score: 125 },
published: true, lhFallback: [100, 100, 100, 100], secFallback: { grade: 'A+', score: 125 },
},
];

Expand Down
Loading