From fa4f450d80c7488015490398e29e7203fcb8d006 Mon Sep 17 00:00:00 2001 From: Ronald Tse Date: Sun, 6 Sep 2026 23:21:54 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20malformed=20supporter=20SVGs=20=E2=80=94?= =?UTF-8?q?=20Boeing/Ribose=20invisible,=20NIST=20oversized?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit boeing/ribose shipped viewBox-only SVGs (no intrinsic width/height), so the logos collapsed to nothing under w-auto + height caps; nist shipped width/height without a viewBox, so its content could not scale and rendered oversized (ge had the same latent problem). Give all four both a viewBox and explicit dimensions, and set a definite h-10 on the logo strips so every logo renders at the same height. scripts/assets.test.ts guards the invariant: every supporter SVG must carry a viewBox and explicit width/height. --- public/images/supporters/supporter-boeing.svg | 2 +- public/images/supporters/supporter-ge.svg | 2 +- public/images/supporters/supporter-nist.svg | 2 +- public/images/supporters/supporter-ribose.svg | 2 +- scripts/assets.test.ts | 32 +++++++++++++++++++ src/pages/index.astro | 2 +- src/pages/supporters.astro | 2 +- 7 files changed, 38 insertions(+), 6 deletions(-) create mode 100644 scripts/assets.test.ts diff --git a/public/images/supporters/supporter-boeing.svg b/public/images/supporters/supporter-boeing.svg index bb9fc36..6c95484 100644 --- a/public/images/supporters/supporter-boeing.svg +++ b/public/images/supporters/supporter-boeing.svg @@ -1 +1 @@ -boeing_logo \ No newline at end of file +boeing_logo \ No newline at end of file diff --git a/public/images/supporters/supporter-ge.svg b/public/images/supporters/supporter-ge.svg index f273ab4..b312163 100644 --- a/public/images/supporters/supporter-ge.svg +++ b/public/images/supporters/supporter-ge.svg @@ -1,5 +1,5 @@ - + diff --git a/public/images/supporters/supporter-nist.svg b/public/images/supporters/supporter-nist.svg index 2444367..4c1ea00 100644 --- a/public/images/supporters/supporter-nist.svg +++ b/public/images/supporters/supporter-nist.svg @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/public/images/supporters/supporter-ribose.svg b/public/images/supporters/supporter-ribose.svg index b87bcba..1f64da2 100644 --- a/public/images/supporters/supporter-ribose.svg +++ b/public/images/supporters/supporter-ribose.svg @@ -1 +1 @@ -ribose logo normal \ No newline at end of file +ribose logo normal \ No newline at end of file diff --git a/scripts/assets.test.ts b/scripts/assets.test.ts new file mode 100644 index 0000000..4adfae4 --- /dev/null +++ b/scripts/assets.test.ts @@ -0,0 +1,32 @@ +import { describe, it, expect } from 'vitest' +import { readFileSync, readdirSync } from 'node:fs' +import { join } from 'node:path' + +// An -embedded SVG needs BOTH a viewBox (content scales) and explicit +// width/height (intrinsic size for layout). The regression this encodes: +// supporter-boeing/ribose shipped viewBox-only SVGs that collapsed to nothing +// under `w-auto` + height caps, and supporter-nist shipped width/height +// without a viewBox so its content rendered oversized. +describe('supporter logo assets', () => { + const dir = 'public/images/supporters' + const svgs = readdirSync(dir).filter((f) => f.endsWith('.svg')) + + it('has supporter SVGs to check', () => { + expect(svgs.length).toBeGreaterThan(0) + }) + + it('every SVG has a viewBox and explicit width/height', () => { + const offenders: string[] = [] + for (const file of svgs) { + const source = readFileSync(join(dir, file), 'utf-8') + const tag = source.match(/]*>/)?.[0] ?? '' + const hasViewBox = /viewBox="/.test(tag) + const hasWidth = /(? { ['supporter-boeing.svg', 'supporter-md.svg', 'supporter-ge.svg', 'supporter-nist.svg', 'supporter-pdes.png', 'supporter-steptools.svg', 'supporter-jotneconnect.svg', 'supporter-afnet.svg', 'supporter-ribose.svg'].map((logo) => ( - {logo.replace('supporter-', + {logo.replace('supporter-', )) } diff --git a/src/pages/supporters.astro b/src/pages/supporters.astro index f2b13fb..801d097 100644 --- a/src/pages/supporters.astro +++ b/src/pages/supporters.astro @@ -31,7 +31,7 @@ const supporters = [
- {supporter.name} + {supporter.name}

{supporter.name}

{supporter.desc}