Let the browser discover the primary font from server-rendered HTML instead of waiting for stylesheet discovery.
Preload only the regular (400) face of the configured bundled font.
Prefer the configured custom font file when present; emit no hint for an unknown family without a custom file.
Use as="font", type="font/woff2", and anonymous CORS so CSS can reuse the preload.
Leave other weights, fallback fonts, font styling, and font-display: swap unchanged.
Include a patch changeset for @when/web.
This is the fonts-only follow-up to #119. CSS, avatar, and timezone changes remain separate. No PageSpeed score improvement is claimed before deployment and measurement.
Validation
35 targeted unit tests passed (font selection, appearance, and the updated admin-health fixture).
Chromium E2E passed with JavaScript disabled: exactly one font preload is present in the initial HTML; the regular face is requested once; no unrelated font family is fetched.
Svelte check: 0 errors and 0 warnings.
Prettier, targeted ESLint, and git diff --check passed.
## Summary
Let the browser discover the primary font from server-rendered HTML instead of waiting for stylesheet discovery.
- Preload only the regular (400) face of the configured bundled font.
- Prefer the configured custom font file when present; emit no hint for an unknown family without a custom file.
- Use `as="font"`, `type="font/woff2"`, and anonymous CORS so CSS can reuse the preload.
- Leave other weights, fallback fonts, font styling, and `font-display: swap` unchanged.
- Include a patch changeset for `@when/web`.
This is the fonts-only follow-up to #119. CSS, avatar, and timezone changes remain separate. No PageSpeed score improvement is claimed before deployment and measurement.
## Validation
- 35 targeted unit tests passed (font selection, appearance, and the updated admin-health fixture).
- Chromium E2E passed with JavaScript disabled: exactly one font preload is present in the initial HTML; the regular face is requested once; no unrelated font family is fetched.
- Svelte check: 0 errors and 0 warnings.
- Prettier, targeted ESLint, and `git diff --check` passed.
Independent agent code and readability reviews completed for the original change (dbf71e2), followed by separate verification of the review fixes now pushed as 4be6755.
Findings addressed:
Guard bundled-font lookups with Object.hasOwn. Configuration names such as constructor and __proto__ now behave as unknown families rather than crashing page loads. Regression tests added.
Strengthen the Chromium E2E: require a successful font response, a loaded regular Noto Sans FontFace, that family in the body's computed style, and a single request. The earlier request-count-only test did not establish successful CSS consumption.
Update the existing patch changeset.
Both follow-up reviews reported no remaining actionable code or readability findings.
Revalidation: 37 targeted unit tests and the strengthened Chromium E2E passed; Svelte check reported zero errors/warnings; targeted Prettier, ESLint, and diff checks passed.
Performance limitation remains: earlier font discovery and request reuse are verified, but no improved Lighthouse/PageSpeed score has been measured. This hint does not reduce font bytes or JavaScript blocking time, and can compete with other critical resources; score impact still needs deployment/controlled measurement.
Independent agent code and readability reviews completed for the original change (`dbf71e2`), followed by separate verification of the review fixes now pushed as `4be6755`.
Findings addressed:
- Guard bundled-font lookups with `Object.hasOwn`. Configuration names such as `constructor` and `__proto__` now behave as unknown families rather than crashing page loads. Regression tests added.
- Strengthen the Chromium E2E: require a successful font response, a loaded regular Noto Sans FontFace, that family in the body's computed style, and a single request. The earlier request-count-only test did not establish successful CSS consumption.
- Update the existing patch changeset.
Both follow-up reviews reported no remaining actionable code or readability findings.
Revalidation: 37 targeted unit tests and the strengthened Chromium E2E passed; Svelte check reported zero errors/warnings; targeted Prettier, ESLint, and diff checks passed.
Performance limitation remains: earlier font discovery and request reuse are verified, but no improved Lighthouse/PageSpeed score has been measured. This hint does not reduce font bytes or JavaScript blocking time, and can compete with other critical resources; score impact still needs deployment/controlled measurement.
eleith
merged commit 4be6755eb8 into main2026-11-02 23:25:04 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Let the browser discover the primary font from server-rendered HTML instead of waiting for stylesheet discovery.
as="font",type="font/woff2", and anonymous CORS so CSS can reuse the preload.font-display: swapunchanged.@when/web.This is the fonts-only follow-up to #119. CSS, avatar, and timezone changes remain separate. No PageSpeed score improvement is claimed before deployment and measurement.
Validation
git diff --checkpassed.Independent agent code and readability reviews completed for the original change (
dbf71e2), followed by separate verification of the review fixes now pushed as4be6755.Findings addressed:
Object.hasOwn. Configuration names such asconstructorand__proto__now behave as unknown families rather than crashing page loads. Regression tests added.Both follow-up reviews reported no remaining actionable code or readability findings.
Revalidation: 37 targeted unit tests and the strengthened Chromium E2E passed; Svelte check reported zero errors/warnings; targeted Prettier, ESLint, and diff checks passed.
Performance limitation remains: earlier font discovery and request reuse are verified, but no improved Lighthouse/PageSpeed score has been measured. This hint does not reduce font bytes or JavaScript blocking time, and can compete with other critical resources; score impact still needs deployment/controlled measurement.