Skip to content

feat: scale published resumes to the viewport width - #83

Merged
andrewjiang merged 1 commit into
mainfrom
claude/cv-viewport-scaling-k8hfzz
Jul 27, 2026
Merged

andrewjiang merged 1 commit into
mainfrom
claude/cv-viewport-scaling-k8hfzz

Conversation

@andrewjiang

Copy link
Copy Markdown
Owner

The published resume page rendered the sheet at its natural 8.5in width, so on a desktop viewport the CV sat small in the middle of the page and readers had to zoom in to read it.

Changes

  • public-resume-stage.tsx (new client component) wraps the desktop sheet, measures the width available to it with a ResizeObserver, and drives a --cv-stage-scale custom property. The page keeps its exact geometry — it is a CSS transform on the same 816x1056 sheet, so line breaks, the stored fit scale, and PDF output are untouched.
  • Growth is capped at twice the page width (1632px), so the type stays sane on ultrawide displays and the sheet centers past ~1792px viewports.
  • globals.css: a breakpoint ladder supplies a close approximation of the scale before hydration (and when JavaScript is unavailable); the measured value takes over once the stage is observed. Each step stays just under the exact viewport-derived scale, leaving room for a scrollbar, so the sheet can never overflow its stage.
  • public-resume-footer-actions.tsx: the footer shares the sheet's column instead of a hardcoded 816px, so the PDF link stays aligned with the page edge at every width. The pageWidth prop is no longer needed.

Below 1024px nothing changes — the existing mobile sheet still takes over.

Measured results

Sheet width by viewport width: 1024 -> 960px (1.18x), 1280 -> 1216px (1.49x), 1440 -> 1376px (1.69x), 1920 and up -> 1632px (2x, centered). No horizontal overflow at any width.

Verification

  • Print media on the desktop page resets the sheet to 816x1056 with no transform and still produces a 1-page PDF; the dedicated ?print=1 route is unmodified.
  • pnpm test (108 tests), pnpm lint, the design-readiness check, and pnpm build all pass.

Scaling is driven by width only, so a short-but-wide window still gets the full 2x and more vertical scrolling.

🤖 Generated with Claude Code

https://claude.ai/code/session_01M7fKRZGJ2XH6E4AXktKRzN


Generated by Claude Code

The published resume page rendered the sheet at its natural 8.5in width, so
on a desktop viewport the CV sat small in the middle of the page and readers
had to zoom in.

Wrap the desktop sheet in a stage that measures the width available to it and
scales the page up to fill it, capped at twice the page width so the type
stays sane on ultrawide displays. A CSS breakpoint ladder supplies a close
approximation before hydration (and when JavaScript is unavailable), and the
measured value takes over once the stage is observed.

The footer actions now share the same column as the sheet instead of a fixed
816px, so the PDF link stays aligned with the page edge at every width. Print
output is unchanged: the print stylesheet already resets the sheet transform
and the paper frame back to natural size.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M7fKRZGJ2XH6E4AXktKRzN
@cursor

cursor Bot commented Jul 27, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@vercel

vercel Bot commented Jul 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cvstudio Ready Ready Preview, Comment Jul 27, 2026 6:30pm

Request Review

@andrewjiang
andrewjiang merged commit dca6bca into main Jul 27, 2026
4 checks passed

This branch was successfully deployed

1 active deployment
Preview — 55f05280 Deployed Jul 27, 2026 by vercel[bot]
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.

2 participants