Skip to content

fix(ui): load Satoshi from a CDN that actually serves it - #295

Merged
hyperb1iss merged 2 commits into
mainfrom
nova/satoshi-actually-loads
Sep 15, 2026
Merged

hyperb1iss merged 2 commits into
mainfrom
nova/satoshi-actually-loads

Conversation

@hyperb1iss

@hyperb1iss hyperb1iss commented Sep 15, 2026

Copy link
Copy Markdown
Owner

The app's index.html asks Bunny Fonts for Satoshi, JetBrains Mono, and Sora in one request. Bunny does not carry Satoshi: the CSS it returns has @font-face rules for the other two and nothing for Satoshi, so every --font-sans and --font-display stack has fallen through to Inter (where installed) or the system sans since the fonts were introduced. The design system describes Satoshi as the interface typeface; the shipped app has never rendered in it.

💡 What changes

Satoshi now loads from Fontshare, the foundry's own CDN and the only one that serves it, as its variable face (weight axis 300 to 900, upright and italic). The variable face matters: static Satoshi has no 600 cut, and the app uses font-semibold on dozens of Satoshi-rendered elements, so a static request would have pushed all of them to 700 the moment the face started loading. JetBrains Mono and Sora stay on Bunny. Both Fontshare origins get a preconnect, since the stylesheet and the files live on different hosts and the CSS is on the critical path. The Tauri CSP gains https://api.fontshare.com under style-src and https://cdn.fontshare.com under font-src, and the packaging test asserts the new allowlist. The Zola docs template and the docs theme page make the same swap so the docs site matches the app. The design system's typography section now names the two sources, records why, and notes that every weight the scale asks for renders as a true instance.

🧪 Validation

  • cargo test -p hypercolor-app --test packaging_tests: 53 passed with the widened CSP expectations on both the base and macOS configs (run locally against a placeholder UI dist, the same way CI does).
  • cargo fmt --check clean on the test edit.
  • Fontshare's satoshi@1,2 request returns exactly two @font-face rules (upright and italic, font-weight: 300 900), every source on cdn.fontshare.com; Bunny returns zero rules for family=satoshi. The downloaded file carries a wght axis 300 to 900 (checked with fontTools).
  • Independent fresh-context review passed the CSP syntax, the origin coverage, and the doc consistency; its two notes (warm the stylesheet origin, the 600 weight fallout) are what the second commit addresses.
  • Not exercised here: a rebuilt Tauri bundle loading the face under the new CSP in a live WebView. The site repo's companion PR (hyperb1iss/hypercolor.lighting#77) self-hosts the same variable file and its dev server renders it, which covers the face itself but not the Tauri CSP path.

🤖 Generated with Claude Code

https://claude.ai/code/session_017QqD4e2C7kLCBtZBEfJyTx

index.html asked Bunny Fonts for Satoshi alongside JetBrains Mono and
Sora. Bunny does not carry Satoshi, so the returned stylesheet had no
faces for it and every --font-sans and --font-display stack fell
through to Inter or the system sans. The design system names Satoshi
as the interface typeface; the shipped app has never rendered in it.

Satoshi now loads from Fontshare at the cuts it ships (400/500/700/900;
there is no 600, so those requests resolve to 700). The other two
families stay on Bunny. Both Tauri CSPs allow api.fontshare.com for the
stylesheet and cdn.fontshare.com for the files, the packaging test
asserts the new allowlist, and the docs site template makes the same
swap so it matches the app. The design system records the two sources.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017QqD4e2C7kLCBtZBEfJyTx
@coderabbitai

coderabbitai Bot commented Sep 15, 2026

Copy link
Copy Markdown

Warning

Review limit reached

  • Run on-demand review

On-demand reviews are free for the next 5 days. After that, they cost $0.25 per reviewed file.

Or wait 43 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 5532f2b2-6076-446f-89fe-f50a10b1b13c

📥 Commits

Reviewing files that changed from the base of the PR and between 187a28a and fc3d94d.

📒 Files selected for processing (7)
  • crates/hypercolor-app/tauri.conf.json
  • crates/hypercolor-app/tauri.macos.conf.json
  • crates/hypercolor-app/tests/packaging_tests.rs
  • crates/hypercolor-ui/index.html
  • docs/DESIGN-SYSTEM.md
  • docs/content/theme/_index.md
  • docs/templates/base.html

Comment @coderabbitai help to get the list of available commands.

Static Satoshi ships no 600 cut, and the app uses font-semibold on
dozens of Satoshi-rendered elements, so the static request would have
pushed all of them to 700 the moment the face started loading. The
variable face carries a 300 to 900 weight axis, so 600 renders as a
true 600. The stylesheet origin gets its own preconnect: Fontshare
splits the CSS and the files across two hosts, and the CSS is on the
critical path before the browser can discover the file URLs.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017QqD4e2C7kLCBtZBEfJyTx
@hyperb1iss
hyperb1iss merged commit d6583f0 into main Sep 15, 2026
40 checks passed
@hyperb1iss
hyperb1iss deleted the nova/satoshi-actually-loads branch September 15, 2026 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant