Skip to content

base: Bundle IBM Plex Sans so the web examples resolve .SystemUIFont - #3235

Merged
madcodelife merged 1 commit into
mainfrom
mixboo/fix-website-motion-demo
Sep 25, 2026
Merged

madcodelife merged 1 commit into
mainfrom
mixboo/fix-website-motion-demo

Conversation

@ihavecoke

@ihavecoke ihavecoke commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

Summary

Since #3128 every "Rust & WASM" example under /base/ (motion, button, dialog, …) came up blank on the website, with the console full of RefCell already borrowed. The first error is a panic in TextSystem::resolve_font:

failed to resolve font '.SystemUIFont' or any of the fallbacks: .ZedMono, .ZedSans, Helvetica, ...

#3128 switched the examples' root font from Inter Variable to .SystemUIFont so the native binaries pick up the OS font. gpui-pre-web resolves that alias to "IBM Plex Sans" and starts with an empty font database, so the first text layout panicked and the canvas never painted. The bundled Inter no longer matched anything. This is the same failure #2933 fixed for the gallery; that PR left the base examples alone because they still rendered at the time.

  • crates/base/examples/showcase/mod.rs, crates/base/examples/motion/mod.rs: bundle the existing IBM Plex Sans subset from crates/story-web/fonts instead of Inter for the web build, so the alias resolves. Inter was not referenced by either example anymore; the wasm download shrinks by about 40 KB.
  • crates/story-web/scripts/subset-fonts.py: also scan crates/base/examples/motion when subsetting, so text added to that example stays covered.

How to Test

  1. cd crates/base/examples/wasm && make build, then bun run dev in website/ and open /base/motion and /base/primitives/button.
  2. Before: the example frame stays blank, the console shows the panic above followed by repeated RefCell already borrowed. Reproduced on https://gpui-kit.com/base/motion and /examples/base?component=button.
  3. After: the motion tabs and the button example render, with zero panics. Verified with headless Chromium (WebGPU) against the local dev server.
  4. rustfmt --check, typos and cargo clippy -p gpui-base-examples --all-targets -- --deny warnings are clean.

Checklist

  • I have read the CONTRIBUTING document and followed the guidelines.
  • Reviewed the changes in this PR and confirmed AI generated code (If any) is accurate.
  • Passed cargo run for story tests related to the changes.

Since #3128 every "Rust & WASM" example under /base/ on the website
came up blank, with the console full of "RefCell already borrowed".
The first error is a panic in TextSystem::resolve_font: the examples'
root font became `.SystemUIFont`, gpui-pre-web resolves that alias to
"IBM Plex Sans" and starts with an empty font database, so the first
text layout panicked and the canvas never painted. The bundled Inter no
longer matched anything.

Bundle the existing IBM Plex Sans subset from crates/story-web/fonts
instead of Inter for the web build (the same fix #2933 applied to the
gallery), and let subset-fonts.py scan the motion example too so its
text stays covered.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@madcodelife
madcodelife merged commit eabcb02 into main Sep 25, 2026
12 checks passed
@madcodelife
madcodelife deleted the mixboo/fix-website-motion-demo branch September 25, 2026 14:22
@longbridge longbridge deleted a comment from mixboo Sep 25, 2026
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.

2 participants