Skip to content

Comments

fix(product-page): prevent top CTA bar from overlapping content and hiding edit button#3597

Closed
dluffy56 wants to merge 11 commits intoantiwork:mainfrom
dluffy56:fix/navbar
Closed

fix(product-page): prevent top CTA bar from overlapping content and hiding edit button#3597
dluffy56 wants to merge 11 commits intoantiwork:mainfrom
dluffy56:fix/navbar

Conversation

@dluffy56
Copy link
Contributor

@dluffy56 dluffy56 commented Feb 15, 2026

Issue: #2995

Description

This PR fixes the edit button being hidden behind the profile header on desktop product pages and prevents the fixed CTA bar from overlapping page content when it slides in.

Problem

  • The edit button used position: absolute with a lower z-index, while the profile header uses z-index: 20, causing the header to render above the button.
  • The CTA bar is position: fixed at the top of the viewport. When it appears, it overlays page content instead of pushing it down.

Solution

  • Switched the edit button to position: fixed on desktop (remains absolute on mobile) and updated its z-index to tooltip (30), ensuring it renders above both the profile header and CTA bar.
  • Moved the edit button from productView to the Layout level so it is no longer constrained by SectionLayout's position: relative stacking context.
  • Added a spacer element below the CTA bar on desktop that dynamically matches its height, preventing content from being hidden behind it.
  • Added a 150ms settle timer and geometry guard to the IntersectionObserver to prevent spacer-induced layout shifts from causing a yoyo effect.
  • Added conditional left padding to the CTA bar on desktop when can_edit is true to prevent overlap between the edit button and price tag at higher zoom levels.

Before / After

Before

Screencast.from.2026-02-16.23-17-37.webm

Edit button hidden and content covered by CTA bar

Screenshot from 2026-02-16 23-19-37

After (desktop only – no changes on mobile)

Light Mode Dark Mode
Screencast.from.2026-02-16.23-14-08.webm
Screencast.from.2026-02-16.23-39-37.webm

Test Results

Layout and positioning changes only.


Checklist


AI Disclosure

Claude Opus 4.6 was used to help with debugging and refine the implementation.

…page

  - Change EditButton from absolute to fixed positioning with z-index-tooltip to render above profile header (z-20) and CTA bar (z-10)
  - Add desktop-only left padding (lg:pl-18) to product content and CTA bar
    when can_edit is true, preventing overlap with the fixed edit button
  - Add spacer div after CTA bar on desktop to push page content down instead of letting the fixed banner overlap it
@dluffy56 dluffy56 changed the title fix: prevent edit button from being hidden behind top bar on product … fix(product-page): prevent top CTA bar from overlapping content and hiding edit button Feb 15, 2026
Comment on lines 152 to 181
@@ -179,6 +178,7 @@ export const Layout = (

return (
<>
<EditButton product={product} />
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved EditButton to the Layout level so it is no longer constrained by SectionLayout’s position: relative stacking context, allowing position: fixed to behave relative to the viewport

new IntersectionObserver(
const button = ctaButtonRef.current;
if (!button) return;
let settleTimer: ReturnType<typeof setTimeout> | null = null;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the CTA bar appears, the spacer below it slightly shifts the layout. That shift can briefly push the CTA button back into view. Without a guard, this can trigger yoyo effect
The 150ms timer temporarily enables a geometry check during this short settling period.
After that, the guard is disabled so normal scrolling works as expected.

Comment on lines 352 to 355
{isDesktop ? (
<div aria-hidden style={{ height: visible ? height : 0, overflowAnchor: "none" }} />
) : null}
</>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Desktop-only spacer that matches the CTA bar's height. Since the bar is position: fixed, it overlays content - this pushes content down so nothing is hidden behind it.
  • overflowAnchor: "none" prevents the browser from using this element as a scroll anchor.

@dluffy56 dluffy56 marked this pull request as ready for review February 16, 2026 18:59
@slavingia
Copy link
Contributor

Thanks for the contribution! The issue this PR is linked to still has a "planning" label, which means it's still being scoped by our team and isn't ready for a PR yet. We're closing this for now — please find an open issue without a "planning" label and we'd love your help there. We appreciate it!

@slavingia slavingia closed this Feb 19, 2026
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