Skip to content

fix(core): a theme value left undefined in a part or surface is not set - #11760

Merged
josephfarina merged 13 commits into
mainfrom
core-theme-undefined-decl
Nov 14, 2026
Merged

josephfarina merged 13 commits into
mainfrom
core-theme-undefined-decl

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A theme value left undefined inside a component block, a pseudo-class block or an onDark/onLight surface was written into the stylesheet as the text undefined, which the browser drops. And a child theme's undefined property replaced the value it inherits from its base, because component maps merged with object spread.

Now undefined means "not set" everywhere, as it already does for page tokens:

  • joinDeclarations and the component emit skip an undefined value; a pseudo-class block left empty writes no rule; the token cascade skips undefined, as its comment requires.
  • deepMergeComponents drops a child's own undefined properties before it merges, in style keys and color-mode blocks, so the base's value stays ("explicit values win": undefined is not explicit). A restated pseudo-class block replaces the base's block whole, as before; an undefined value inside it is not set.
  • An adaptation rule's part value left undefined is not set (a null there is still refused).
  • One normalizer drops an undefined component, style key or property wherever component maps are read (merge, each resolved layer, emit), so components: {card: {base: undefined}} builds nothing instead of throwing a TypeError, and a component, style key or color-mode block whose every value is undefined is dropped too (so it writes no Text/Heading/Link override rules). A restated pseudo-class block whose every value is undefined stays, empty: it still replaces the inherited one whole, and its component still counts as themed. An adaptation rule's type-scale leaf left undefined is no authored write, so an earlier rule's value stands.

null keeps its meaning: it replaces an inherited value and is written as it is, as page tokens do today.

Tests

generateThemeRules.test.ts: part, pseudo-class and surface undefined values write no : undefined;, no empty :hover {} and no diagnostic; a child's undefined button.base.padding keeps the base's 8px in theme.components and in the CSS. A @dark inheritance case and null cases at the merge and emit levels; themeAdaptations.test.ts covers rules. Each undefined case fails without the fix. packages/core/src/theme passes: 31 files, 1,800 tests. tsc, eslint and prettier clean.

One record line in architecture:theme-authoring-contract: "A component, style key, or value left undefined in a component block, pseudo-class block, color-mode block, surface, or adaptation rule is not set: in a style key or a color-mode block the inherited value stays, and a restated pseudo-class block replaces the inherited one whole. null keeps its existing meaning."

Writing rubric results

  • R1 narration: none; the sentence states what the system does, in the present tense.
  • R2 research: none.
  • R3 evidence: none; no pull request, issue or commit cited.
  • R4 rejected alternatives: none.
  • R5 change references: none.
  • R6 open questions: none.
  • R7 project status: none.

@josephfarina

… or surface is not set, as a page token's is

The stylesheet writes nothing for it and an inherited value for that property stays; before, it wrote the text 'undefined', which the browser drops.
@vercel

vercel Bot commented Nov 14, 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 14, 2026 8:15pm UTC

Request Review

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

astracat-bot Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 14, 2026, 8:20 PM UTC

…t, as everywhere else; null is still refused

@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.

This needs an owner decision before it can be approved, and one fix.

No current record says whether an undefined value in a theme's component block (a part, a pseudo-class block, an @light/@dark block, a media surface or an adaptation rule) means "not set", so approval waits on an engineering owner settling that rule; an engineering owner records it by commenting /approve-spec <full head SHA> on this pull request, and the author may do so as an engineering owner.

Blocking

  • The release note and the mergeComponents.ts header say an inherited value stays, but an undefined inside an @light/@dark block still erases the inherited mode value (mergeComponents.ts:64-69) and a restated pseudo-class block still replaces the inherited block whole, so filter undefined in the color-mode merge, add a @dark case to the inheritance test, and narrow the release note for pseudo-class blocks.

Also worth updating with the fix: the description's 1,788/1,788 test count (the head runs 1,789, all passing) and the comment at themeAdaptations.ts:671-672, which puts two topics in one sentence.

Claims and files checked
  • Claim: an undefined part, pseudo-class or surface value writes no : undefined; declaration and no empty rule. Verified: generateThemeRules.test.ts:193 fails on the base and passes on the head.
  • Claim: a child's undefined part property keeps the base's value. Verified for style-key properties (generateThemeRules.test.ts:219); false for @light/@dark and pseudo-class blocks (blocking finding).
  • Claim: the token cascade skips undefined, as its comment requires. Verified at generateThemeRules.ts:585-592.
  • Claim: an adaptation rule's undefined part value is now not set, where defineTheme used to refuse the theme. Verified: themeAdaptations.test.ts:268 throws on the base and passes on the head.
  • Claim: null is unchanged and still refused in an adaptation rule. Verified: the root still writes padding: null; and the adaptation test expects the throw.
  • Claim: before, the stylesheet held padding: undefined; and the inherited value was lost. Verified on the base.
  • Claim: the new tests fail without the fix. Verified: three fail on the base.
  • Claim: the theme tests pass 1,788/1,788. Outdated: the head runs 1,789, all passing.
  • Claim: tsc, eslint and prettier are clean. Verified on the changed files.
  • Claim: no record states how an undefined component value is treated. Verified; this is the open owner decision.
  • .changeset/core-theme-undefined-declaration.md: finding (inheritance wording).
  • packages/core/src/theme/generateThemeRules.ts: clear.
  • packages/core/src/theme/mergeComponents.ts: finding (color-mode merge and header comment).
  • packages/core/src/theme/themeAdaptations.ts: clear apart from the comment suggestion.
  • packages/core/src/theme/generateThemeRules.test.ts: clear.
  • packages/core/src/theme/themeAdaptations.test.ts: clear.

Automated review (maintainer link)

…ed value too; the authoring contract states the undefined rule

A restated pseudo-class block still replaces the inherited one whole; undefined inside it is not set. null keeps its meaning.
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 14, 2026
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 0e924bb

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 14, 2026

@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: two fixes are needed before approval. The spec direction itself is settled by the engineering owner's approval of this head.

  • The new line in docs/architecture/theme-authoring-contract.md (lines 128-130) says an inherited value stays when a pseudo-class block leaves a value undefined, but a restated pseudo-class block still replaces the inherited block whole (mergeComponents.ts:12-14 and the release note say so), so a child ':hover': {color: undefined} drops the base's hover color and background; reword the line to match the code, then re-approve the new head.
  • Miss: an adaptation rule whose part or component is itself undefined (components: {card: {base: undefined}}) now passes defineTheme, because themeAdaptations.ts:671-674 skips undefined at every depth, and compilation then throws TypeError: Cannot convert undefined or null to object at generateThemeRules.ts:1390 instead of the named error the base gave; treat an undefined component or style key as not set where component maps are read (or keep refusing it above property depth), with a test.

The @dark inheritance fix and the narrowed release note address the earlier inline comments. Non-blocking: the surface test case uses onDark.tokens, which already worked without the fix, so please add an onDark.components case.

Claims and files checked
  • Release note: an undefined part, color-mode, pseudo-class, surface or rule-part value now writes nothing: verified by the new tests and by probes.
  • Release note: this matches how page tokens already behaved: verified.
  • Release note: inherited style-key and color-mode values stay, and a restated pseudo-class block still replaces the inherited one: verified.
  • Release note: before, the stylesheet held undefined, inherited values were lost, and an adaptation rule was refused: verified on the base.
  • Release note: null keeps its meaning and an adaptation rule still refuses it: verified.
  • Description: emit, pseudo-class and token-cascade skips, and the merge filter for style keys and color-mode blocks: verified in the code.
  • Description: each undefined case fails without the fix: verified per test; the surface sub-case alone (surface tokens) already passed before.
  • Description: the theme suite (30 files, 1,790 tests), typecheck, lint and formatting pass: verified.
  • Description: one record line in the theme authoring contract: verified; it overstates the pseudo-class case.
  • .changeset/core-theme-undefined-declaration.md: clear.
  • docs/architecture/theme-authoring-contract.md: blocking finding above.
  • packages/core/src/theme/generateThemeRules.ts: clear; the crash surfaces here.
  • packages/core/src/theme/mergeComponents.ts: clear.
  • packages/core/src/theme/themeAdaptations.ts: blocking finding above; the comment "as everywhere else" is vague.
  • packages/core/src/theme/generateThemeRules.test.ts: non-blocking surface test gap.
  • packages/core/src/theme/themeAdaptations.test.ts: clear.

Automated review (maintainer link)

…r component maps are read

One normalizer drops what a component map leaves undefined (a component, a style key, a property at any depth) for the merge and each resolved layer; the emit skips them too. The record line says exactly what the code does: inherited values stay in a style key or color-mode block, and a restated pseudo-class block replaces the inherited one whole.
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 14, 2026
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec cae2c0a

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 14, 2026

@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: one fix is needed before approval. The spec direction is settled by an engineering owner's approval of this head, and the earlier @dark inheritance, record-wording and adaptation-crash findings are fixed.

  • Miss: in an adaptation rule that also sets typography.scale, a type-scale leaf left undefined (for example components: {text: {'type:body': {fontSize: undefined}}}) still counts as an authored write, because omitRootTypeScaleDefaults reads the raw rule.value.components (themeAdaptations.ts:1080, filtered by Object.hasOwn at :993), so the rule writes font-size: var(--text-body-size) and overrides an earlier rule's value wherever both match, contrary to the new authoring-contract line and AST-012 FR6; passing withoutUnsetComponents(rule.value.components) there fixes it, with a test for this case.

Non-blocking: mergeComponents.test.ts:38 passes without the fix because toEqual ignores undefined keys (use toStrictEqual), and a component map left empty, such as text: {base: undefined}, still writes Text's colour and size override rules.

