fix(delivery): stop delivered HTML from requesting Google Fonts - #249
fix(delivery): stop delivered HTML from requesting Google Fonts#249shahidbeig-a11y wants to merge 4 commits into
Conversation
76b7d1e to
bc5323d
Compare
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bc5323d7cb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| /* Offline-first typography: prefer a locally installed JetBrains Mono and | ||
| fall through to the system monospace stack. Delivered HTML must not | ||
| request third-party font hosts. */ | ||
| @font-face { font-family: 'JetBrains Mono'; font-weight: 400; src: local('JetBrains Mono'), local('JetBrainsMono-Regular'); } |
There was a problem hiding this comment.
Rebuild the distributed artifacts after changing the template
Changing the authoritative template without regenerating the checked-in examples and archify.zip leaves this commit unable to pass its repository gates: archify/test/golden.mjs rejects all five stale example renders, while the CI zip-freshness job rebuilds and byte-compares the archive. The archive in this commit also still embeds the removed Google Fonts links, so users installing the documented ZIP distribution do not receive the fix; regenerate the golden examples and then rebuild archify.zip.
Useful? React with 👍 / 👎.
2c2d50b to
f3646a0
Compare
Replace async Google Fonts links in the viewer template with offline-first local() @font-face declarations and the existing system monospace fallback stack. Add a regression test that asserts the template and deliver output request no Google Font hosts. Fixes tt-a1i#242 Co-authored-by: shahidbeig-a11y <shahidbeig-a11y@users.noreply.github.com>
Refresh the five golden HTML examples in archify/examples and examples, plus examples/web-app.html for template freshness, and rebuild archify.zip so golden.mjs and zip-freshness CI pass with the offline-first font stack. Co-authored-by: shahidbeig-a11y <shahidbeig-a11y@users.noreply.github.com>
f3646a0 to
f28069d
Compare
|
Hi! I verified both open fixes for #242 locally (this PR and #256) to help move the decision along. Environment: macOS arm64, Node v24.19.0, checked out at head What works
I saw the PR body notes that gallery artifacts, README proof media, and the checkout delta are deliberately not regenerated here. The catch is that One design question The replacement Happy to re-run anything. |
Refresh checked-in gallery artifacts, checkout compare artifact/receipt, and README proof media so gallery.test.mjs and architecture-delta.test.mjs pass against the offline-first font template. Co-authored-by: shahidbeig-a11y <shahidbeig-a11y@users.noreply.github.com>
Drop hosted font links from scripts/gallery-template.html in favor of offline-first local() JetBrains Mono and system display/body stacks, then regenerate docs/gallery.html. Co-authored-by: shahidbeig-a11y <shahidbeig-a11y@users.noreply.github.com>
Problem and value
Fixes #242
Delivered diagram HTML linked
fonts.googleapis.comandfonts.gstatic.com, so air-gapped or offline viewers silently fell back to different typography with no diagnostic. The SVG export path already used offline-firstlocal()faces; this applies the same contract to delivered HTML.Scope
<link>tags fromarchify/assets/template.html.@font-facerules that prefer locally installed JetBrains Mono and fall through to the existing system monospace stack.archify/test/offline-typography.test.mjsto assert the template anddeliveroutput request no Google Font hosts.archify/examples/+examples/),examples/web-app.html(template freshness), andarchify.zipsogolden.mjsand zip-freshness CI pass.Stability impact
Tests run
node --test test/offline-typography.test.mjs— 2 passed, 0 failed.node test/golden.mjs— all checks passed (10 golden renders, 9 schema enforcement, 2 template freshness, 7 version sync).scripts/build-zip.sh /tmp/archify-built.zipthencmp -s /tmp/archify-built.zip archify.zip— match.node bin/archify.mjs deliver architecture examples/web-app.architecture.json /tmp/issue-242-after.html --jsonthenrg -c "fonts\.googleapis|fonts\.gstatic" /tmp/issue-242-after.html→ 0 matches.Visual evidence
Not applicable. Font-loading contract only; diagram geometry and viewer behavior are unchanged.
Before (template on
main): 3 Google Font host references (fonts.googleapis.com,fonts.gstatic.com).After (
deliveroutput): 0 external font host references; offline-first@font-facewithlocal()sources.Generated artifacts
archify/examples/*.html(5 golden examples)examples/*.html(5 golden examples +web-app.html)archify.zipChecklist
npm testinarchify/.