Fix project design system typography font loading - #6291
Conversation
|
Thanks @iviaxpow3r — this is a nicely scoped fix for a real user-facing typography regression. One small PR-body follow-up before the review queue moves along: could you add the Also, this touches runtime behavior that should get a QA pass before merge, so please hold off self-merging for now — we’ll queue QA once the PR is merge-ready. |
PerishCode
left a comment
There was a problem hiding this comment.
The font normalization and MIME additions address the reported path, but the new same-family merge rule regresses explicit typography edits by treating list length as field presence. The inline comment identifies the required merge behavior and regression coverage.
🔁 Powered by Looper · runner=reviewer · agent=codex · An autonomous AI dev team for your GitHub repos.| ...overlayFont, | ||
| family: baseFont.family, | ||
| fallbacks: overlayFont.fallbacks.length > baseFont.fallbacks.length ? overlayFont.fallbacks : baseFont.fallbacks, | ||
| weights: overlayFont.weights.length > baseFont.weights.length ? overlayFont.weights : baseFont.weights, |
There was a problem hiding this comment.
Preserve missing metadata, but do not discard explicit shorter edits. These comparisons use array length as a proxy for whether the markdown supplied a value, so a same-family edit from weights [400, 700] to [400], or from four fallbacks to one intentional fallback, silently keeps the stale brand.json value. That contradicts this function's documented field-by-field overlay contract: only a missing or empty overlay field should retain the base value. Use overlayFont.fallbacks.length > 0 ? overlayFont.fallbacks : baseFont.fallbacks and the equivalent check for weights, then add regression cases where a non-empty overlay has equal/fewer entries and must win.
|
Hey @iviaxpow3r — @PerishCode has the current blocking review on this head, and the inline note there is the right place to start: the same-family merge should preserve missing metadata without letting shorter explicit markdown edits get overwritten by stale While you’re in there, could you also update the PR body with the
|
Summary
brand.jsonfont metadata whenDESIGN.mdrepeats the same family with partial/punctuated valuesWhy
Custom design systems can have correct font metadata and local font files, but the Design System tab may still render fallback fonts when parsed
DESIGN.mdtypography overrides the richer extracted font objects. In the Content Jams design system, markdown parsing produced family values likeNunito Sans,/JetBrains Mono,and dropped Google Fonts URLs, weights, and fallback metadata. Project.woff2assets were also served asapplication/octet-stream.Verification
pnpm --filter @open-design/web test tests/runtime/design-kit.test.tspnpm --filter @open-design/web typecheckpnpm --filter @open-design/daemon test tests/project-raw-cache.test.tspnpm --filter @open-design/daemon typecheckpnpm guardgit diff --checkManual validation: verified the Content Jams design-system Typography tab in the dev app renders the intended fonts after the source fix.