Claims and files checked
  • Release note: an undefined value in a part, color-mode block, pseudo-class block, surface or plain adaptation rule now writes nothing: verified by the new tests and by before/after runs; false for a type-scale leaf in a rule that sets a type scale (finding above).
  • Release note: an undefined component or style key is not set either: verified; an emptied Text, Heading or Link map still writes their prop override rules (non-blocking).
  • Release note: this matches how page tokens already behaved: verified.
  • Release note: inherited style-key and color-mode values stay, and a restated pseudo-class block still replaces the inherited one: verified.
  • Release note: before, the stylesheet held undefined, the inherited value was lost, and an adaptation rule was refused: verified on the base.
  • Release note: null keeps its meaning and an adaptation rule still refuses it: verified.
  • Description: the emitter, pseudo-class blocks and the token cascade skip undefined; the merge drops a child's undefined: verified in the code and tests.
  • Description: one normalizer handles every place component maps are read: false, the type-scale filter for adaptation rules reads the raw map (finding above).
  • Description: an undefined component or style key builds nothing instead of throwing a TypeError: verified.
  • Description: each undefined case it lists fails without the fix: verified (five tests fail on the base); one extra merge test passes on the base (non-blocking).
  • Description: the theme suite (31 files, 1,794 tests), typecheck, lint and formatting pass: verified.
  • Description: one record line in the theme authoring contract: verified, and approved for this head.
  • .changeset/core-theme-undefined-declaration.md: clear.
  • docs/architecture/theme-authoring-contract.md: clear; the code contradicts its adaptation clause for type-scale leaves (finding above).
  • packages/core/src/theme/generateThemeRules.ts: clear; non-blocking empty-map note.
  • packages/core/src/theme/generateThemeRules.test.ts: clear.
  • packages/core/src/theme/mergeComponents.ts: its comment says every reader uses the normalizer (finding above); non-blocking header length.
  • packages/core/src/theme/mergeComponents.test.ts: non-blocking toEqual note.
  • packages/core/src/theme/resolveThemeValues.ts: clear.
  • packages/core/src/theme/themeAdaptations.test.ts: clear; the type-scale case is missing.

<!-- codebunny-mode: full; reason: spec-record -->

Automated review (maintainer link)

… a component whose every value is undefined is not set

The adaptation lowering reads the rule's authored map through the same normalizer, so a type-scale leaf left undefined does not count as an authored write. A component or block whose every value is left undefined is dropped, so it writes no Text/Heading/Link override rules; the stylesheet reads a rule source's map through the normalizer once.
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 14cd48e

@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: one fix is needed before approval. The spec direction is approved by an engineering owner for this head, and the earlier type-scale, empty-component and test findings are fixed.

  • A restated pseudo-class block whose every value is undefined is now dropped before the merge (mergeComponents.ts:44-54), so an extends child's ':hover': {color: undefined} keeps the base's whole hover block, although the new authoring-contract line and the release note say a restated pseudo-class block replaces the inherited one whole; keep such a block as an empty block (collapse only components and style keys) or state the new rule in the record line and release note for a fresh owner approval, and add an extends test for it.

Non-blocking: the mergeComponents.ts header is still 17 lines and repeats the withoutUnsetComponents JSDoc, and the comment at generateThemeRules.ts:1230-1232 could say plainly that a raw source can hold undefined.

Claims and files checked

Review mode: incremental; reason: none

  • Release note: a value left undefined in a part, colour-mode block, pseudo-class block, surface or adaptation rule now writes nothing: verified by the new tests, which fail on the base.
  • Release note: a component or style key left undefined, or one whose every value is, is not set: verified.
  • Release note: this matches how page tokens already behaved: verified.
  • Release note: inherited style-key and colour-mode values stay: verified.
  • Release note: a restated pseudo-class block still replaces the inherited one whole: false when every value in the block is undefined (finding above).
  • Release note: before, the stylesheet held undefined, the inherited value was lost, and an adaptation rule was refused: verified on the base.
  • Release note: null keeps its meaning and an adaptation rule still refuses it: verified.
  • Description: joinDeclarations, the component emit, empty pseudo-class blocks and the token cascade skip undefined: verified; the component emit now relies on the normalizer at entry.
  • Description: the merge drops a child's undefined in style keys and colour-mode blocks: verified.
  • Description: a restated pseudo-class block replaces the base's block whole, as before: false for a block whose every value is undefined (finding above).
  • Description: an adaptation rule's undefined part is not set and null is still refused: verified.
  • Description: one normalizer wherever component maps are read; an undefined component builds nothing; a component left with nothing set writes no Text or Link override rules; a scale rule's undefined type-scale leaf is no write: verified.
  • Description: each undefined case fails without the fix: verified (eight tests fail on the base).
  • Description: the theme suite (31 files, 1,796 tests), typecheck, lint and formatting pass: verified.
  • Description: one record line in the theme authoring contract: verified, and approved for this head.
  • .changeset/core-theme-undefined-declaration.md: the pseudo-class claim is false (finding above).
  • docs/architecture/theme-authoring-contract.md: clear; the code departs from its pseudo-class clause (finding above).
  • packages/core/src/theme/generateThemeRules.ts: clear; non-blocking comment wording.
  • packages/core/src/theme/generateThemeRules.test.ts: clear.
  • packages/core/src/theme/mergeComponents.ts: the finding above; non-blocking header length.
  • packages/core/src/theme/mergeComponents.test.ts: clear.
  • packages/core/src/theme/resolveThemeValues.ts: clear.
  • packages/core/src/theme/themeAdaptations.ts: clear; the earlier type-scale finding is fixed.
  • packages/core/src/theme/themeAdaptations.test.ts: clear.

Automated review (maintainer link)

…ed still replaces the inherited one

Only a component or style key whose every value is undefined collapses; a nested pseudo-class or color-mode block stays, empty, so a restated pseudo-class block replaces the base's whole.
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec bf0424a

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 10aa066

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 504ab0e

@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: one fix is needed before approval. The not-set rule itself is approved by an engineering owner at this head, the public API and every built theme are unchanged, and every earlier finding is fixed.

  • The release note and the description say a component whose every value is undefined writes nothing, but text: {base: {'@dark': {color: undefined}}} keeps an empty @dark block (mergeComponents.ts:61-64) and still writes Text's 17 prop override rules (Heading 10, Link 6), so drop an emptied color-mode block there, say that a restated pseudo-class block stays empty, and add @dark and :hover cases to the Text, Heading and Link override test.

Non-blocking: one new comment in generateThemeRules.ts has a 35-word sentence; the inline suggestion shortens it.

Claims and files checked

Review mode: incremental; reason: none

  • Claim: undefined part, pseudo-class and surface values were written as text on the base and now write nothing, with no warning: verified (tests fail on the base and pass on the head)
  • Claim: a child's undefined value keeps the inherited value in a style key and a color-mode block: verified (tests, including an inherited surface)
  • Claim: a restated pseudo-class block still replaces the inherited one whole: verified (new test)
  • Claim: an adaptation rule's undefined part is not set and null is still refused: verified (adaptation tests)
  • Claim: a scale rule's undefined type-scale value is no write, so an earlier rule's value stands: verified (fails on the base, passes on the head)
  • Claim: an undefined component or style key builds nothing instead of throwing: verified
  • Claim: a component or block whose every value is undefined is dropped and writes no Text or Link override rules: false when the undefined values sit in a color-mode or pseudo-class block
  • Claim: null keeps its meaning: verified (null cases pass on the base and the head)
  • Claim: each undefined case fails without the fix: verified (9 of 9)
  • Claim: the theme tests pass (31 files, 1,797 tests) and type checking, lint and formatting are clean: verified
  • Claim: the authoring-contract line reads as quoted: verified
  • File .changeset/core-theme-undefined-declaration.md: finding (the claim above)
  • File docs/architecture/theme-authoring-contract.md: clear
  • File packages/core/src/theme/generateThemeRules.ts: non-blocking comment note
  • File packages/core/src/theme/generateThemeRules.test.ts: clear
  • File packages/core/src/theme/mergeComponents.ts: finding (lines 61-64)
  • File packages/core/src/theme/mergeComponents.test.ts: clear
  • File packages/core/src/theme/resolveThemeValues.ts: clear
  • File packages/core/src/theme/themeAdaptations.ts: clear
  • File packages/core/src/theme/themeAdaptations.test.ts: clear

Automated review (maintainer link)

…et; an emptied pseudo-class block stays

So a component whose every value is undefined writes no Text/Heading/Link override rules, while a restated pseudo-class block still replaces the inherited one whole and its component counts as themed.
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec a2e36ed

…r regex

The @dark/@light cases equal the theme without those components; the :hover cases equal the same components given an empty style key (their prop override rules and nothing else), so rules main writes regardless do not break it.
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 19e3c92

