Skip to content

fix(core): the switch thumb stays round, and inherited text takes the theme's body size - #12236

Merged
josephfarina merged 2 commits into
mainfrom
core-switch-textsize
Nov 17, 2026
Merged

josephfarina merged 2 commits into
mainfrom
core-switch-textsize

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

User impact

Two theme settings didn't reach parts that users see:

  • Square corners squared the switch thumb. The thumb was drawn with the --radius-full pill token, so a theme that squares its pills turned every switch's round thumb into a square. The radio had the same defect, already fixed by drawing it at 50%.
  • Changing the text size missed inherited text. The Theme wrapper set no font size. Text inside a Theme that sets no size of its own stayed at the browser's 16px whatever the theme's text size was, while Core's own body text used the theme's 14px. That covers plain text in a Card, Stack or Carousel, a Blockquote's quote, ChatTokenizedText's text, and Text type="inherit".

Problem and solution fit

  • Switch thumb: it is drawn at a 50% radius on its square box, as the radio is. The track keeps the pill token, so a theme still squares it. A theme that wants a square thumb sets the radius on switch-thumb.
  • Inherited text: each Theme wrapper carries font-size: var(--text-body-size) for its own theme, so text inside it that sets no size follows the theme, a nested theme's size included.
    • reset.css sets no font size, so installing Astryx leaves a host app's own text outside a Theme as it was.
    • Line height is unchanged.

Expected behavior and authority

  • component:Switch FR16: the thumb is a circle at 50% in every state and size.
  • component:Theme FR1: the wrapper carries the body text size.
  • architecture:theme-compilation INV20: text inside a Theme that only inherits its size takes the body size token. The reset sets none, so a host's own text keeps its size.

Default look

This changes the default look on purpose: text inside a Theme that sets no size of its own is now 14px by default instead of 16px. To keep 16px inside a Theme, set a font-size on your own container inside it, or set --text-body-size in your theme, which also sizes Core's own body text. The changeset says the same.

Before/after pictures: every page and block template was rendered inside <Theme theme={neutralTheme}> with main and with this change at 1280px. 770 rendered on both trees; 5 failed to render on one side.

  • 80 templates change, all by inherited text inside the Theme.
    • In 53, the only elements that change size are inherited-text spots, all 16px → 14px: plain spans and divs in cards, stacks and chat rows; Card text that inherits; Blockquote quotes.
    • 7 of those 53 (CardWithInnerLayout, CollapsibleHookUsage, LayoutDualPanelLayout, LayoutFullBleedContent, SelectableCardElevated, TextWrap, work-item-detail) also have a Text block that keeps its size but gets a few pixels shorter, because inline inherited text inside it got smaller.
    • In 27, the spot matcher didn't pair the changed elements, but every diff picture shows only smaller inherited text, and the text below it moving up by that amount (grid cells, list rows, hook-usage demos).
    • 4 of the 27 are Spinner and indeterminate-progress pages whose animation frame differs between shots.
  • No element changes size for any other reason, and nothing reflows beyond the text.

Other themes and apps: I checked an internal theme and two internal apps. The theme sets its body size to 14px. Both apps wrap their pages in a Theme and set no font-size on their own containers, so their inherited text inside the Theme moves from 16px to 14px. Their own text outside it is unchanged.

Scope

Components: Switch, Theme

  • Two defects that share a cause, a theme value that doesn't reach a part, are restored together.
  • No new public API.
  • Public text and artifacts contain no internal Meta context.

Testing

  • Switch.thumbCircle.source-build.test.mjs: the compiled thumb radius is 50% and the track keeps --radius-full.
  • Switch.interaction.browser.spec.ts: the thumb's radius reads 50%.
  • Theme.test.tsx: the wrapper declares the body size.
  • reset.test.ts: no font size on html or body.
  • Switch, Theme and reset suites pass. pnpm check:knowledge, core tsc, Prettier and the changeset check pass.

Writing rubric results

Run over the component:Switch FR16 row and its verification row, the component:Theme FR1 edit and its verification row, and architecture:theme-compilation INV20 and its verification row.

R1 narration: none; each sentence states what Core draws or declares.
R2 research: none.
R3 evidence: verification cells name tests.
R4 rejected alternatives: none recorded.
R5 change references: none.
R6 open questions: none touched.
R7 project status: none.

@vercel

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

Request Review

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

astracat-bot Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 17, 2026, 7:30 PM UTC

@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review label Nov 17, 2026
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 17, 2026
@josephfarina

Copy link
Copy Markdown
Contributor Author

Owner decision (engineering owner, covering this pull request): plain inherited text takes the theme's body size. :where(body) in the reset stylesheet and the Theme root set font-size: var(--text-body-size), so text that sets no size follows the theme (14px by default, where the browser default is 16px). This ships as a fix, and the changeset says how to keep 16px. Before-and-after renders of every page and block template show only inherited-text spots changing size, and other themes and apps were checked. The switch thumb stays round: its radius is 50%, as the radio's already is.

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec d4c1952

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 17, 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. The Switch thumb and inherited-text fixes behave as described; one release-note claim and two existing tests need updating before this lands.

  • The inherited-text changeset and INV20's last sentence say an app keeps 16px by setting its own body font-size, but every Theme wrapper now sets font-size: var(--text-body-size), so with body at 16px the text inside a Theme stays 14px: scope that route to text outside a Theme, and name one that works inside it, such as a font-size on the app's own container inside the Theme (raising --text-body-size also enlarges Core's own body text, so say that too).
  • The existing Switch touch test (packages/core/src/Switch/__tests__/Switch.interaction.browser.spec.ts:991) still expects the thumb's radius to end in px, so it fails in the WebKit interaction job against the new 50%; update it to expect 50%.
  • The canonical setup test (internal/vibe-tests/setup-test/setup-canonical.test.ts) fails 9 cases in test-build because a host app's own unsized text now shrinks from 16px to 14px once it imports reset.css; update those expectations, and say in the changeset that loading reset.css resizes an existing app's own unsized text.

Smaller notes, none blocking, are inline: Theme.spec.md still lists the body text size as untested though this change adds that test, INV20's failure-signal cell names no failure, and the new reset.css comment can be shorter.

Claims and files checked

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

  • Claim: the thumb used the pill token, so a theme with square pills drew a square thumb. Verified: the y2k theme's thumbs measure a 0px radius on the base.
  • Claim: the radio already draws at 50%. Verified: the Indicator record's FR5 and RadioIndicator.circle.source-build.test.mjs.
  • Claim: nothing set a size on body or the Theme wrapper, so inherited text drew at 16px while Core's body text used 14px. Verified: 16px on the base; --text-body-size resolves to 14px (tokens.stylex.ts:369, :448).
  • Claim: the affected text includes plain text in cards and stacks, Blockquote quotes and Text type="inherit". Verified: the Blockquote quote measures 16px on the base and 14px on the head; Text type="inherit" inherits its size (text.stylex.ts:143).
  • Claim: the thumb draws at 50% on its square box and the track keeps the pill token. Verified: Switch.tsx:540 and :333; every thumb size is square.
  • Claim: a theme that wants a square thumb sets the radius on switch-thumb. Verified: the target exists (Switch.doc.mjs:388) and theme styles sit in a later layer than component styles (reset.css:40).
  • Claim: reset.css gives body the token and each Theme wrapper carries it, so a nested theme's size reaches its text. Verified: reset.css:106, Theme.tsx:86.
  • Claim: setting it on body, not html, leaves rem unchanged. Verified: html stays 16px on the head.
  • Claim: with no token defined, body keeps the browser's size. Verified: the declaration has no fallback, so body inherits.
  • Claim: an app's own body font-size wins over the reset. Verified for body and text outside a Theme; false as a way to size text inside a Theme (first finding).
  • Claim: the default look changes on purpose, 16px to 14px, and the changeset says how to keep 16px. The first part is verified; the second is false inside a Theme.
  • Claim: every page and block template was rendered on both trees, and only inherited-text spots change size. Not reproduced; spot checks agree (the Blockquote changes; the default Card and the default-theme Switch are pixel-identical).
  • Claim: other themes and apps were surveyed. Not verifiable from this repository.
  • Claim: no new public API. Verified: the API report shows no change for Core or the seven published themes.
  • Claim: the three new tests check the 50% thumb beside the token track, the body rule and the wrapper's size. Verified: each fails on the base and passes on the head.
  • Claim: the Switch, Theme and reset suites and the knowledge check pass. Verified for the unit suites (112 tests) and the knowledge check; false for the Switch touch interaction suite, which fails in CI (second finding).
  • Changeset (Switch): the thumb draws at 50%, a theme with square pills keeps a round thumb, and switch-thumb sets a square one. Verified.
  • Changeset (inherited text): 14px by default, following --text-body-size, set on body and on each Theme. Verified. Its "set your own body font-size" route to 16px is false inside a Theme, and it does not mention that an existing app's own text shrinks.
  • File .changeset/core-inherited-text-body-size.md: finding (the 16px route; host-app impact).
  • File .changeset/core-switch-thumb-circle.md: clear.
  • File docs/architecture/theme-compilation.md: finding (INV20's last sentence); note on its failure-signal cell.
  • File docs/specs/components/Switch/Switch.spec.md: clear.
  • File docs/specs/components/theme/Theme.spec.md: note (body size listed as untested).
  • File packages/core/src/Switch/Switch.thumbCircle.source-build.test.mjs: clear.
  • File packages/core/src/Switch/Switch.tsx: finding (the existing touch test still expects a px radius).
  • File packages/core/src/reset.css: finding (the canonical setup test's host text); note (comment length).
  • File packages/core/src/reset.test.ts: clear.
  • File packages/core/src/theme/Theme.test.tsx: clear.
  • File packages/core/src/theme/Theme.tsx: clear; its wrapper declaration is what the first finding's wording has to describe.

Automated review (maintainer link)

Comment thread docs/architecture/theme-compilation.md Resolved
Comment thread packages/core/src/reset.css Resolved
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 17, 2026
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 821b45b

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 17, 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. The Switch thumb and inherited-text fixes work as the changesets and records describe, and the points raised on the previous head are fixed in code; one description fix is needed before this lands.

  • The pull request description still says reset.css gives body the body size, that an app's own body font-size wins, that INV20 is set on body, that plain inherited text is now 14px everywhere and that reset.test.ts asserts the body rule, but at this head reset.css sets no font size (reset.css:98-103, asserted by reset.test.ts:221-232) and only each Theme wrapper does, so please rewrite those lines to the Theme-only route the changeset already states.

Two non-blocking wording notes on the verification rows are inline. CI is still running on this head, so the WebKit Switch touch test and the canonical setup test, which failed on the previous head, still need a green run.

Claims and files checked

Review mode: full; reason: spec-record

  • Changeset, inherited text: text inside a Theme with no size of its own takes the theme's body size, 14px by default: verified (Theme.tsx:86; a span inside the Theme measures 16px on the base and 14px on the head).
  • Changeset, inherited text: Card and Stack text, a Blockquote's quote and Text type="inherit" follow the token: verified (none sets its own size; text.stylex.ts:143).
  • Changeset, inherited text: text outside a Theme and host styles are unchanged, since reset.css sets no size: verified (reset.css:98-103; a span on body stays 16px).
  • Changeset, inherited text: a container's own font-size inside the Theme, or the theme's --text-body-size, keeps 16px, the second also sizing Core body text: verified (inheritance from the wrapper's declaration; Text body reads the same token).
  • Changeset, switch thumb: the thumb is drawn at 50% while the track keeps the pill token: verified (Switch.tsx:540, :333; y2k thumbs 0px to 50%, track 0px).
  • Changeset, switch thumb: a theme that wants a square thumb sets the radius on switch-thumb: verified (Switch.doc.mjs:204; theme rules sit in a later layer than component styles).
  • Description: a theme that squares pills squared the thumb, and the radio already draws at 50%: verified (y2kTheme.ts:301, RadioListItem.tsx:85).
  • Description: Core set no size on body or the Theme wrapper, so inherited text stayed at 16px: verified on the base.
  • Description: reset.css gives body the size, on body not html, keeping the browser size with no token, with an app's body size winning over it: false (reset.css:98-103).
  • Description: INV20 sets it on body and on each Theme: false (theme-compilation.md:272-281).
  • Description: plain inherited text is now 14px by default: false outside a Theme.
  • Description: 88 of 768 templates change only at inherited-text spots; other apps move because they load reset.css: not reproduced, and the second rests on the removed rule.
  • Description: Scope lists reset.css: false (not changed).
  • Description: no new public API: verified (0 API rows for Core and the seven themes).
  • Description, testing: the thumb source-build test and the Theme wrapper test: verified (each fails on the base and passes on the head).
  • Description, testing: reset.test.ts asserts the body rule: false (it asserts no font size on html or body).
  • Description, testing: the Switch, Theme and reset suites, the knowledge check and Prettier pass: verified for the unit suites, the knowledge check and Prettier; the browser suites have not run on this head.
  • Files: .changeset/core-inherited-text-body-size.md clear; .changeset/core-switch-thumb-circle.md clear; docs/architecture/theme-compilation.md non-blocking note (INV20 verification row); docs/specs/components/Switch/Switch.spec.md clear; docs/specs/components/theme/Theme.spec.md non-blocking note (FR1 verification row); Switch.thumbCircle.source-build.test.mjs clear; Switch.tsx clear; Switch.interaction.browser.spec.ts clear; reset.test.ts clear; Theme.test.tsx clear; Theme.tsx clear.

Automated review (maintainer link)

| INV18 | `colorModeBlocks.test.ts` output tests, `build-theme.color-mode-blocks.test.mjs` (CLI-built CSS), and `colorModeBlocks.a11y.chromium.spec.ts` (the ColorModeBlocks story: the Theme's mode, system preference, a mode that is neither, nested Theme, media surfaces one and more deep, explicit Text and Heading props alike at the root and on a surface, a press, Pagination's current page and a text field's status border kept in the other mode) | A mode block applies in the other mode, overrides a base-layer rule there, or changes CSS for a theme without blocks |
| INV19 | `generateThemeRules.test.ts` (the scope-root font rule), `reset.test.ts` (the `html` rule, none on `body`), and `reset.font.a11y.chromium.spec.ts` (a label measured in a span in `body` has its drawn width in the theme root; a page with no token keeps its font) | Text measured or drawn in `body` uses a different font from the token at the page root, or a page with no token changes font |
| INV19 | `generateThemeRules.test.ts` (the scope-root font rule), `reset.test.ts` (the `html` font rule, no font on `body`), and `reset.font.a11y.chromium.spec.ts` (a label measured in a span in `body` has its drawn width in the theme root; a page with no token keeps its font) | Text measured or drawn in `body` uses a different font from the token at the page root, or a page with no token changes font |
| INV20 | `Theme.test.tsx` (the wrapper's body size) and `reset.test.ts` (no font size on `html` or `body`) | Text inside a Theme with no size of its own |

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.

Non-blocking: the failure column names a state, not a failure. Suggested:

Text inside a Theme with no size of its own draws at another size than its theme's body size, or the reset sets a font size on html or body.

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 21e9bff

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · c326dc4

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
Switch · Storybook 109.4 kB (+5 B) · 10.0 kB CSS (+10 B) 1,733 (0) — · — · —

Package size: @astryxdesign/core 7.65 MB packed (+157 B); no new dependencies.

Wide change (shared styles: packages/core/src/theme/Theme.tsx): add ci:run-visual for Visual, ci:run-a11y for Accessibility, ci:run-rtl for RTL.

Current run: CI concluded failure; parts of this report may be missing.


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.

Approved pending CI. The Switch thumb now stays round under a theme that squares its pills, and unsized text inside a Theme takes the theme's body size; the changesets, records, tests and the rewritten description all match the code. CI has not run on this head yet: its run was cancelled because CI had no room, so this approval waits for a re-run of the CI workflow and its required checks to pass.

Two non-blocking wording notes on the INV20 and Theme FR1 verification rows are still open inline.

Claims and files checked

Review mode: incremental; reason: none

  • Changeset, inherited text: text inside a Theme with no size of its own takes the theme's body size, 14px by default instead of 16px: verified (Theme.tsx:86; a span inside the Theme measures 16px on the base and 14px on the head).
  • Changeset, inherited text: plain text in a Card or Stack, a Blockquote quote and Text type="inherit" follow the token and move with a theme's text size: verified (none sets its own size; text.stylex.ts:142-144; the Blockquote quote goes from 16px to 14px).
  • Changeset, inherited text: text outside a Theme and a host's own styles are unchanged, since reset.css sets no size: verified (reset.css:86-103; a span on body stays 16px).
  • Changeset, inherited text: a font-size on your own container inside the Theme, or the theme's --text-body-size, keeps 16px, the second also sizing Core body text: verified (inheritance below the wrapper; text.stylex.ts:110).
  • Changeset, switch thumb: the thumb is drawn at 50% while the track keeps the pill token: verified (Switch.tsx:540, :333; y2k thumbs go from 0px to 50%, the track stays 0px).
  • Changeset, switch thumb: a theme that wants a square thumb sets the radius on switch-thumb: verified (Switch.doc.mjs:204; theme rules sit in a later layer, reset.css:40).
  • Description: a theme that squares pills squared the thumb, and the radio already draws at 50%: verified (y2kTheme.ts:301, RadioListItem.tsx:85).
  • Description: the Theme wrapper set no size, so inherited text in Card, Stack, Carousel, Blockquote, ChatTokenizedText and Text type="inherit" stayed at 16px while Core body text used 14px: verified on the base.
  • Description: each Theme wrapper carries its body size, a nested Theme's included, reset.css sets none, and line height is unchanged: verified (Theme.tsx:86; reset.css:88 keeps line-height: 1.5, so lines shorten with the text).
  • Description: Switch FR16, Theme FR1 and INV20 state this behavior: verified (Switch.spec.md:173, Theme.spec.md:86, theme-compilation.md:272).
  • Description: the default look changes on purpose, with the same two escapes the changeset gives: verified.
  • Description: the template render sweep (80 of 770 change, all at inherited text) and the check of another theme and two apps: not reproduced; consistent with the two style changes being the only rendering changes.
  • Description: scope Switch and Theme, no new public API, no internal context in public text: verified (0 API rows for Core and the seven themes).
  • Description, testing: the thumb source-build test, the browser radius check, the Theme wrapper test and the reset guard: verified (the thumb and Theme tests fail on the base and pass on the head; the reset case passes on both).
  • Description, testing: the Switch, Theme and reset suites, the knowledge check, Prettier and the changeset check pass: verified; the core typecheck was not rerun here.
  • Description: the writing self-check of the new record rows (no narration, no change references, tests named): verified.
  • Files: .changeset/core-inherited-text-body-size.md clear; .changeset/core-switch-thumb-circle.md clear; docs/architecture/theme-compilation.md non-blocking note (INV20 verification row); docs/specs/components/Switch/Switch.spec.md clear; docs/specs/components/theme/Theme.spec.md non-blocking note (FR1 verification row); Switch.thumbCircle.source-build.test.mjs clear; Switch.tsx clear; Switch.interaction.browser.spec.ts clear; reset.test.ts clear; Theme.test.tsx clear; Theme.tsx clear.

Automated review (maintainer link)

@josephfarina josephfarina reopened this Nov 17, 2026
@josephfarina josephfarina reopened this Nov 17, 2026
@josephfarina
josephfarina marked this pull request as draft November 17, 2026 17:02
@josephfarina
josephfarina marked this pull request as ready for review November 17, 2026 18:25
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 17, 2026
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec b6893a2

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 17, 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. The Switch thumb now stays round under a theme that squares its pills, and text inside a Theme that sets no size of its own now takes the theme's body size; both fixes, their tests and the changesets check out at this head. One record row needs restoring before approval:

  • docs/specs/components/theme/Theme.spec.md:135: the rebase replaced the component:Theme FR1 verification row with the FR1 requirement text (three cells under a five-column header), so FR1 cites no test, failure expectation or audit section and the description's writing-rubric result for that row no longer holds; restore the row and cite the new body-size test, as the inline suggestion shows.

CI's heavy checks have not run on this head because the run was cancelled while CI was full, so they still need to pass after the fix. A few non-blocking wording suggestions are inline.

Claims and files checked

Review mode: full; reason: rebase

  • Claim: a theme that squares its pills squared the switch thumb on the base — verified (base Switch.tsx:537, the y2k theme's pill radius is 0px, base probe 0px).
  • Claim: the thumb is now drawn at 50% and the track keeps the pill token — verified (Switch.tsx:540, Switch.tsx:333; the new source-build test fails on the base and passes here; y2k probe 0px to 50%).
  • Claim: a theme can still square the thumb through the switch-thumb target — verified (Switch.doc.mjs:204; theme target rules sit in a layer above Core's styles).
  • Claim: the radio already draws its circle at 50% — verified (Indicator/RadioIndicator.tsx:35).
  • Claim: the Theme wrapper set no font size, so unsized text stayed at 16px beside 14px body text — verified (base Theme.tsx; the new Theme test fails on the base).
  • Claim: each Theme wrapper now declares the body size, a nested theme's included — verified (Theme.tsx:87; theme variables are scoped to the wrapper itself).
  • Claim: plain text in Card, Stack and Carousel, a Blockquote quote, ChatTokenizedText text and Text type="inherit" follow it — verified (none sets a font size; Blockquote probe 16px to 14px).
  • Claim: the reset sets no font size, so text outside a Theme keeps its size — verified (reset.css:86-103, reset.test.ts:221, probe html and body stay 16px).
  • Claim: line height is unchanged — true for declarations; computed line height scales with the text (24px to 21px).
  • Claim: 16px stays reachable through a container font size or the theme's body size token — verified (CSS inheritance).
  • Claim: the default look moves from 16px to 14px — verified (the token is 0.875rem; probes).
  • Claim: before/after renders of every template show only inherited text changing — not reproduced here; the probes agree.
  • Claim: other themes and apps were checked — not verifiable in this review.
  • Claim: no new public API — verified (API generator: 0 rows across Core, build, richtext and the seven themes).
  • Claim: public text carries no internal context — verified.
  • Claim: the new tests and the Switch, Theme and reset suites pass, as do the knowledge, Prettier and changeset checks — verified (114 tests; each check exits 0); the browser spec's 50% expectation was read, not run.
  • Claim: the writing rubric covered the Theme FR1 verification row, and verification cells name tests — false (Theme.spec.md:135).
  • File: .changeset/core-inherited-text-body-size.md — clear.
  • File: .changeset/core-switch-thumb-circle.md — clear.
  • File: docs/architecture/theme-compilation.md — non-blocking (INV20 failure cell wording).
  • File: docs/specs/components/Switch/Switch.spec.md — clear.
  • File: docs/specs/components/theme/Theme.spec.md — blocking (FR1 verification row).
  • File: packages/core/src/Switch/Switch.thumbCircle.source-build.test.mjs — clear.
  • File: packages/core/src/Switch/Switch.tsx — clear (non-blocking comment wording).
  • File: packages/core/src/Switch/__tests__/Switch.interaction.browser.spec.ts — clear.
  • File: packages/core/src/reset.test.ts — clear.
  • File: packages/core/src/theme/Theme.test.tsx — clear.
  • File: packages/core/src/theme/Theme.tsx — clear.

Automated review (maintainer link)

alignItems: 'center',
justifyContent: 'center',
borderRadius: radiusVars['--radius-full'],
// A circle marks the thumb; it is no corner. 50% draws it on the square

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.

Non-blocking (INV29): "it is no corner" is vague. Suggested:

// The thumb is a circle on its square box. A theme that squares
// --radius-full squares the track and keeps the thumb round.

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

Copy link
Copy Markdown
Contributor Author

/approve-spec c326dc4

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 17, 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.

Approved pending CI. CI is still running on this head, so its remaining unit, interaction and build checks still need to pass. The Switch thumb now stays round under a theme that squares its pills, text inside a Theme that sets no size of its own takes the theme's body size, and the restored Theme record FR1 verification row clears the last blocker.

Non-blocking: the FR1 row's failure cell still names only the theme attribute (inline suggestion), and the two earlier wording suggestions on the INV20 verification row and the Switch thumb comment are still open.

Claims and files checked

Review mode: full; reason: spec-record

  • Claim (changeset): text inside a Theme that sets no size now uses the theme's body size, 14px by default instead of 16px — verified (Theme.tsx:87; the new Theme test fails on the base and passes here; Blockquote probe 16px to 14px).
  • Claim (changeset): plain text in Card and Stack, a Blockquote quote and Text type="inherit" follow the body size token and move with the theme — verified (Card and Stack set no font size; Blockquote.tsx sizes only the citation; text.stylex.ts:143).
  • Claim (changeset): text outside a Theme and a host's own styles are unchanged because the reset sets no font size — verified (reset.css:86-103, reset.test.ts:221; probe: html and body stay 16px).
  • Claim (changeset): 16px stays reachable through a font size on your own container inside the Theme, or the theme's body size token, which also sizes Core's body text — verified (CSS inheritance; text.stylex.ts:110).
  • Claim (changeset): the thumb is drawn at 50% instead of the pill token, so a squared-pill theme squares the track and keeps a round thumb — verified (Switch.tsx:540, Switch.tsx:333; y2k probe thumbs 0px to 50%, track 0px).
  • Claim (changeset): a theme that wants a square thumb sets the radius on switch-thumb — verified (Switch.tsx:1055; theme target rules load in a layer above Core's styles, Theme.tsx:152).
  • Claim: the pill token squared the thumb under a squared-pill theme — verified (base Switch.tsx:537; base y2k probe 0px).
  • Claim: the radio already draws its circle at 50% — verified (Indicator/RadioIndicator.tsx:35).
  • Claim: the Theme wrapper set no font size, so unsized text stayed at 16px beside 14px body text — verified (base Theme.tsx; red-first Theme test).
  • Claim: Card, Stack and Carousel text, a Blockquote quote, ChatTokenizedText text and Text type="inherit" are covered — verified (none sets a font size for that text).
  • Claim: each wrapper carries its own theme's size, a nested theme's included — verified (Theme.tsx:87; theme variables live on the wrapper itself).
  • Claim: line height is unchanged — true for the declaration (reset.css:88); computed line height scales with the text (24px to 21px).
  • Claim: the default look moves from 16px to 14px inside a Theme, and the changeset says how to keep 16px — verified (token 0.875rem; probes; changeset text).
  • Claim: before/after renders of every template show only inherited text changing — not reproduced; the probes agree.
  • Claim: another theme and two apps were checked — not verifiable in this review.
  • Claim: no new public API — verified (API surface comparison: 0 rows across Core and the seven themes).
  • Claim: public text carries no internal context — verified.
  • Claim: the new source-build test checks a 50% thumb and a pill-token track — verified (fails on the base, passes here).
  • Claim: the browser interaction spec now expects 50% — verified (the Switch touch spec passes in Chromium, 47 tests).
  • Claim: the Theme test checks the wrapper's body size and the reset test checks no font size on html or body — verified (the Theme case fails on the base; the reset case is a guard).
  • Claim: the Switch, Theme and reset suites, the knowledge check, Prettier and the changeset check pass — verified (138 tests; each check passes).
  • Claim: the writing rubric covered the new Switch row, the Theme FR1 row and INV20, and verification cells name tests — verified (Switch.spec.md:336, Theme.spec.md:135, theme-compilation.md:410).
  • File: .changeset/core-inherited-text-body-size.md — clear.
  • File: .changeset/core-switch-thumb-circle.md — clear.
  • File: docs/architecture/theme-compilation.md — non-blocking (INV20 failure cell wording).
  • File: docs/specs/components/Switch/Switch.spec.md — clear.
  • File: docs/specs/components/theme/Theme.spec.md — non-blocking (FR1 failure cell); the earlier blocker is fixed.
  • File: packages/core/src/Switch/Switch.thumbCircle.source-build.test.mjs — clear.
  • File: packages/core/src/Switch/Switch.tsx — clear (non-blocking comment wording).
  • File: packages/core/src/Switch/__tests__/Switch.interaction.browser.spec.ts — clear.
  • File: packages/core/src/reset.test.ts — clear.
  • File: packages/core/src/theme/Theme.test.tsx — clear.
  • File: packages/core/src/theme/Theme.tsx — clear.

Automated review (maintainer link)

| FR2 | `ThemeColorScheme.a11y.chromium.spec.ts` with the `Core/Themes/ColorScheme` story | system root under a host's dark root; reader light; reader dark with `reset.css`, and without it on a root that names no scheme; system under forced light; system under system | A system Theme that declares its own scheme under a host's dark root, a root that stops following the reader with `reset.css`, a root without `reset.css` that turns dark for a dark reader, or a system Theme under forced light that stays light for a dark reader, fails. | `audit:Theme/behavior` |
| Contract | Verification | Representative states | Mutation or failure expectation | Audit section |
| -------- | ---------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------- |
| FR1 | `Theme.test.tsx` "sets data-astryx-theme on wrapper div" and "gives text inside that only inherits its size the theme's body size" | any theme | A missing theme attribute fails. | `audit:Theme/behavior` |

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.

Non-blocking: this row now cites the body-size case, but its failure cell still names only the theme attribute, so the record understates what the row guards. Suggested:

A missing theme attribute or body size fails.

@josephfarina
josephfarina merged commit dda9859 into main Nov 17, 2026
169 of 171 checks passed
@github-actions
github-actions Bot deleted the core-switch-textsize branch November 18, 2026 06:04

This branch was successfully deployed

1 active deployment
Preview — c326dc47 Deployed Nov 17, 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. needs:design-review Affects visuals — Design should review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant