Skip to content

🐛 fix(hero): scale the wide hero as one composition on every window shape - #39

Merged
pjborowiecki merged 2 commits into
mainfrom
2026-11-15-hero-proportions
Nov 15, 2026
Merged

pjborowiecki merged 2 commits into
mainfrom
2026-11-15-hero-proportions

Conversation

@pjborowiecki

@pjborowiecki pjborowiecki commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

Summary

The wide hero now keeps its proportions as the window changes shape.

Cause. Each part of the composition switched between following the window's width and its height, at a different aspect ratio:

Part Sized by
Portrait min(104svh, 65vw): switches at 1.6:1
Headline min(2.6vw, 4.6svh): switches at 1.77:1
Focus titles min(2vw, 3.5svh): switches at 1.75:1
Text columns always vw
Vertical positions always svh

As a window narrowed at a fixed height, the portrait and text shrank with the width while the text stayed pinned high. The result was small, cramped text near the top, with a towering portrait and dead space below it. On ultrawide windows, the name and the text columns stretched to the edges, far from the portrait.

Fix. The wide layout is the 16:10 composition, scaled by one unit: --hero-unit: min(1vw, 1.6svh). The following all derive from that unit:

  • the portrait's size and position;
  • the columns, fonts and spacing;
  • the poster fade;
  • the name's inset.
  • On narrower or squarer windows, the same composition is smaller. It rises only until the portrait's bottom tucks under the name, so the band above the head stays modest (229 px at 1589×1360). The text stays beside the face, and the torso dissolves into the name.
  • On ultrawide windows, the composition is centred.
  • At 16:10, nothing changes.

Test plan

  • bun run check
  • bun run test:coverage: 213 tests, 100%
  • bun run build:test
  • bun run test:e2e:pr: 25 passed
  • Old and new compared side by side:
    • at 1360 px tall: 2229, 2000, 1800, 1589 and 1500 wide;
    • at 1440×900, 1280×900 and 1100×900;
    • at 3440×1440 and 2560×1080.
  • Polish copy fits above the name at 1589×1360, 1100×900 and 2229×1360.
  • The scroll dive into the name still plays at 1589×1360.
  • Reviewed on preview.pjborowiecki.com

Docs

  • README: unchanged
  • CHANGELOG.md
  • Copy in both locales: unchanged

Summary by CodeRabbit

  • Improvements
    • The hero portrait, text, and spacing now scale together across different window shapes, keeping the composition centered on ultrawide displays.
    • Hero copy, credentials, focus areas, and call-to-action spacing use consistent sizing as the window changes. Text content and visibility remain unchanged.

…hape

The portrait, the headline, the focus titles, the text columns and the vertical positions each switched between following the width and the height at a different aspect ratio. Narrowing a window therefore shrank the portrait and text with the width while the text stayed pinned high, and an ultrawide window stretched the name and the columns to its edges.

The wide layout is now the 16:10 composition scaled by one unit, --hero-unit: min(1vw, 1.6svh). On a narrower or squarer window the same composition is smaller, with the spare height above it, so the text stays beside the face and the torso still runs under the name. On an ultrawide window the composition is centred. At 16:10 nothing changes.
@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The hero cover layout and content now use shared unit-based sizing and positioning. The hero text, credentials, focus-area layout, CTA padding, and desktop name position use these variables instead of viewport-based sizing.

Changes: Hero scaling

Layer / File(s) Summary
Shared cover geometry
src/presentation/styles/globals.css
The cover variant defines shared hero sizing variables. The subject, fade, and flanking content use unit-based dimensions and positioning.
Hero content sizing
src/presentation/components/custom/landing-page/sections/hero-section.tsx, src/presentation/styles/globals.css, CHANGELOG.md
Hero text, credentials, CTA padding, focus-area layout, and desktop name positioning use the shared variables. The Polish hero role font size also uses the unit. The changelog describes how the composition scales across window shapes.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: Minimal · up to 3fcf4

The hero layout now scales as one composition across window shapes. No concrete defect was found, and the change is CSS-only and easy to revert.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the wide hero fix and the core change: the hero now scales as one composition across window shapes. It matches the --hero-unit change in the hero section and globals.css, so the title …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description explains the cause, the fix, and the test evidence for a CSS and layout change. It follows the template's Summary and Test plan sections, and it addresses the Docs section by marking C…
Full details: Title check

Explanation

The title names the wide hero fix and the core change: the hero now scales as one composition across window shapes. It matches the --hero-unit change in the hero section and globals.css, so the title is related to the main change. The title uses an emoji and a fix(hero) prefix, which the title guidance treats as noise, but the content is accurate and specific.

Full details: Description check

Explanation

The description explains the cause, the fix, and the test evidence for a CSS and layout change. It follows the template's Summary and Test plan sections, and it addresses the Docs section by marking CHANGELOG.md as done and marking README and locale copy as unchanged. Two items remain unchecked: the preview review and the unmarked Docs status for the README. These are minor and do not block the check.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7c23feb0-e2a4-40ae-bfd0-27bb71174d58
Commits

Reviewing files that changed from the base of the PR and between 9be9318 and 3fcf466.

Files selected for processing: 3

  • CHANGELOG.md
  • src/presentation/components/custom/landing-page/sections/hero-section.tsx
  • src/presentation/styles/globals.css

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

…o reach the name

Sending all the spare height above the composition left a band of up to 30% of the screen above the head on squarer windows. The composition now rises only until the portrait's bottom tucks under the name, which halves that band (229 px instead of 401 px at 1589x1360) and keeps the torso dissolving into the name. Windows at 16:10 or wider are unchanged.
@pjborowiecki
pjborowiecki merged commit 1828481 into main Nov 15, 2026
10 checks passed
@pjborowiecki
pjborowiecki deleted the 2026-11-15-hero-proportions branch November 15, 2026 20:13

This branch was previously deployed

1 inactive deployment
Preview — 3fcf4660 Deployed Nov 15, 2026 by pjborowiecki via Deploy preview / Deploy #46
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.

1 participant