@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 4888fa2

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
lab/CommentThread 362.2 kB (+12 B) · 2.4 kB CSS (0) — — · — · —
lab/Comments 369.5 kB (+10 B) · 2.5 kB CSS (0) — — · — · —
Markdown 201.9 kB (+8 B) · 21.7 kB CSS (0) — — · — · —
121 more components
Component Size LoC Visual · A11y · RTL
lab/DialogHeroHeader 88.4 kB (+8 B) · 372 B CSS (0) — — · — · —
Lightbox 145.8 kB (+7 B) · 11.9 kB CSS (0) — — · — · —
Overlay 23.0 kB (+7 B) · 3.9 kB CSS (0) — — · — · —
Toast 103.5 kB (+7 B) · 11.1 kB CSS (0) — — · — · —
lab/ListInput 93.4 kB (+7 B) · 922 B CSS (0) — — · — · —
ContextMenuItem 35.1 kB (+6 B) · 6.9 kB CSS (0) — — · — · —
charts/Chart 237.4 kB (+5 B) · 516 B CSS (0) — — · — · —
PowerSearch 306.1 kB (+4 B) · 25.5 kB CSS (0) — — · — · —
TableCell 121.6 kB (+4 B) · 18.9 kB CSS (0) — — · — · —
ContextMenu 120.3 kB (+3 B) · 18.4 kB CSS (0) — — · — · —
TextArea 66.7 kB (+3 B) · 9.4 kB CSS (0) — — · — · —
lab/TourStep 93.0 kB (+3 B) · 691 B CSS (0) — — · — · —
ChatLayout 88.2 kB (+2 B) · 11.3 kB CSS (0) — — · — · —
FileInput 74.0 kB (+2 B) · 11.7 kB CSS (0) — — · — · —
Selector 112.6 kB (+2 B) · 18.5 kB CSS (0) — — · — · —
ToggleButton 91.9 kB (+2 B) · 10.9 kB CSS (0) — — · — · —
AlertDialog 128.5 kB (+1 B) · 15.4 kB CSS (0) — — · — · —
Banner 66.9 kB (+1 B) · 11.3 kB CSS (0) — — · — · —
BreadcrumbItem 96.3 kB (+1 B) · 13.1 kB CSS (0) — — · — · —
Carousel 74.5 kB (+1 B) · 11.7 kB CSS (0) — — · — · —
CheckboxInput 68.8 kB (+1 B) · 10.1 kB CSS (0) — — · — · —
CheckboxListItem 79.6 kB (+1 B) · 11.9 kB CSS (0) — — · — · —
ComplexSelector 77.4 kB (+1 B) · 12.6 kB CSS (0) — — · — · —
DateInput 199.8 kB (+1 B) · 17.9 kB CSS (0) — — · — · —
DateRangeInput 99.2 kB (+1 B) · 13.3 kB CSS (0) — — · — · —
DialogHeader 67.7 kB (+1 B) · 12.3 kB CSS (0) — — · — · —
InputGroup 60.9 kB (+1 B) · 7.9 kB CSS (0) — — · — · —
MoreMenu 107.1 kB (+1 B) · 18.6 kB CSS (0) — — · — · —
Outline 25.3 kB (+1 B) · 4.1 kB CSS (0) — — · — · —
Pagination 123.6 kB (+1 B) · 18.9 kB CSS (0) — — · — · —
Popover 98.4 kB (+1 B) · 15.1 kB CSS (0) — — · — · —
TopNav 77.9 kB (+1 B) · 11.7 kB CSS (0) — — · — · —
lab/DiffViewer 92.8 kB (+1 B) · 2.1 kB CSS (0) — — · — · —
lab/SelectableCardGroup 68.6 kB (+1 B) · 162 B CSS (0) — — · — · —
richtext/RichTextEditor 305.3 kB (+1 B) · 2.6 kB CSS (0) — — · — · —
AvatarGroupOverflow 51.8 kB (0) · 5.7 kB CSS (0) — — · — · —
BaseTypeahead 78.2 kB (0) · 11.7 kB CSS (0) — — · — · —
BottomSheet 73.0 kB (0) · 7.7 kB CSS (0) — — · — · —
Button 64.9 kB (0) · 10.8 kB CSS (0) — — · — · —
ButtonGroup 44.1 kB (0) · 3.7 kB CSS (0) — — · — · —
Calendar 76.0 kB (0) · 11.4 kB CSS (0) — — · — · —
ChatComposerInput 82.0 kB (0) · 12.1 kB CSS (0) — — · — · —
ChatComposerTokenElement 82.0 kB (0) · 12.1 kB CSS (0) — — · — · —
ChatDictationButton 65.4 kB (0) · 10.8 kB CSS (0) — — · — · —
ChatLayoutScrollButton 65.4 kB (0) · 11.0 kB CSS (0) — — · — · —
ChatSendButton 65.3 kB (0) · 10.8 kB CSS (0) — — · — · —
ClickableCard 18.5 kB (0) · 7.3 kB CSS (0) — — · — · —
Collapsible 29.0 kB (0) · 4.5 kB CSS (0) — — · — · —
CommandPaletteItem 13.4 kB (0) · 3.6 kB CSS (0) — — · — · —
DrawerHeader 67.9 kB (0) · 13.7 kB CSS (0) — — · — · —
DropdownMenuCheckboxItem 28.3 kB (0) · 7.1 kB CSS (0) — — · — · —
DropdownMenuItem 27.5 kB (0) · 6.8 kB CSS (0) — — · — · —
DropdownMenuRadioItem 28.4 kB (0) · 7.1 kB CSS (0) — — · — · —
DropdownMenuSubMenu 79.1 kB (0) · 10.3 kB CSS (0) — — · — · —
FieldLabel 55.2 kB (0) · 5.8 kB CSS (0) — — · — · —
IconButton 64.9 kB (0) · 10.8 kB CSS (0) — — · — · —
Item 20.3 kB (0) · 6.0 kB CSS (0) — — · — · —
ListItem 78.8 kB (0) · 11.9 kB CSS (0) — — · — · —
MobileNav 76.1 kB (0) · 11.4 kB CSS (0) — — · — · —
MobileNavToggle 65.2 kB (0) · 10.8 kB CSS (0) — — · — · —
NumberInput 77.4 kB (0) · 12.2 kB CSS (0) — — · — · —
ProgressBar 11.9 kB (0) · 6.4 kB CSS (0) — — · — · —
RadioListItem 75.8 kB (0) · 10.5 kB CSS (0) — — · — · —
SegmentedControl 102.0 kB (0) · 6.9 kB CSS (0) — — · — · —
SegmentedControlItem 18.8 kB (0) · 4.3 kB CSS (0) — — · — · —
SelectableCard 18.7 kB (0) · 7.5 kB CSS (0) — — · — · —
SelectorOption 23.8 kB (0) · 6.6 kB CSS (0) — — · — · —
SideNavHeading 82.3 kB (0) · 12.1 kB CSS (0) — — · — · —
SideNavItem 76.8 kB (0) · 11.9 kB CSS (0) — — · — · —
Step 31.6 kB (0) · 5.6 kB CSS (0) — — · — · —
Tab 14.9 kB (0) · 4.2 kB CSS (0) — — · — · —
Table 138.5 kB (0) · 19.4 kB CSS (0) — — · — · —
TableHeaderCell 121.3 kB (0) · 18.7 kB CSS (0) — — · — · —
TabMenu 78.7 kB (0) · 11.9 kB CSS (0) — — · — · —
Thumbnail 69.2 kB (0) · 12.3 kB CSS (0) — — · — · —
TimeInput 174.6 kB (0) · 16.9 kB CSS (0) — — · — · —
Timestamp 35.8 kB (0) · 11.0 kB CSS (0) — — · — · —
ToggleButtonGroup 41.3 kB (0) · 3.7 kB CSS (0) — — · — · —
Token 29.3 kB (0) · 4.8 kB CSS (0) — — · — · —
TopNavItem 14.5 kB (0) · 4.0 kB CSS (0) — — · — · —
TopNavMegaMenu 75.9 kB (0) · 12.6 kB CSS (0) — — · — · —
TopNavMegaMenuItem 14.3 kB (0) · 4.2 kB CSS (0) — — · — · —
TopNavMenu 81.4 kB (0) · 12.0 kB CSS (0) — — · — · —
TreeList 46.2 kB (0) · 5.9 kB CSS (0) — — · — · —
lab/ChatEmojiPicker 113.3 kB (0) · 773 B CSS (0) — — · — · —
lab/ChatReactionBar 114.5 kB (0) · 1.1 kB CSS (0) — — · — · —
lab/CommentPin 60.2 kB (0) · 1.2 kB CSS (0) — — · — · —
lab/EmojiPicker 92.3 kB (0) · 751 B CSS (0) — — · — · —
lab/NavigationScreen 84.9 kB (0) · 1.5 kB CSS (0) — — · — · —
lab/NavigationStack 84.9 kB (0) · 1.5 kB CSS (0) — — · — · —
lab/PageControl 78.1 kB (0) · 709 B CSS (0) — — · — · —
lab/Schedule 114.5 kB (0) · 3.9 kB CSS (0) — — · — · —
lab/TabBar 83.5 kB (0) · 1.8 kB CSS (0) — — · — · —
lab/TabBarItem 3.9 kB (0) · 1.8 kB CSS (0) — — · — · —
lab/TabBarMoreList 101.6 kB (0) · 1.8 kB CSS (0) — — · — · —
AppShell 97.4 kB (−1 B) · 14.3 kB CSS (0) — — · — · —
ChatComposer 84.4 kB (−1 B) · 12.9 kB CSS (0) — — · — · —
CheckboxList 73.0 kB (−1 B) · 7.8 kB CSS (0) — — · — · —
CodeBlock 79.9 kB (−1 B) · 12.1 kB CSS (0) — — · — · —
DropdownMenu 106.8 kB (−1 B) · 18.6 kB CSS (0) — — · — · —
Field 59.3 kB (−1 B) · 7.3 kB CSS (0) — — · — · —
Link 56.2 kB (−1 B) · 7.1 kB CSS (0) — — · — · —
MultiSelector 101.3 kB (−1 B) · 17.7 kB CSS (0) — — · — · —
RadioList 60.6 kB (−1 B) · 7.3 kB CSS (0) — — · — · —
SideNavCollapseButton 65.7 kB (−1 B) · 10.8 kB CSS (0) — — · — · —
Slider 114.3 kB (−1 B) · 8.9 kB CSS (0) — — · — · —
Stepper 66.6 kB (−1 B) · 10.9 kB CSS (0) — — · — · —
Switch 108.8 kB (−1 B) · 10.0 kB CSS (0) — — · — · —
TableSelectionToolbar 75.1 kB (−1 B) · 14.0 kB CSS (0) — — · — · —
TextInput 72.6 kB (−1 B) · 12.0 kB CSS (0) — — · — · —
Tokenizer 103.5 kB (−1 B) · 20.1 kB CSS (0) — — · — · —
TopNavHeading 82.0 kB (−1 B) · 12.0 kB CSS (0) — — · — · —
Typeahead 87.5 kB (−1 B) · 13.3 kB CSS (0) — — · — · —
lab/TransferList 111.8 kB (−1 B) · 1.2 kB CSS (0) — — · — · —
lab/TransferListSelector 120.6 kB (−1 B) · 1.4 kB CSS (0) — — · — · —
CommandPalette 79.1 kB (−2 B) · 12.7 kB CSS (0) — — · — · —
DateTimeInput 223.3 kB (−2 B) · 19.7 kB CSS (0) — — · — · —
SideNav 121.1 kB (−2 B) · 12.2 kB CSS (0) — — · — · —
richtext/RichTextEditorToolbar 299.3 kB (−2 B) · 454 B CSS (0) — — · — · —
richtext/RichTextView 281.9 kB (−2 B) · 2.3 kB CSS (0) — — · — · —
lab/CommentComposer 162.5 kB (−3 B) · 1.9 kB CSS (0) — — · — · —

Package size: @astryxdesign/core 7.59 MB packed (+1.8 kB); no new dependencies.

Wide change (shared styles: packages/core/src/theme/generateThemeRules.ts, packages/core/src/theme/mergeComponents.ts, packages/core/src/theme/resolveThemeValues.ts, and 1 more): add ci:run-visual, ci:run-a11y or ci:run-rtl to run them.


Generated by PR Enrichment workflow | View full report

@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: one fix is needed before approval, and it is a description edit. The not-set rule is approved by an engineering owner at this head, CI passes, the public API and every built theme are unchanged, and the earlier color-mode finding is fixed.

  • The description's normalizer bullet says a component or block whose every value is undefined is dropped and writes no Text/Link override rules, but a restated pseudo-class block whose every value is undefined stays empty (mergeComponents.ts:65-68) and its component still writes those rules, as the test at generateThemeRules.test.ts:308-325 asserts, so reword that bullet the way the changeset already says it.

Non-blocking (Miss): the readEntries JSDoc opens with a 27-word sentence; the inline suggestion splits it.

Claims and files checked

Review mode: incremental; reason: none

  • Claim: on the base, an undefined value in a component, pseudo-class or surface block was written as the text undefined, and a child's undefined replaced the inherited value: verified (the new tests fail on the base)
  • Claim: the declaration writer skips undefined, an emptied pseudo-class block writes no rule, and the token cascade skips undefined: verified (theme rule generator and its tests)
  • Claim: the merge drops a child's own undefined values, so the inherited value stays in a style key and a color-mode block: verified (merge and inheritance tests)
  • Claim: a restated pseudo-class block still replaces the inherited one whole: verified (pseudo-class inheritance test)
  • Claim: an adaptation rule's undefined part value is not set, and null is still refused: verified (adaptation tests)
  • Claim: one normalizer reads component maps in the merge, each resolved layer and the stylesheet, so an undefined component or style key builds nothing instead of throwing: verified
  • Claim: a component or block whose every value is undefined is dropped and writes no Text or Link override rules: false for a pseudo-class block, which stays and keeps its component themed
  • Claim: a scale rule's undefined type-scale value is no write, so an earlier rule's value stands: verified (fails on the base, passes on the head)
  • Claim: null keeps its meaning: verified (null cases pass on the base and the head)
  • Claim: each undefined case fails without the fix: verified (9 of 9)
  • Claim: the theme tests pass (31 files, 1,800 tests) and type checking, lint and formatting are clean: verified
  • Claim: the authoring-contract line reads as quoted, and the writing rubric finds nothing: verified
  • Release note: undefined values in a part, color-mode block, pseudo-class block, surface or adaptation rule are not set: verified
  • Release note: a component, style key or color-mode block left undefined, or whose every value is, writes nothing: verified
  • Release note: the inherited value stays in a style key or color-mode block; a restated pseudo-class block replaces the inherited one, stays empty and keeps its component themed: verified
  • Release note: before, the stylesheet held undefined, the inherited value was lost, and an adaptation rule refused the theme: verified
  • Release note: null replaces an inherited value, is written as it is, and an adaptation rule still refuses it: verified
  • File .changeset/core-theme-undefined-declaration.md: clear
  • File docs/architecture/theme-authoring-contract.md: clear
  • File packages/core/src/theme/generateThemeRules.ts: clear
  • File packages/core/src/theme/generateThemeRules.test.ts: clear
  • File packages/core/src/theme/mergeComponents.ts: non-blocking comment note
  • File packages/core/src/theme/mergeComponents.test.ts: clear
  • File packages/core/src/theme/resolveThemeValues.ts: clear
  • File packages/core/src/theme/themeAdaptations.ts: clear
  • File packages/core/src/theme/themeAdaptations.test.ts: clear

Automated review (maintainer link)

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 4888fa2

@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 finished on this head yet.

A theme value left undefined in a component block, pseudo-class or color-mode block, surface or adaptation rule is now not set, as the authoring-contract line approved for this head states, and the nine new tests fail without the fix and pass with it. The description now states the pseudo-class exception and the readEntries comment uses short sentences, so nothing from the last review remains.

Claims and files checked

Review mode: incremental; reason: none

Claims (description):

  • The base wrote an undefined part, pseudo-class or surface value as the text undefined: verified, the new test at generateThemeRules.test.ts:193 fails on the base.
  • A child's undefined replaced the inherited value because maps merged by spread: verified, base mergeComponents.ts spread the child's block; generateThemeRules.test.ts:226 fails on the base.
  • The declaration writer, component emit and token cascade skip undefined, and an emptied pseudo-class block writes no rule: verified, generateThemeRules.ts:504-507 and :586-588; test :193.
  • The merge drops a child's undefined in style keys and color-mode blocks, and a restated pseudo-class block still replaces the base's: verified, mergeComponents.ts:95-96 and :122-128; mergeComponents.test.ts:22, generateThemeRules.test.ts:328.
  • An adaptation rule's undefined part is not set and null is still refused: verified, resolveThemeValues.ts:397 runs before the check at themeAdaptations.ts:1043; themeAdaptations.test.ts:268.
  • One normalizer serves the merge, each resolved layer and the emit, card: {base: undefined} builds nothing, and an all-undefined component, style key or color-mode block is dropped with no Text, Heading or Link overrides: verified, mergeComponents.ts:61-84, generateThemeRules.ts:1233; tests generateThemeRules.test.ts:254 and :270.
  • A restated all-undefined pseudo-class block stays empty, replaces the inherited block and keeps its component themed: verified, mergeComponents.ts:63-66; generateThemeRules.test.ts:308-325 and :328.
  • An adaptation rule's undefined type-scale leaf is no write, so an earlier rule's value stands: verified, themeAdaptations.ts:1082; themeAdaptations.test.ts:327.
  • null keeps its meaning: verified, generateThemeRules.test.ts:348, mergeComponents.test.ts:50.
  • Each undefined case fails without the fix: verified, the nine undefined tests fail on the base with the head's tests.
  • The theme folder passes 31 files and 1,800 tests, and tsc, eslint and prettier are clean: verified at this head.
  • The quoted record line matches the record: verified, theme-authoring-contract.md:128-132.
  • The writing rubric results: verified, the record line is present tense with no narration, history or status.

Claims (changeset):

  • A Core patch release: verified, a fix with no public API change.
  • An undefined value in a part, color-mode block, pseudo-class block, surface or adaptation rule, and an undefined or all-undefined component, style key or color-mode block, writes nothing: verified, as above.
  • In a style key or color-mode block the inherited value stays: verified, mergeComponents.test.ts:22.
  • A restated pseudo-class block still replaces the inherited one whole even when every value is undefined, stays empty and keeps its component themed: verified, generateThemeRules.test.ts:308-325.
  • Before, the stylesheet held padding: undefined;, the inherited value was lost, and an adaptation rule made defineTheme throw: verified, the matching tests fail on the base.
  • null keeps its meaning and an adaptation rule still refuses it: verified, themeAdaptations.test.ts:311-324.

Files:

  • .changeset/core-theme-undefined-declaration.md: clear
  • docs/architecture/theme-authoring-contract.md: clear
  • packages/core/src/theme/mergeComponents.ts: clear
  • packages/core/src/theme/generateThemeRules.ts: clear
  • packages/core/src/theme/resolveThemeValues.ts: clear
  • packages/core/src/theme/themeAdaptations.ts: clear
  • packages/core/src/theme/generateThemeRules.test.ts: clear
  • packages/core/src/theme/mergeComponents.test.ts: clear
  • packages/core/src/theme/themeAdaptations.test.ts: clear

Automated review (maintainer link)

@josephfarina
josephfarina merged commit 8b1460f into main Nov 14, 2026
229 of 235 checks passed
@github-actions
github-actions Bot deleted the core-theme-undefined-decl branch November 15, 2026 06:03

This branch was successfully deployed

1 active deployment
Preview — 4888fa28 Deployed Nov 14, 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