Repository navigation
Conversation
Theme font sizes stay in em but are divided by the parent's effective size instead of a fixed 14px, so a typed size renders at that size. The canvas no longer applies paragraph and list rules inside lists, matching what the serializer emits. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ThnJ4aUsDUrDw7cVwSLQT6
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 67a3b96 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
There was a problem hiding this comment.
1 issue found across 6 files
Confidence score: 3/5
- In
extension.tsx, nested list items can render at the wrong size because their explicit size compounds with the nested-list size. Resolve each item’s size against its actual containing list.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/editor/src/plugins/email-theming/extension.tsx">
<violation number="1" location="packages/editor/src/plugins/email-theming/extension.tsx:94">
P2: Nested list items reuse the top-level list-item ratio, so an explicit list-item size compounds with the nested-list size instead of rendering at the typed size. Resolve each list item against its actual containing list level in the serializer and corresponding canvas selectors.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
| const FONT_SIZE_PARENTS: Partial< | ||
| Record<KnownThemeComponents, KnownThemeComponents> | ||
| > = { | ||
| listItem: 'list', |
There was a problem hiding this comment.
P2: Nested list items reuse the top-level list-item ratio, so an explicit list-item size compounds with the nested-list size instead of rendering at the typed size. Resolve each list item against its actual containing list level in the serializer and corresponding canvas selectors.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At packages/editor/src/plugins/email-theming/extension.tsx, line 94:
<comment>Nested list items reuse the top-level list-item ratio, so an explicit list-item size compounds with the nested-list size instead of rendering at the typed size. Resolve each list item against its actual containing list level in the serializer and corresponding canvas selectors.</comment>
<file context>
@@ -86,6 +87,14 @@ export function getThemeComponentKey(
+const FONT_SIZE_PARENTS: Partial<
+ Record<KnownThemeComponents, KnownThemeComponents>
+> = {
+ listItem: 'list',
+ nestedList: 'listItem',
+};
</file context>
There was a problem hiding this comment.
This is real and is the limit recorded in the shortcut: comment on this constant and in the PR description: a list item has one theme key but two possible parents (a top-level list or a nested list), so one em value cannot be exact for both.
Not fixing it in this PR. It needs per-node resolution in the serializer plus separate canvas selectors per list level, which is a larger change than this fix. The case only shows up when List item and Nested list both have explicit sizes. Leaving the thread open for the PR author to decide on a follow-up.
Generated by Claude Code
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ThnJ4aUsDUrDw7cVwSLQT6
There was a problem hiding this comment.
0 issues found across 2 files (changes from recent commits).
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Requires human review: Auto-approval blocked by 1 unresolved issue from previous reviews.
View guided diff | Re-trigger cubic
Related issue or discussion
Internal report, MES-3088: theme text sizes in the editor do not render at the size typed.
What this changes
Theme font sizes are typed in px and compiled to em. Every size was divided by a fixed 14, not by the size of the element it sits in, so the result depended on the base Text size and on nesting. With Text 15, a Title of 15 rendered at 16.07px and a Title of 14 rendered at 15px.
Sizes still compile to em. What changed is the divisor:
Text / 14em, relative to the mail client's default.size / parent sizeem. The parent is the base Text size, except list item → list and nested list → list item.2.25em) keep scaling with the base.With Text 15, Title 15 now compiles to
1emand Title 14 to14/15em.Canvas and email parity for lists:
codetag's0.92emon the canvas only; that tag now gets1emwhen the block has an explicit size.stylesToCssnow callsgetMergedCssJsinstead of repeating it. No public signature changed.Behaviour change to review
With the default Text size (14), output is identical to before except for the list chain: a List item size under an explicit List size, and a Nested list size under an explicit List item size, now divide by that parent instead of 14. Saved themes that set both will render those at the typed size, which differs from what they render today.
Known limit
Links, inline code, and list items under a nested list resolve against one static parent, so mixed explicit sizes there can still compound. Noted in a
shortcut:comment.Tests
Checklist
Generated by Claude Code
Summary by cubic
Fixes editor theme font sizes so typed px sizes render at the size typed. Sizes compile to
embut were divided by a fixed 14px; they now divide by the parent element's effective size, so a Title under 15px Text renders at 15px, a list item resolves against the list size, and a nested list against the list item size. The canvas selectors now match the serializer so paragraph, list, and code block sizes no longer compound, andstylesToCssdelegates togetMergedCssJs.With the default 14px Text, email output is unchanged except for saved themes that set a size on both a list and its list item, or a list item and its nested list; those now render at the typed size.
Written for commit 67a3b96. Summary will update on new commits.