Skip to content

Manager UI - Replace raw fontSize literals with typography variants - #4308

Open
agalin920 wants to merge 3 commits into
devfrom
fix/4287-fontsize-typography-variants
Open

Manager UI - Replace raw fontSize literals with typography variants#4308
agalin920 wants to merge 3 commits into
devfrom
fix/4287-fontsize-typography-variants

Conversation

@agalin920

@agalin920 agalin920 commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Refs #4287. Covers the sweep everywhere it can be made without changing a rendered value the design system does not already own; what is left is listed at the bottom and the issue stays open.

Two commits, deliberately separable.

c48906bd4 — 26 literals, rendered-identical. 15 sites at 14px/20px become body2, the two GlobalSearch ListSubheaders become body3, and 9 fontSize: "16px" declarations on widget CardHeader roots are deleted rather than converted — those roots have zero direct text nodes, so the declaration renders nothing. Verified as a getComputedStyle before/after diff over the 112 text-bearing elements of the content-item widget rail: zero differences in font-size, line-height, letter-spacing, weight, display or box size. body3 carries display: inline-block, which would collapse a sticky full-width subheader, so display is pinned beside the variant.

8d19d7826 — the 10 overline headers, a deliberate rendered change. The item-editor widget headers hand-rolled overline and lost its tracking; they were inheriting letter-spacing: -0.56px from CardHeader's default h5 variant, not normal as the issue assumes. Adopting the variant moves all ten to letter-spacing: 1px — measured, and it is the only property that changes: font-size stays 12px, line-height 32px, weight 400, colour rgb(16,24,40), and every box stays 287×32, so nothing reflows or wraps. Eight headers also pick up text-transform: uppercase from the variant with no visible effect, their titles already being literal uppercase strings.

Raw fontSize literals in src/ go 63 → 27 across 24 files.

What the 27 remaining occurrences are, and why none of them are in this PR. 16 are MUI icons or a Skeleton and are out of scope by the issue's own Scope section — which also means its "18px ×5 — no variant exists" and "28/20/32 ×5 → h3/h5/h2" rows should not be actioned at all; they would resize glyphs. 5 have no variant to adopt (10px/14px ×2, and three ListItem sites measured at a rendered 14/24, which is neither body2 14/20 nor subtitle2 14/22) and go to design under docs/design-system.md §4. 4 sit on surfaces I could not reach to measure — two empty states and a Link in the code editor's bottom drawer.

The last 2 are two of the issue's own 19 "exact matches" and are deliberately left: CompareDialog.tsx:337 and PropertiesDialog.tsx:362 set 12px/18px via secondaryTypographyProps but, unlike the GlobalSearch pair, carry no letterSpacing today, so adopting body3 would add 0.15px of tracking and display: inline-block. Both render only in Analytics dialogs that need a connected GA property, so I could not measure the result and did not guess it. 17 of 19, not 19.

Typecheck 0 errors / 0 in src/, unchanged from the branch point. npm run build:dev exits 0. cypress/e2e/content/actions.spec.js 17/17 and cypress/e2e/search/search-bar.spec.js 4/4.

No reviewer pass ran on either commit — the session instruction ruled out subagents, so this diff was reviewed only by its author.

Refs #4287. The exact-match slice only; the overline, ambiguous and
no-variant slices are held pending a design decision.
Refs #4287. Rendered change: letter-spacing -0.56px -> 1px on ten
headers. Box widths and heights are unchanged.
@agalin920 agalin920 changed the title Content - Replace exact-match fontSize literals with typography variants Content - Replace raw fontSize literals with typography variants Aug 31, 2026
@agalin920 agalin920 changed the title Content - Replace raw fontSize literals with typography variants Manager UI - Replace raw fontSize literals with typography variants Aug 31, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Coverage Report

Overall Coverage

Lines Statements Branches Functions
61.41% 60.97% 56.34% 55.77%

Changed Files Coverage

File Lines Statements Branches Functions
src/apps/content-editor/src/app/views/ItemEdit/Content/Actions/Widgets/ContentInfo/index.js 45.45% 45.45% 37.50% 16.66%
src/apps/content-editor/src/app/views/ItemEdit/Content/Actions/Widgets/ContentLinks/ContentLinks.js 33.33% 33.33% 0.00% 0.00%
src/apps/content-editor/src/app/views/ItemEdit/Content/Actions/Widgets/Unpublish/Unpublish.js 12.50% 12.50% 0.00% 0.00%
src/apps/content-editor/src/app/views/ItemEdit/Content/Actions/Widgets/WidgetDeleteItem/WidgetDeleteItem.js 6.66% 6.66% 0.00% 0.00%
src/apps/content-editor/src/app/views/ItemEdit/Content/Actions/Widgets/WidgetDraftHistory/WidgetDraftHistory.js 0.00% 0.00% 0.00% 0.00%
src/apps/content-editor/src/app/views/ItemEdit/Content/Actions/Widgets/WidgetListed/WidgetListed.js 14.28% 12.50% 0.00% 0.00%
src/apps/content-editor/src/app/views/ItemEdit/Content/Actions/Widgets/WidgetPublishHistory/WidgetPublishHistory.js 0.00% 0.00% 0.00% 0.00%
src/apps/content-editor/src/app/views/ItemEdit/Content/Actions/Widgets/WidgetPurgeItem/WidgetPurgeItem.js 11.11% 11.11% 0.00% 0.00%
src/apps/content-editor/src/app/views/ItemEdit/Content/Actions/Widgets/WidgetQuickShare/WidgetQuickShare.js 11.11% 11.11% 0.00% 0.00%
src/apps/content-editor/src/app/views/ItemEdit/Content/Actions/Widgets/WorkflowRequest/WorkflowRequest.js 0.00% 0.00% 0.00% 0.00%
src/apps/content-editor/src/app/views/ItemEdit/components/BlockTabs/CodeSample.tsx 20.00% 20.00% 0.00% 0.00%
src/shell/components/GlobalSearch/index.tsx 80.42% 80.82% 70.45% 86.00%

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

QA Review — ⚠️ INCONCLUSIVE

Validates #4287: Manager UI - Replace raw fontSize px values with typography variants (TS/JS)

  1. ⚠️ The 19 exact-match sites use variants, rendered font-size/line-height unchanged — only 17/19 converted; CompareDialog.tsx:337 and PropertiesDialog.tsx:362 are deliberately left as literals (confirmed still present in source), and the getComputedStyle verification claimed for the rest can't be confirmed from a diff alone.
  2. ⚠️ The overline decision made once and recorded on the issue — applied uniformly across all 10 sites in code, but issue Manager UI - Replace raw fontSize px values with typography variants (TS/JS) #4287 currently has no comment recording it; the record only exists in the PR description.
  3. ✅ No 18px/10px value is snapped onto a nearby variant.
  4. ⚠️ Post-sweep count recorded on the issue — the claimed 63 → 27 / 24 files matches a fresh grep of src/, but the count itself is only posted in the PR body, not as a comment on the issue.
  5. ⚠️ tsc --noEmit shows no new src/ errors vs. baseline — plausible given the changes are prop swaps, but unverifiable without a node_modules install.
  6. ⚠️ npm run build:dev succeeds — same limitation, unverifiable from the diff alone.
Suggested Cypress coverage

cypress/e2e/content/actions.spec.js already exercises several of the touched widgets (WidgetListed, Unpublish, WidgetDeleteItem, WidgetPurgeItem, WidgetQuickShare, WorkflowRequest, ContentInfo, ContentLinks, WidgetDraftHistory, WidgetPublishHistory) by data-cy; since none of these lost or gained a data-cy attribute, existing assertions should still pass, but it's worth adding a case that opens each widget's CardHeader and asserts the title text is present and not truncated/wrapped differently now that overline also applies text-transform: uppercase and tighter tracking — a layout regression here wouldn't fail on selector alone.

cypress/e2e/search/search-bar.spec.js should cover that the "Recent Searches" and "Recently Modified …" ListSubheaders still render full-width and remain visible above their list items after the typography: "body3" + display: "list-item" override — body3's default inline-block would otherwise collapse the subheader, and a visual/width assertion (e.g. bounding box or should("be.visible") combined with a sibling layout check) would catch a regression that a pure existence check would miss.

fontSize: "12px",
typography: "body3",
// body3 carries display: inline-block; a subheader must stay full width.
display: "list-item",

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.

🟡 display: "list-item" is the wrong semantic override for inline-block
display: list-item creates a marker box on the li; no bullet appears here only because the parent ul[role="listbox"] inherits list-style: none from MUI's Autocomplete styles — a detail this element now silently depends on. If the component is ever reused outside that ul, or if MUI's reset changes, a bullet will appear. display: "block" achieves the same full-width result without the marker-box side-effect and without the hidden dependency.

Suggested change
display: "list-item",
display: "block",

fontSize: "12px",
typography: "body3",
// body3 carries display: inline-block; a subheader must stay full width.
display: "list-item",

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.

🟡 Same display: "list-item" fragility — should be display: "block"
Same reasoning as the RecentSearches header above: display: list-item works only because the parent ul suppresses the marker via list-style: none; display: "block" is the semantically correct and dependency-free fix.

Suggested change
display: "list-item",
display: "block",

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Code Review — ✅ No blockers · 🟡 2 warning(s) — see inline comments

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Negative QA

No reproducible edge-case failures found on the surfaces this PR changes.

Also checked and working correctly
  • Content-editor item-edit "Actions" sidebar (ContentInfo, ContentLinks, WidgetPublishHistory, WidgetDraftHistory, WorkflowRequest, WidgetQuickShare, Unpublish, WidgetDeleteItem) — all overline/body2/body3 variant headers and body text render with correct sizing, casing, and spacing; no truncation, overlap, or layout breaks after opening/closing the Info Bar, toggling DUO Mode, and publishing/unpublishing the item.
  • WidgetQuickShare Quick Share links Stack (typography: "body2") — confirmed via computed styles (display: flex, flexDirection: column, gap: 12px, fontSize: 14px, lineHeight: 20px) that the variant swap preserves the flex/gap layout and matches the previously hardcoded fontSize: 14px; no display leak from the theme token.
  • GlobalSearch "Recent Searches" and "Recently Modified Items" ListSubheaders (typography: "body3", explicit display: "list-item" override) — render full-width, retain the accessible "listitem" role (confirmed via accessibility snapshot), and show no truncation whether the recent-searches list is empty or populated.
  • Pre-existing console noise on this item-edit page (media-manager 404s for an undefined site ZUID, a duplicate-key React warning in WidgetPublishHistory's publish-log list, a FontAwesomeIcon defaultProps deprecation warning, and a disabled-button Tooltip warning) is unrelated to this PR — none of the diff's hunks touch the logic producing these, and they reproduce identically regardless of the typography changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants