Skip to content

set: a text size for a part with several text pieces goes to its largest - #13234

Merged
josephfarina merged 1 commit into
feature/theme-editorfrom
josephfarina/r15-fu-text-size-main-piece
Nov 21, 2026
Merged

josephfarina merged 1 commit into
feature/theme-editorfrom
josephfarina/r15-fu-text-size-main-piece

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

User impact

set <theme> font-size 20px --on top-nav-heading was refused: the heading's text is drawn by a title and a supporting line inside it, each reading its own text size token, and set offered both tokens without saying which line each sets.

Problem and solution fit

A text size on a part whose inner text reads one size token already goes into that token (a code block). With several, set refused, though the largest is plainly the part's main text. The fix sends the value to the largest token, as the sizes resolve, and refuses as before where no one main text can be told.

Expected behavior and authority

The existing rule for one inner size token: the value goes into the token the inner text reads, on the part, saved as typed.

Smallest restoration

Two helpers in _settings.mjs: mainTextSizeToken (several text size tokens read by elements inside the part itself; the largest through var(); a tie, an unreadable size, a text column, or sizes taken from held parts name none) and namesToken (a value naming the token is never written into it). Set's property check uses them for the note; the build writes only that token. The setting is saved as typed, so undo finds it and every value check still runs. A group keeps its reading. The set docs say where such a size goes.

Evidence

  • Reproduction before the change: the line above is refused.
  • Result after the change: .astryx-top-nav-heading { --text-large-size: 20px; }, no font-size line.
  • Representative unchanged path: font-size 14px --on banner sets each line; font-size red, font-size 'var(--text-large-size)' and --on nav-icon are refused as before.
  • Regression test or other mutation-sensitive proof: theme-edit-text-size-main-piece.test.mjs (the main row fails before; undo, bad values, an icon, a column), and the refusal row in theme-set-takes-text-a-part-reads.test.mjs moved to the new answer.

Scope

Components: cli/api/theme-edit (set)

  • 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 packages/cli/api/theme-edit (the whole theme-edit directory) passes.

preflight: pass 964c976 (CI green; review: no blocking findings, one owner question)

replay: worse 0 at 964c976

@vercel

vercel Bot commented Nov 21, 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 21, 2026 7:16am UTC

Request Review

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

astracat-bot Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🔄 In progress (for maintainers only) Nov 21, 2026, 7:52 AM UTC

@github-actions

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 964c976

This branch's preview address cannot be known in advance; open it from Vercel's comment.

Current run: The current CI run concluded cancelled. Current analysis is unavailable.


Generated by PR Enrichment workflow | View current CI run

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

Approval waits on an engineering owner's decision at this head, and two problems need fixing whatever that decision is.

No current spec record says where astryx experimental theme editor set <theme> font-size <size> --on <part> sends a text size when the part's text reads several size tokens, so an engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request (the author may do so as an engineering owner) or names the record that governs it; what needs settling is that the value goes into the largest inner size token by Core's defaults and only that token is written on the part.

Blocking findings:

  • mainTextSizeToken (packages/cli/api/theme-edit/_settings.mjs:15070) does not refuse a part that holds other parts, so font-size 20px --on popover writes --text-label-size: 20px on every popover (its buttons and checkbox labels grow to 20px while its heading and body text stay at 14px) and --on calendar grows only the month label, each with a note that the size "also reaches" the held parts although no font-size is written; please return null when the part holds other parts and add refusal rows for popover and calendar.
  • The changeset says a part whose sizes come from the parts it holds is "refused as before", but popover and calendar are accepted at this head; the fix above makes that true, or the note should name the parts the rule reaches.

Not blocking: the comment above the check in _check.mjs still says several tokens are refused, and namesToken could replace the three inline copies of the same test in compileTheme.

Claims and files checked

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

Claims:

  • A text size for a part whose inner pieces each read a size token goes into the largest one, the top nav heading's title: verified for the top nav heading (new test, built rule); false as a general rule, since popover and calendar get a token that is not their main text.
  • The setting is saved as typed and undo finds it: verified (new test; the saved setting is font-size).
  • The build writes only the token: verified (the built rule holds no font-size).
  • A tie, sizes from held parts, an icon sized by spacing and a value naming the token are refused as before: tie verified in code (strict comparison); icon verified (nav-icon row on base and head); a value naming the token verified (test, plus a calc() case); sizes from held parts false (popover, calendar).
  • A text column's lines each still take it: verified (banner row on base and head).
  • The top nav heading command was refused on the base, offering both tokens: verified (base run).
  • One inner token already goes into that token, as for a code block: verified (existing row on base and head).
  • The largest inner token is plainly the part's main text: true for both nav headings and the mega menu item; false for popover and calendar.
  • The helper names none for an unreadable size or a text column: verified in code and by the banner row.
  • A value naming the token is never written into it: verified.
  • The check uses the helpers for its note and the build writes only that token: verified.
  • Every value check still runs: verified (red refused).
  • A group keeps its reading: verified in code (the one-part guard in both check and build).
  • The set docs say where such a size goes: verified (the same sentence in both docs).
  • Unchanged paths (banner, red, var(--text-large-size), nav-icon): verified on base and head.
  • The regression test fails before the change: verified (two new rows and the moved row fail on the base).
  • One defect is restored, with no new behaviour under the fix label: not established, since no current spec defines the expected answer (decision above).
  • Public text has no internal context: verified.
  • The whole theme-edit test directory passes: partly checked; the two changed and five related test files pass, and the full directory was not rerun.
  • Preflight passed with CI green: not confirmed at this head; lint and the CLI smoke test passed, and the CI workflow was cancelled before its test jobs ran.

Files:

  • .changeset/experimental-theme-text-size-main-piece.md: finding (the held-parts claim).
  • packages/cli/api/theme-edit/_settings.mjs: finding (no held-parts guard).
  • packages/cli/api/theme-edit/_check.mjs: finding (accepts popover and calendar through the same helper); stale comment, not blocking.
  • packages/cli/api/theme-edit/theme-edit-text-size-main-piece.test.mjs: clear; covers the top nav heading only.
  • packages/cli/api/theme-edit/theme-set-takes-text-a-part-reads.test.mjs: clear.
  • packages/cli/api/theme-edit/themeEditSet.doc.mjs: clear.
  • packages/cli/clients/cli/commands/experimental-theme-editor-set.doc.mjs: clear.

Automated review (maintainer link)

*/
export function mainTextSizeToken(C, part, tokens) {
const rec = C.MAP[part];
if (!rec || rec.own?.['font-size']) return null;

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 accepts a part that holds other parts. popover (no text of its own, 25 held parts in the census) and calendar both pass. So font-size 20px --on popover writes --text-label-size: 20px into every popover: its buttons and checkbox labels grow to 20px, and its heading and body text stay at 14px. The result also says the size "also reaches" the held parts, but no font-size is written. Returning null when the part holds other parts keeps top-nav-heading, side-nav-heading and top-nav-mega-menu-item:

if (!rec || rec.own?.['font-size'] || rec.contains?.length) return null;

'@astryxdesign/cli': patch
---

[experimental] `astryx experimental theme editor set <theme> font-size <size> --on <part>` takes a text size for a part whose text is drawn by elements inside it that each read a text size token: the value goes into the token of its main text, the largest as the sizes resolve (a top nav heading's title, not its supporting line), on that part. The setting is saved as typed, so `undo` finds it, and the build writes only the token. Where no one main text can be told (a tie, sizes from the parts it holds, an icon sized by spacing, a value naming the token itself) it is refused as before; a text column's lines each still take it.

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.

popover and calendar hold other parts, but at this head they are accepted, so "sizes from the parts it holds … refused as before" is not true yet. The guard in mainTextSizeToken makes it true, and refusal rows for both in the new test would keep it true.

@josephfarina

Copy link
Copy Markdown
Contributor Author

Covers the theme-editor reading this pull request records (the owner's ruling): font-size set on one part whose inner elements read several text-size tokens takes the largest of them by Core's defaults; it is refused where no one main text can be told; it is saved as typed and built as the token alone.

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 964c976

@astracat-bot

astracat-bot Bot commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

In reply to @josephfarina

I'll run a full review to re-check this with your note.

@josephfarina
josephfarina changed the base branch from main to feature/theme-editor November 21, 2026 07:55
@josephfarina
josephfarina merged commit 516e792 into feature/theme-editor Nov 21, 2026
19 of 70 checks passed
josephfarina added a commit that referenced this pull request Nov 21, 2026
…est (#13234)

Reviewed pull request #13234, merged into the theme working branch. It reaches main with the branch's next landing.
josephfarina added a commit that referenced this pull request Nov 21, 2026
…est (#13234)

Reviewed pull request #13234, merged into the theme working branch. It reaches main with the branch's next landing.
josephfarina added a commit that referenced this pull request Nov 21, 2026
…est (#13234)

Reviewed pull request #13234, merged into the theme working branch. It reaches main with the branch's next landing.
josephfarina added a commit that referenced this pull request Nov 21, 2026
…est (#13234)

Reviewed pull request #13234, merged into the theme working branch. It reaches main with the branch's next landing.
@josephfarina

Copy link
Copy Markdown
Contributor Author

Taken out of landing #13276 because the review of the combined head flagged a line this change made. It stays on the working branch and rides the next landing together with its fix: open the fix as a new pull request based on the working branch (it already holds this change), whose description names #13234.

josephfarina added a commit that referenced this pull request Nov 21, 2026
…est (#13234)

Reviewed pull request #13234, merged into the theme working branch. It reaches main with the branch's next landing.
josephfarina added a commit that referenced this pull request Nov 21, 2026
- #13190 perf(cli): the first how ask compiles only the lexicon patterns it can match
- #13167 how: no rounding anywhere squares the pill radius too
- #13234 set: a text size for a part with several text pieces goes to its largest
- #13248 docs(changeset): #13190's release note states no pattern count
- #13039 fix(cli): experimental theme editor - controls share one height at each size
- #13040 feat(cli): experimental theme editor - a badges setting styles the status and category badges in the theme's colors
- #13285 set: a part that holds other parts has no main text for a size
- #13260 how: no rounding anywhere reads its scope word on the corner ask alone
- #12723 experimental theme how: a mood said beside an ask is named as not used, never dropped
@josephfarina

Copy link
Copy Markdown
Contributor Author

Landed on main in #13315.

@github-actions
github-actions Bot deleted the josephfarina/r15-fu-text-size-main-piece branch November 22, 2026 06:04

This branch was successfully deployed

1 active deployment
Preview — 964c9762 Deployed Nov 21, 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