Skip to content

fix: site-tokens - Measure the content width from the text column, and allow an override - #4013

Merged
ZaredRogers merged 62 commits into
fix/git-2759-site-tokens-spacing-ladderfrom
fix/git-2760-site-tokens-content-width
Nov 11, 2026
Merged

ZaredRogers merged 62 commits into
fix/git-2759-site-tokens-spacing-ladderfrom
fix/git-2760-site-tokens-content-width

Conversation

@ZaredRogers

@ZaredRogers ZaredRogers commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Bugfix Pull Request

This repository enforces changelog, release, and label automation for all PRs and issues.
See the organisation-wide Automation Governance & Release Strategy for required rules.

Linked issues

Fixes #4006
Fixes #4021 (removes the committed propose-tokens.ts.bak, GIT-2768)

Linear: GIT-2760

Context

Reproduction

  • Steps: 1) Crawl the live TSP site. 2) Read the layout in the proposal.
  • Expected vs Actual: Expected a content width near 768px. Got 248px, the most frequent centred width at or under 80% of the wide width.

Root Cause

  • The proposer picked the most frequent centred wrapper, which on a listing-heavy site is a card. propose-tokens.ts had no override either.

Fix Summary

  • The crawler records the widths of running-text p elements (80 or more characters, in the main column, outside nav, footer, aside, lists and figures) and whether each page is a single or a listing.
  • The proposer takes the content width from single posts and pages (rounded to 8px), and says so when it had to use listing pages or the centred containers.
  • New --layout content=<px>,wide=<px> overrides either width.
  • A reviewer decision is added when the content width is under 480px.
  • SKILL.md, crawling.md and proposal-review.md say to include a long text page and how to override.

Verification

  • Tests added/updated to cover the bug: single-page text, listing-only warning, under 480px, fallback, override and the CLI flag; 93 Jest tests pass, coverage above thresholds, tsc --noEmit clean, ESLint no errors
  • Manual verification: live TSP crawl (run 2 retry, 9 Nov) gives 848px, the blog post's text column
  • Negative/edge cases checked: bad --layout values are refused with a message

Risk & Rollback

  • Risk level: Low. Layout proposal only.
  • Rollback plan: Revert this PR.

Changelog

Added

Changed

Fixed

  • Site Tokens Content Width — site-to-design-tokens measures the content width from running text on single posts and pages, takes --layout content=<px>,wide=<px> to override either width, and asks the reviewer to confirm a content width under 480px. (#4006)

Removed


Checklist (Global DoD / PR)

  • All AC met and demonstrated
  • Tests added/updated (unit/E2E as appropriate)
  • Accessibility checklist completed (where relevant):
    • Semantic HTML and heading order verified
    • Keyboard navigation and visible focus states verified
    • ARIA used only where needed
    • Contrast and non-colour cues reviewed (WCAG 2.1 AA or higher)
  • Docs/readme/changelog updated (if user-facing)
  • Security checklist completed (where relevant):
    • Untrusted input validated and sanitised
    • Output escaped for its rendering context
    • Privileged actions enforce nonce and capability checks
    • No secrets/sensitive data introduced; OWASP risks reviewed
  • Code/design reviews approved
  • CI green; linked issues closed; release notes prepared (if shipping)

🤖 Generated with Claude Code

…w an override

The crawler records running-text paragraph widths in the main column and the kind
of page. The proposer uses single posts and pages, adds --layout content=<px>,wide=<px>
and a reviewer decision when the content width is under 480px.

Fixes GIT-2760

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ZaredRogers
ZaredRogers requested review from a team and ashleyshaw as code owners November 9, 2026 12:23
@ZaredRogers
ZaredRogers requested a review from krugazul November 9, 2026 12:23
@linear-code

linear-code Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

GIT-2760

GIT-2768

@coderabbitai

coderabbitai Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

PR Template Routing

Branch Type: fix
Scope: git-2760-site-tokens-content-width
Template: pr_bug.md
Labels Applied: type:bug

This PR was automatically routed based on the branch naming strategy.

@mergify

mergify Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

This pull request is merged.

Names drop weight and style suffixes, turn underscores into spaces and are
title-cased; the exact CSS stack is kept in the variable description. The
proposal now has heading, body, accent and monospace, each marked live or
default. figma-to-block-theme uses a declared stack as the fontFamily.

Fixes GIT-2761

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ZaredRogers and others added 7 commits November 9, 2026 14:33
Action backgrounds take the anchor step when the anchor came from button fills,
with hover one step darker. A default that fails its contrast pair moves to the
nearest passing step and is recorded; failing live colours are listed with a
passing alternative.

Fixes GIT-2762

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add a Before you start section: npm ci in the .github checkout, and
npx puppeteer browsers install chrome if the launch fails (npm 11 blocks
Puppeteer's install script). site-to-figma-components has the same note;
figma-to-block-theme only needs npm ci.

Fixes GIT-2763

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…61-site-tokens-font-roles

# Conflicts:
#	skills/figma-to-block-theme/scripts/__tests__/figma-variables-to-theme-json.test.ts
#	skills/site-to-design-tokens/references/target-structure.md
…a third family

With two families there is no accent variable, preset or Figma script entry, and the
report says so. Monospace keeps its default. figma-to-block-theme writes only the
roles that exist.

Relates to GIT-2761

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ZaredRogers

Copy link
Copy Markdown
Contributor Author

Merged the radius naming change from #4011 (bare size names in the Radius collection) into this branch.

…61-site-tokens-font-roles

# Conflicts:
#	skills/figma-to-block-theme/scripts/__tests__/figma-variables-to-theme-json.test.ts
ZaredRogers and others added 6 commits November 9, 2026 16:16
Refs GIT-2768.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s first

On live TSP the terms page's 26 full-width paragraphs set the content
width to 1200px. Each page now votes with its most common text width,
blog posts win when the crawl has any, the median vote is used, and a
width within 10% of the wide width becomes a reviewer decision.

Refs GIT-2760.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…61-site-tokens-font-roles

# Conflicts:
#	skills/site-to-design-tokens/references/proposal-review.md
Live TSP writes Moret on 88 links and moret everywhere else, so the
proposal added Moret as an accent. CSS family names are not
case-sensitive; roles are now picked by lower-case name and named after
the most common spelling.

Refs GIT-2761.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…site-tokens-action-colours

# Conflicts:
#	skills/site-to-design-tokens/SKILL.md
ZaredRogers and others added 9 commits November 9, 2026 16:36
… the accent

On live TSP, one blog link styled with font-family: a became the accent.
A third family now needs at least 2% of the text elements (and at least
5) to take the accent role.

Refs GIT-2761.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ZaredRogers

Copy link
Copy Markdown
Contributor Author

Updated after scaffold end-to-end test run 2 on live TSP (9 Nov). The content width came out at 1200px: the terms page's 26 full-width paragraphs outvoted everything else.

  • Each page now votes with its most common text width. Blog posts win when the crawl has any (the crawler records isPost from single-post), and the median vote is used.
  • A width within 10% of the wide width becomes a reviewer decision.
  • Removed the committed propose-tokens.ts.bak (chore: site-tokens - Remove the committed propose-tokens.ts.bak #4021).

Live TSP now gives 848px, the blog column. Docs and the changelog entry are updated to match.

ZaredRogers and others added 6 commits November 10, 2026 08:55
The declared CSS stack starts with the live site's own @font-face name
(moret, argesta_displayregular), which the theme's fontFace entries
don't declare, so the fonts would not load. Keep the stack's fallbacks
and lead with the family name instead.

Refs GIT-2770

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The monospace variable is named Monospace and its declared stack starts
with ui-monospace, so the name check failed and the mapper wrote
"Monospace, sans-serif". A generic family names no font of its own, so
keep its declared stack, and fall back to monospace for that role.

Refs GIT-2771

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Layout collection's --wp--custom--layout--content-size and
wide-size variables landed in settings.custom.layout with no unit, and
settings.layout was never set, so the theme kept the scaffold's widths.
Map them, and core's --wp--style--global-- names, to contentSize and
wideSize in px.

Refs GIT-2772

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The export created brand, primary, cta, neutral, and figma-to-block-theme
keeps the Figma order, so the theme palette was out of convention.
Create neutral, primary, brand, cta instead.

Refs GIT-2773

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…resets

The scan walked node_modules, vendor, build and .agents, so on a
scaffold-generated theme it took over 2 minutes and its report was
almost all false hits. Skip those folders (with --exclude for more),
add border-radius to the preset types, suggest the nearest step for
bare numeric ladders, and add unit tests.

Refs GIT-2774

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eScript

Agent tooling is TypeScript with Jest tests beside the script. Replace
find_orphaned_presets.py and its unittest tests with
find-orphaned-presets.ts (registry loader, slug suggester and scanner
classes, file system injected) and Jest tests at 80% thresholds. Add
npm run test:theme-orphaned-refs. Behaviour matches the previous commit.

Refs GIT-2774

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-skip-dependencies

fix: orphaned-refs - Skip dependency, build and agent folders when scanning a theme
…alette-order

fix: site-tokens - Export the palette ramps in the LightSpeed order
…layout-widths

fix: figma-tokens - Map content and wide width to settings.layout
…monospace-stack

fix: figma-tokens - Keep the declared system monospace stack
…font-stacks

fix: figma-tokens - Build font stacks from the clean family name, not the raw @font-face name
…pacing-min-order

fix: site-tokens - Keep spacing minimums in order
…ction-text-pairing

fix: site-tokens - Pair the primary button text with the fill of the same buttons
…rawl-redirects

fix: site-tokens - Record redirects in the crawl and skip pages that land on the same URL
…-setup-notes

chore: site-tokens - Say which dependencies and browser the scripts need
…ction-colours

fix: site-tokens - Use live action colours and pick passing defaults for semantic tokens
…ont-roles

fix: site-tokens - Clean font family names and add the accent and monospace roles
@ZaredRogers
ZaredRogers merged commit 435a824 into fix/git-2759-site-tokens-spacing-ladder Nov 11, 2026
2 of 4 checks passed
@ZaredRogers
ZaredRogers deleted the fix/git-2760-site-tokens-content-width branch November 11, 2026 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants