Repository navigation
docs(core): the typography note says how a heading's font list is built - #11786
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
There was a problem hiding this comment.
Changes requested: the new note matches what Core builds, but one claim in the description is not accurate.
- The description says defineTheme's doc and the font-setup docs agree that a heading with a
familytakes only its ownfallbacks, butdefineTheme.ts:303-304andfont-setup.doc.mjs:48only say that heading inherits from body when omitted, andfonts-and-assets.doc.mjs:24says heading inheritsfamilyandfallbacksfrombodywhen you omit them.
To resolve it, either reword that sentence to rest on resolveThemeValues.ts:248-251 and its tests, or bring those two docs in line in this pull request. Separately, the heading property doc at types.ts:74 keeps the old wording and names a url field that TypographyRole does not have; editors show it on typography.heading, so it is worth aligning too (non-blocking). Built output and the public API are unchanged.
Claims and files checked
Review mode: full; reason: no-earlier-review
- Claim: the old note overstated heading inheritance: verified (a heading that sets only
familygets no body fallbacks;resolveThemeValues.ts:249-251). - Claim: a heading with no
familytakes body's whole font list: verified (resolveThemeValues.ts:248-251;defineTheme.test.ts:1018). - Claim: a heading with a
familytakes only its ownfallbacks: verified (resolveThemeValues.ts:163-175;defineTheme.test.ts:1037). - Claim:
fallbackswith nofamilybuild nothing: verified (resolveThemeValues.ts:167-169;themeAdaptations.test.ts:1563). - Claim: the note now says exactly that: verified (
types.ts:52-54). - Claim: defineTheme's doc and the font-setup docs agree on both cases: false for the case with a
family(defineTheme.ts:303-304,font-setup.doc.mjs:48,fonts-and-assets.doc.mjs:24). - Claim: docs only, no output change: verified (built JavaScript and all seven theme stylesheets are identical; only the declaration comment differs).
- Changeset: the
TypographyConfignote says what Core builds in the three cases: verified (types.ts:52-54againstresolveThemeValues.ts:248-251). - File
.changeset/core-typography-heading-doc.md: clear. - File
packages/core/src/theme/types.ts: the changed note is clear; the unchangedheadingproperty doc at line 74 disagrees with it (non-blocking).
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| charts/Chart | 237.4 kB (0) · 516 B CSS (0) | — | — · — · — |
| Lightbox | 145.8 kB (0) · 11.9 kB CSS (0) | — | — · — · — |
| Markdown | 201.9 kB (0) · 21.7 kB CSS (0) | — | — · — · — |
6 more components
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| Overlay | 23.0 kB (0) · 3.9 kB CSS (0) | — | — · — · — |
| Toast | 103.5 kB (0) · 11.1 kB CSS (0) | — | — · — · — |
| lab/Comments | 369.5 kB (0) · 2.5 kB CSS (0) | — | — · — · — |
| lab/CommentThread | 362.1 kB (0) · 2.4 kB CSS (0) | — | — · — · — |
| lab/DialogHeroHeader | 88.4 kB (0) · 372 B CSS (0) | — | — · — · — |
| lab/ListInput | 93.4 kB (0) · 922 B CSS (0) | — | — · — · — |
Package size:
- @astryxdesign/cli 4.63 MB packed (+70 B); no new dependencies
- @astryxdesign/core 7.59 MB packed (+144 B); no new dependencies
Wide change (shared styles: packages/core/src/theme/defineTheme.ts, packages/core/src/theme/types.ts): add ci:run-visual, ci:run-a11y or ci:run-rtl to run them.
Generated by PR Enrichment workflow | View full report
There was a problem hiding this comment.
Changes requested: the new wording matches what Core builds, but two claims about which docs carry it are not accurate at this head.
- The description says the change brings every typography doc in line with what Core builds, while the annotated theme template that
astryx theme templateandastryx init --features themewrite into a project (packages/cli/assets/theme.template.ts:155-157) still says "heading inherits family and fallbacks from body when omitted", so an author who copies it still expects body's fallbacks forheading: {family: 'Fraunces'}and ships a heading with none. - The changeset says the
font-setuppage says the rule, butpackages/cli/assets/docs/tree/font-setup.doc.mjs:48now only points tofonts-and-assets, so a reader following the release note will look for a rule that page no longer carries.
Either claim can be met from both ends: give the template's typography block the same one-rule sentence, and say in the changeset that font-setup points to fonts-and-assets. Non-blocking: astryx docs typography/font-setup is where a product builder asks about font families, and one clause inline would answer it there rather than sending them to the theme-packaging guide. Built JavaScript, every published theme's stylesheet and the public API surface are unchanged, and the updated search goldens match the CLI's real output (396 matches on main, 395 here).
Claims and files checked
Review mode: incremental; reason: none
- Claim: a heading's list is the heading's own family and fallbacks, else body's whole list: verified (
resolveThemeValues.ts:248-251). - Claim: a family-less role builds nothing: verified (
resolveThemeValues.ts:167-169). - Claim: a heading with no
familytakes body's whole font list: verified (probe on the head build;defineTheme.test.ts:1016-1033). - Claim: a heading with its own
familytakes only its ownfallbacks: verified (probe:{family: 'Fraunces'}givesFraunces;defineTheme.test.ts:1051-1063). - Claim:
fallbackswith nofamilybuild nothing: verified (probe;defineTheme.test.ts:1061). - Claim: the
TypographyConfignote, theheadingproperty doc and its strayurlmention, anddefineTheme'stypographyare updated: verified (types.ts:52-54,:74-78,defineTheme.ts:303-306;TypographyRolehas onlyfamily,fallbacks,weight,weights). - Claim: the CLI's
font-setupandfonts-and-assetsdocs are updated: verified that both changed. - Claim: every typography doc is in line with what Core builds: false (
packages/cli/assets/theme.template.ts:155-157). - Changeset claim:
font-setupstates the rule: false (font-setup.doc.mjs:48points tofonts-and-assets). - Claim: docs only, no output change: verified (built JavaScript and all seven theme stylesheets identical; only declaration comments differ; 0 public API rows).
- Claim: the typography font-family tests pin all three cases: verified (
defineTheme.test.ts:1016-1063, passing at this head). - Claim: doc tests, prettier, eslint and changesets are clean: verified (6 test files, 238 tests passing;
prettier --checkclean; eslint 0 errors; changeset check exit 0). - File
.changeset/core-typography-heading-doc.md: finding (thefont-setupcredit); category and both package bumps are valid. - File
packages/cli/assets/docs/tree/font-setup.doc.mjs: non-blocking note (the rule is replaced by a pointer; the link target resolves). - File
packages/cli/assets/docs/tree/fonts-and-assets.doc.mjs: clear. - Files
packages/cli/test/__golden__/no-icon-set/search-icon-set.jsonand.txt: clear (the 396 to 395 drop reproduces on the two trees). - File
packages/core/src/theme/defineTheme.test.ts: clear (the new case asserts the absence of body fallbacks, which no earlier test did). - File
packages/core/src/theme/defineTheme.ts: clear. - File
packages/core/src/theme/types.ts: clear.
…n their own words
There was a problem hiding this comment.
Approved pending CI: CI has not finished on this head yet.
The typography type docs, the fonts-and-assets and font-setup pages and the annotated theme template now describe the heading font list exactly as defineTheme builds it, and every claim in the description and changeset checks out. Nothing else is needed from you.
Claims and files checked
Review mode: incremental; reason: none
- Claim: a heading with its own family builds from its own family and fallbacks, a heading without one takes the body's whole list, and fallbacks with no family build nothing. Verified:
resolveThemeValues.ts:163-175,:248-251. - Claim: the
TypographyConfignote states the rule. Verified:types.ts:52-54. - Claim: the
headingproperty doc states it and no longer names aurlfield. Verified:types.ts:74-78;TypographyRole(types.ts:36-45) has nourl. - Claim:
defineTheme'stypographydoc states it. Verified:defineTheme.ts:303-306. - Claim: the
fonts-and-assetspage states it. Verified:fonts-and-assets.doc.mjs:24. - Claim: the theme template that
theme templateandinit --features themewrite states it. Verified:theme.template.ts:157-159. - Claim:
font-setupgets one clause and a link for the rest. Verified:font-setup.doc.mjs:48. - Claim: docs only, with no output change. Verified: Core's built JavaScript and the seven published themes are identical to the base, and the API surface has no changes.
- Claim: the font-family tests pin all three cases, with one new test. Verified:
defineTheme.test.ts:1017-1062; the file's 147 tests pass. - Claim: the doc compiler and authoring self-docs tests pass, and prettier, eslint and the changeset check are clean. Verified: each passes at this head.
- Changeset claim: the one rule matches what Core builds. Verified, as above.
- Changeset claim: the type docs,
defineTheme,fonts-and-assetsand the theme template state it. Verified, as above. - Changeset claim:
font-setupsays a heading with no family uses the body's and links tofonts-and-assets. Verified:font-setup.doc.mjs:48. - Changeset claim: patch releases for core and cli. Verified: both packages change, and the changeset check passes.
- Files, all clear:
.changeset/core-typography-heading-doc.md,packages/cli/assets/docs/tree/font-setup.doc.mjs,packages/cli/assets/docs/tree/fonts-and-assets.doc.mjs,packages/cli/assets/theme.template.ts,packages/cli/test/__golden__/no-icon-set/search-icon-set.json,packages/cli/test/__golden__/no-icon-set/search-icon-set.txt,packages/core/src/theme/defineTheme.test.ts,packages/core/src/theme/defineTheme.ts,packages/core/src/theme/types.ts.
Summary
Brings every typography doc in line with what Core builds (
buildFontFamilyTokensin resolveThemeValues.ts: a heading's list isbuildFontFamily(heading.family, heading.fallbacks) ?? body, andbuildFontFamilyreturns nothing without a family): a heading with nofamilytakes the body's whole font list, with its ownfamilyonly its ownfallbacks, andfallbackswith nofamilybuild nothing.Updated: the
TypographyConfignote and theheadingproperty JSDoc in types.ts (which also named aurlfield the role doesn't have), thetypographyJSDoc in defineTheme.ts, the CLI's fonts-and-assets doc (which owns the rule), the annotated theme template thatastryx theme templateandastryx init --features themewrite into projects, and font-setup (one clause, plus a link to fonts-and-assets for the rest). Docs only; no output change.Tests
defineTheme.test.ts's typography font-family tests pin all three cases (one new test covers a heading with its own family and a role with fallbacks but no family). doc-compiler and authoring-self-docs pass; prettier, eslint and changesets clean.
@josephfarina