Skip to content

🐛 Push hero further out of view when the scroll arrow is clicked - #4969

Merged
designbyalex merged 3 commits into
mainfrom
fix/4928-hero-scroll-arrow-offset
Aug 6, 2026
Merged

🐛 Push hero further out of view when the scroll arrow is clicked#4969
designbyalex merged 3 commits into
mainfrom
fix/4928-hero-scroll-arrow-offset

Conversation

@designbyalex

@designbyalex designbyalex commented Aug 6, 2026

Copy link
Copy Markdown
Member

The arrow landed 10% of viewport height below the top of the screen, leaving a slice of hero on view. Negating the offset lands it 10% above instead, so the hero clears the viewport.

- top: window.scrollY + top - window.innerHeight * 0.1,
+ top: window.scrollY + top + window.innerHeight * 0.1,

Note

Overlaps with #4967, which rewrites the same handler. Merge one, not both.

Testing

Chrome DevTools, homepage, checking the service cards section is fully in view after the scroll settles:

Viewport Result
768 × 1024, 1440 × 900, 1920 × 1080
390 × 844, 1280 × 800, 1366 × 768 ⚠️ cards clipped 64–110 px
375 × 667 ❌ cards clipped 326 px

Heading is always visible. Remaining clipping is because the formula aims at the button, not the section — and at 375 × 667 and 1366 × 768 the content is taller than the viewport, so no scroll offset fits it. Those need py-24 or the card graphic shrunk.

Copilot AI left a comment

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.

Pull request overview

Adjusts the homepage hero “scroll to content” arrow behavior so the hero clears the viewport more fully after clicking the arrow.

Changes:

  • Updates the scroll offset calculation in the hero scroll-arrow click handler.
  • Adds a .gitignore entry to ignore a repository-root .worktrees/ directory.

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

File Description
components/blocks/v3/heroBox/heroBox.tsx Tweaks the scroll target calculation for the hero “scroll to content” arrow.
.gitignore Ignores /.worktrees/ (git worktrees folder) at the repository root.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread components/blocks/v3/heroBox/heroBox.tsx Outdated
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Coverage report

St.
Category Percentage Covered / Total
🔴 Statements 0.66% 313/47646
🔴 Branches 9.79% 52/531
🔴 Functions 1.25% 6/480
🔴 Lines 0.66% 313/47646

Test suite run success

19 tests passing in 2 suites.

Report generated by 🧪jest coverage report action from 519dd62

designbyalex and others added 3 commits August 6, 2026 14:30
The arrow scrolled so it landed 10% of the viewport height BELOW the top of
the screen, which left a slice of hero on screen and pushed the next section
down. Negating the offset lands the arrow 10% ABOVE the top instead, so the
hero clears the viewport and the next section moves up by a further 20% of
viewport height.

This is a one-line change to the existing formula, not a rewrite — it still
aims at the arrow rather than at the next section, so it is a partial fix.
Measured in Chrome DevTools at seven viewports on the homepage, checking
whether the v3ImageCards heading and all three service cards are fully
visible after the scroll settles:

  375x667   heading OK, cards cut off by 326px
  390x844   heading OK, cards cut off by  64px
  768x1024  heading OK, cards fully visible
  1280x800  heading OK, cards cut off by  71px
  1366x768  heading OK, cards cut off by 110px
  1440x900  heading OK, cards fully visible (35px spare)
  1920x1080 heading OK, cards fully visible

The residual clipping has two causes. The formula targets the button, so the
heading lands 99-122px down the viewport and that dead space is what pushes
the cards past the bottom edge. And at 375x667 and 1366x768 the requirement
is geometrically unreachable at any scroll offset: heading top to cards
bottom measures 871px against 667px available, and 766px against 768px.
Those two need the section's py-24 or the card graphic height reduced.

Closes #4928

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The arrow now lands above the top of the screen, not below it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Same result, one less sign to misread.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@designbyalex
designbyalex force-pushed the fix/4928-hero-scroll-arrow-offset branch from e7f9963 to 519dd62 Compare August 6, 2026 04:30
@designbyalex
designbyalex enabled auto-merge (squash) August 6, 2026 04:33
@designbyalex
designbyalex merged commit 5f1eb6c into main Aug 6, 2026
8 checks passed
@designbyalex
designbyalex deleted the fix/4928-hero-scroll-arrow-offset branch August 6, 2026 04:40
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.

🐛 Bug - Homepage scroll arrow does not align to next section

3 participants