Skip to content

fix(cli): doctor's theme font check counts a family any imported font stylesheet loads - #12090

Merged
josephfarina merged 2 commits into
mainfrom
josephfarina/doctor-local-theme-parent-fonts
Nov 16, 2026
Merged

josephfarina merged 2 commits into
mainfrom
josephfarina/doctor-local-theme-parent-fonts

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

User impact

A local theme built on an Astryx theme, such as one whose source extends neutral or a copy of neutral that theme eject makes, uses neutral's fonts but has no font stylesheet of its own. (A theme the theme editor makes writes its own font stylesheet, so it is not affected.) An app that adds both themes imports neutral's font stylesheet once, from the generated theme module, and that stylesheet loads the fonts for both. astryx doctor still warns about the local theme:

theme-fonts  warn  Added themes name font families but import no font stylesheet (team-purple: Figtree (font stylesheet is not imported)).
             Fix: Add <slug>.fonts.css beside each built local theme output, then astryx theme add team-purple.

The fonts load, so there is nothing to fix. People and agents follow the fix anyway and copy neutral's font stylesheet into the local theme by hand, which then has to be kept in step with neutral's.

After this change, a family that any font stylesheet the generated module imports loads counts as loaded for every added theme, and the check passes:

theme-fonts  pass  Every named non-system font is loaded by an @font-face rule or a font service URL that names it.

A family that no imported font stylesheet loads still gets the warning.

Problem and solution fit

  1. Why does it happen? The check proves each theme's families only from that theme's own font stylesheet. A theme with none is reported at once, without looking at the font stylesheets the module imports for the other themes.
  2. Why does it harm the task? Every app with a custom theme built on an Astryx theme gets a warning on a correct setup, and its fix adds a copied file the app does not need.
  3. Why does that matter? A custom brand theme built on neutral is the common way to theme an app.

All the stylesheets the generated module imports load in the app at once, so a family one of them loads is loaded for every theme in the app. The check now gathers the families from every font stylesheet the module imports, then judges each theme's families against them; a theme's own font stylesheet still decides the message when a family is missing.

Expected behavior and authority

  • spec:AST-050 FR11 check 9: every font family an added theme names is a system font or is loaded by a font stylesheet the module imports. The module imports every added theme's font stylesheet, so a family any of them loads meets the claim as written; no record changes.

Smallest restoration

  • api/doctor/theme-checks.mjs: before judging each theme, the check reads every font stylesheet the generated module imports once, gathers the families they load, and leaves those families out of each theme's unloaded ones. A theme whose own imported font stylesheet cannot be parsed is still reported, whatever the other stylesheets load.

Evidence

  • Reproduction: an app that an agent built with the neutral theme and a local team-purple theme that extends neutral, checked by the current canary installed for the computer. Before: theme-fonts warn "Added themes name font families but import no font stylesheet (team-purple: Figtree (font stylesheet is not imported))."
  • Result with only api/doctor/theme-checks.mjs replaced in that copy: theme-fonts pass. No other check changed.
  • Regression tests: a theme whose family another added theme's font stylesheet loads passes; a theme that names a covered and an uncovered family still warns, naming only the uncovered one; an imported font stylesheet that cannot be parsed still fails, though another theme's stylesheet loads its family.

Scope

Components: CLI (doctor's theme font check)

  • One defect is restored.
  • Separable contradictory or unsettled tagalongs were removed or split.
  • No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
  • Public text and artifacts contain no internal Meta context.

Testing

  • vitest run --project node packages/cli/api/doctor/theme-checks.test.mjs: 77 passed, on main after the latest theme-check changes. The new pass test fails on main's check.
  • ESLint and Prettier on the changed files.

@vercel

vercel Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 16, 2026 3:43pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 16, 2026
@astracat-bot

astracat-bot Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 16, 2026, 3:53 PM UTC

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested: the doctor fix matches the app-theme spec and its tests pass, but the release note names a case the change does not affect.

  • The changeset (and the description's User impact) says a theme made with the theme editor ships no font stylesheet and got the "import no font stylesheet" warning, but the editor's app copy always writes <slug>.fonts.css, which imports the base theme's font stylesheet on neutral, so doctor already passed those themes; please drop the editor from that sentence and say that theme eject copies a theme rather than extends it, for example: "A local theme built on neutral, such as one whose source extends neutral or a copy that theme eject makes, names neutral's fonts but ships no font stylesheet of its own."

Two non-blocking points: when another theme's stylesheet loads every family a theme names, that theme's own imported font stylesheet is no longer reported if it cannot be parsed, although the comment at theme-checks.mjs:1897 says it is. The new warn test would also pass without the message narrowing; a theme that names one covered and one uncovered family would pin it down.

Claims and files checked

Review mode: full; reason: no-earlier-review

  • Claim: doctor counts a family as loaded when any font stylesheet the generated module imports loads it. Verified: theme-checks.mjs:1882-1912; the new pass test fails before the change and passes after it.
  • Claim: a local theme made with theme eject names neutral's fonts and ships no font stylesheet. Verified: eject copies only the theme's source files. False in part: eject makes an independent copy, not an extension.
  • Claim: a theme made with the theme editor ships no font stylesheet of its own. False: the editor's app copy always writes <slug>.fonts.css (theme-edit/_preview.mjs:2189-2193, theme-hunt62.test.mjs:102-110), and an editor theme on neutral passes before and after this change.
  • Claim: before the change, doctor warned with the quoted message even though the module imported neutral's font stylesheet. Verified for a local theme without a font stylesheet, on a fixture app.
  • Claim: a family that no imported font stylesheet loads still warns. Verified: theme-checks.test.mjs:1717-1733 and a fixture app.
  • Claim: every font stylesheet the generated module imports loads at once, so a family that one of them loads is loaded for every theme. Verified: the app-theme spec's FR9 and FR11 check 10, and the generated module's static imports.
  • Claim: after the change the check passes with the quoted message. Verified on a fixture app.
  • Claim: every app with a custom theme built on an Astryx theme gets a warning on a correct setup. Verified for apps that add both themes, the scenario the description gives; an app with only the custom theme still warns, which is correct.
  • Claim: the spec's FR11 check 9 accepts a family loaded by any imported font stylesheet, and no record changes. Verified.
  • Claim: only theme-checks.mjs changes behavior, and no other check changes. Verified: the other check results are the same on a fixture app.
  • Claim: the regression tests cover the pass case and the warn case. Verified; the warn test does not test the narrowed message (non-blocking).
  • Claim: 73 tests pass, and the new pass test fails without the change. Verified.
  • Claim: ESLint and Prettier pass on the changed files. Verified.
  • Claim: no new public API, default or interaction model. Verified: no command, option or export changes.
  • Claim: public text has no internal context. Verified.
  • Claim: a custom brand theme built on neutral is the common way to theme an app. Context: matches the theme docs' advice to extend a package theme.
  • File .changeset/doctor-fonts-from-any-imported-stylesheet.md: blocking finding (the theme-editor claim).
  • File packages/cli/api/doctor/theme-checks.mjs: matches FR11 check 9; non-blocking note about the unparseable-stylesheet comment.
  • File packages/cli/api/doctor/theme-checks.test.mjs: clear; non-blocking suggestion to test the narrowed message.

Automated review (maintainer link)

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending CI: CI has not run on this head yet.

The doctor font-check change matches the app-theme spec, and the earlier points are addressed: the release note no longer names theme-editor themes, an imported font stylesheet that cannot be parsed fails again, and the warn test now pins the narrowed message.

Claims and files checked

Review mode: full; reason: rebase

  • Claim: doctor's theme font check counts a family as loaded when any font stylesheet the generated theme module imports loads it. Verified: theme-checks.mjs:1887-1908 and :1928-1931; test theme-checks.test.mjs:1747-1761.
  • Claim: a local theme built on neutral, by extending it or as a theme eject copy, names neutral's fonts but ships no font stylesheet. Verified: theme build writes no font stylesheet (build.mjs:5880-5894 only warns about side-effect stylesheets), and the bundled neutral copy that eject writes has no fonts.css.
  • Claim: a theme the theme editor makes writes its own font stylesheet, so it is not affected. Verified: the editor always writes <slug>.fonts.css (theme-edit/_preview.mjs:2333-2337, theme-app-copy-written-around.test.mjs:104-112).
  • Claim: an app that adds both themes imports neutral's font stylesheet from the generated module, which loads the fonts for both. Verified: the module imports each added theme's font stylesheet (theme-state.mjs:452-454); neutral's stylesheet requests Figtree from a font service.
  • Claim: before the change, doctor warned with the quoted "import no font stylesheet" message on that setup. Verified on a test app with a local theme beside its parent theme.
  • Claim: after the change the check passes with the quoted message. Verified on the same test app; message at theme-checks.mjs:2059-2060.
  • Claim: a family that no imported font stylesheet loads still gets the warning. Verified: theme-checks.test.mjs:1786-1802, and a local theme without its parent still warns.
  • Claim: the check proved each theme's families only from its own font stylesheet, and reported a theme with none at once. Verified: base theme-checks.mjs:1891-1900.
  • Claim: every app with a custom theme built on an Astryx theme gets a warning on a correct setup. Verified for apps that add both themes, the scenario the description gives; an app with only the custom theme still warns, which is correct.
  • Claim: a custom brand theme built on neutral is the common way to theme an app. Context: the theme docs advise extending a package theme.
  • Claim: all font stylesheets the module imports load at once, so a family one loads is loaded for every theme. Verified: the app-theme spec's FR9 and FR11 check 10, and the module's static imports.
  • Claim: the app-theme spec's FR11 check 9 accepts a family loaded by any imported font stylesheet, and no record changes. Verified.
  • Claim: each imported font stylesheet is read once, and a theme whose own imported font stylesheet cannot be parsed is still reported. Verified: theme-checks.mjs:1894-1908, :1921-1927; test theme-checks.test.mjs:1763-1784.
  • Claim: only theme-checks.mjs changes behavior, and no other check changes. Verified: the diff touches only the font block of checkAppThemes.
  • Claim: the regression tests cover the pass case, the covered-plus-uncovered warn case and the unparseable stylesheet. Verified; the first two fail before the change.
  • Claim: 77 tests pass, and the new pass test fails on main's check. Verified.
  • Claim: ESLint and Prettier pass on the changed files. Verified.
  • Claim: no new public API, default or interaction model, and no internal context in public text. Verified.
  • File .changeset/doctor-fonts-from-any-imported-stylesheet.md: clear.
  • File packages/cli/api/doctor/theme-checks.mjs: clear; matches the app-theme spec's font check.
  • File packages/cli/api/doctor/theme-checks.test.mjs: clear.

Automated review (maintainer link)

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 370aab2

Storybook · Sandbox · built from this PR's head

Package size: measured; main has no measurement of the merge base to compare yet.

API changes: unknown (base surface unavailable): richtext, theme-butter, theme-chocolate, theme-gothic, theme-matcha, theme-neutral, theme-stone, theme-y2k

Not run on this PR: add ci:run-visual for Visual, ci:run-a11y for Accessibility, ci:run-rtl for RTL.


Generated by PR Enrichment workflow | View full report

@josephfarina
josephfarina merged commit 9a47fff into main Nov 16, 2026
172 of 184 checks passed
@github-actions
github-actions Bot deleted the josephfarina/doctor-local-theme-parent-fonts branch November 17, 2026 06:03

This branch was successfully deployed

1 active deployment
Preview — 370aab26 Deployed Nov 16, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant