Skip to content

fix: site-tokens - Record redirects in the crawl and skip pages that land on the same URL - #4022

Merged
ZaredRogers merged 24 commits into
chore/git-2763-site-tokens-setup-notesfrom
fix/git-2767-site-tokens-crawl-redirects
Nov 11, 2026
Merged

ZaredRogers merged 24 commits into
chore/git-2763-site-tokens-setup-notesfrom
fix/git-2767-site-tokens-crawl-redirects

Conversation

@ZaredRogers

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 #4020

Linear: GIT-2767

Context

  • Severity/Impact: Medium. On live TSP, retired pages that redirect were crawled as if they were real templates, so the proposal counted the home page four times and never saw a listing or accommodation template.
  • Affected versions/environments: site-to-design-tokens crawler. Found in scaffold end-to-end test run 2 (finding N7). Stacked on chore: site-tokens - Say which dependencies and browser the scripts need #4016; only the last commits are this PR's change.

Reproduction

  • Steps: 1) Crawl /, /tours/ and /accommodation/ on www.thesafaripartners.com. 2) Read site-styles.json.
  • Expected vs Actual: Expected a warning that /tours/ and /accommodation/ redirect to /. Got three captures of the home page and no warning.

Root Cause

  • The crawler recorded the URL it asked for, not the URL it landed on, so redirects and duplicates were invisible. The sitemap still lists the retired pages.

Fix Summary

  • PageHandle.finalUrl (Puppeteer's page.url()) is recorded on each capture that redirected, and SiteStyles.redirects lists every redirect.
  • A page whose final URL was already captured is left out, so one page never votes twice.
  • The CLI prints a warning per redirect, and the proposal lists each one as a reviewer decision.
  • SKILL.md and references/crawling.md explain the warning and what to do.

Verification

  • Tests added/updated to cover the bug: redirect and duplicate handling in SiteCrawler, no redirects key when none happen, CLI warnings, proposer decisions. 121 Jest tests pass, coverage above thresholds, tsc --noEmit clean, no new ESLint warnings
  • Manual verification: live TSP crawl warned that /tours/ redirects to / (left out), and found two redirects nobody knew about: /destination/botswana/makgadikgadi-pans-national-park/ to /destination/botswana/, and /contact/ to /about-us/
  • Negative/edge cases checked: a redirect to a new page is kept and recorded; a redirect to a captured page is left out at every viewport

Risk & Rollback

  • Risk level: Low. Adds optional fields to site-styles.json; older files still work.
  • Rollback plan: Revert this PR.

Changelog

Fixed

🤖 Generated with Claude Code

ZaredRogers and others added 11 commits November 9, 2026 16:19
…ready captured

On live TSP, /tours/, /accommodation/ and every accommodation page
redirect to the home page, so runs 1 and 2 captured the home page four
times without noticing. The crawler now keeps each page's final URL,
warns about redirects, leaves out duplicates, and the proposal lists
them as reviewer decisions.

Refs GIT-2767.

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

On live TSP the primary action took its fill from #6a6d5b buttons (white
text) but its text from the 112 light #f7f3f1 buttons with brown text,
which gave 1.01:1. Button text is now grouped by fill, and each action's
text comes from the buttons whose fill matches its background.

Refs GIT-2765.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On live TSP, Gigantic (90) was 70px on desktop but 24px on mobile, below
every step from 40 up. A step's mobile value is now raised to the one
before it, and the change is listed for the reviewer.

Refs GIT-2766.

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

linear-code Bot commented Nov 9, 2026

Copy link
Copy Markdown

GIT-2767

@coderabbitai

coderabbitai Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 22 seconds.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 8971bd6 and 20f0fc4.

Files selected for processing: 21

  • CHANGELOG.md
  • package.json
  • skills/figma-to-block-theme/references/tokens-spacing.md
  • skills/figma-to-block-theme/references/tokens-typography.md
  • skills/figma-to-block-theme/scripts/__tests__/figma-variables-to-theme-json.test.ts
  • skills/figma-to-block-theme/scripts/figma-variables-to-theme-json.ts
  • skills/site-to-design-tokens/SKILL.md
  • skills/site-to-design-tokens/references/crawling.md
  • skills/site-to-design-tokens/references/target-structure.md
  • skills/site-to-design-tokens/scripts/__tests__/crawl-site-styles.test.ts
  • skills/site-to-design-tokens/scripts/__tests__/propose-tokens.test.ts
  • skills/site-to-design-tokens/scripts/__tests__/write-token-export.test.ts
  • skills/site-to-design-tokens/scripts/crawl-site-styles.ts
  • skills/site-to-design-tokens/scripts/propose-tokens.ts
  • skills/site-to-design-tokens/scripts/write-token-export.ts
  • skills/theme-orphaned-refs/SKILL.md
  • skills/theme-orphaned-refs/scripts/__tests__/find-orphaned-presets.test.ts
  • skills/theme-orphaned-refs/scripts/find-orphaned-presets.ts
  • skills/theme-orphaned-refs/scripts/find_orphaned_presets.py
  • skills/theme-orphaned-refs/scripts/jest.config.cjs
  • skills/theme-orphaned-refs/scripts/tsconfig.json
  • 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-2767-site-tokens-crawl-redirects
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.

ZaredRogers and others added 2 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>
ZaredRogers and others added 4 commits November 10, 2026 08:58
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>
@mergify

mergify Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Merge Protections

🔴 2 of 2 protections blocking · waiting on ⛓️ dependency

Protection Waiting on
🔴 ⛓️ Depends-On Requirements ⛓️ dependency
🔴 🚦 Auto-queue —

🔴 ⛓️ Depends-On Requirements

Waiting for

This rule is failing.

Requirement based on the presence of `Depends-On` in the body of the pull request

🔴 🚦 Auto-queue

This rule is failing.

When all merge protections are satisfied and these conditions match, this pull request will be queued automatically.

  • author~=^(dependabot\[bot\]|app/dependabot)$

@ZaredRogers
ZaredRogers removed this pull request from stack #4043 November 11, 2026 08:28
…-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
@ZaredRogers
ZaredRogers merged commit 5a4edf8 into chore/git-2763-site-tokens-setup-notes Nov 11, 2026
2 checks passed
@ZaredRogers
ZaredRogers deleted the fix/git-2767-site-tokens-crawl-redirects branch November 11, 2026 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants