Skip to content

fix(ads): dock the flex header ad while an inline page is open - #5471

Merged
evanpelle merged 1 commit into
mainfrom
fix/flex-ad-modal-scroll
Sep 16, 2026
Merged

evanpelle merged 1 commit into
mainfrom
fix/flex-ad-modal-scroll

Conversation

@evanpelle

@evanpelle evanpelle commented Sep 16, 2026 •

Copy link
Copy Markdown
Collaborator

Regression from the flex header ad (#5009 / #5237). No approved issue — reporting and fixing in one go.

Description:

With the flex header ad showing, opening any inline page modal (Store, Settings, Leaderboard, ...) leaves the modal only a sliver of height, so it effectively can't be scrolled.

Cause. body.page-open locks the document at scroll 0 (#5148). Playwire's flex unit expands (350px desktop / 210px mobile) whenever its container intersects the viewport and only docks to the 100px/70px fixed leaderboard once the container scrolls out — which can never happen while the page is locked. So the expanded ad sat in flow above the modal for as long as the page was open. On an 800px-tall viewport the modal got ~220px.

Fix (CSS only, index.html). While a page is open:

  • park #pw-oop-flex_container just above the viewport (position: fixed; bottom: 100%) so Playwire's IntersectionObserver docks the unit;
  • pin the docked unit to top: 0 (Playwire docks with top: auto, i.e. the static position, which is now above the viewport);
  • pad the content area by --top-ad-height (already measured by HomepagePromos) and make the desktop nav static, since nothing scrolls in that state.

When the page closes the container returns to flow and the unit re-expands as before.

Verified in headed Chromium with the Playwire preview URL on desktop (1400×800) and mobile (390×844): the unit docks within Playwire's collapse delay, the modal scroller reaches its full extent, closing restores the expanded unit and document scrolling, and opening a page from a scrolled position keeps the docked unit in place.

Before: the expanded ad sat in flow above the Settings modal, which was ~220px tall. After: the ad is docked at the top and the modal fills the area below the nav.

Please complete the following:

  • I have added screenshots for all UI updates (layout verified in-browser; described above)
  • I process any text displayed to the user through translateText() and I've added it to the en.json file (no new text)
  • I have added relevant tests to the test directory (CSS-only layout change; verified in a real browser against Playwire's live script)

Please put your Discord username so you can be contacted if a bug or regression is found:

evanpelle

🤖 Generated with Claude Code

Opening a page modal (Store, Settings, ...) locks the document at scroll 0,
so the Playwire flex unit stayed in its expanded 350px state in flow above
the modal, leaving it only a sliver of height to scroll in. Park the ad
container just above the viewport while a page is open so Playwire's
IntersectionObserver docks the unit into its fixed leaderboard, pin that
leaderboard to the viewport top, pad the content area below it, and make
the desktop nav static (nothing scrolls while a page is open).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: ed84e871-5ebe-4485-bdd0-3b8b971afeb7

📥 Commits

Reviewing files that changed from the base of the PR and between ebe3112 and 6a75850.

📒 Files selected for processing (1)
  • index.html

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


Walkthrough

The page-open state now moves the flex advertisement above the viewport, docks its inner unit, pads content below the ad height, and changes the desktop navigation from sticky to static.

Changes

Page-open layout

Layer / File(s) Summary
Page-open advertisement and navigation positioning
index.html
The flex advertisement is fixed above the viewport when a page is open. The content uses the ad height for top padding, and the desktop navigation becomes static.

Priority: ⬇️ Low

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

Change: Bug fix

Suggested reviewers: ryanbarlow97

Merge Risk: ⚪ Minimal · up to 6a758

The page-open layout change has no unresolved concrete correctness or availability risk identified before merge.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
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.
Title check ✅ Passed The title clearly and concisely describes the main change: docking the flex header ad while an inline page is open.
Description check ✅ Passed The description directly explains the regression, cause, CSS fix, affected layouts, and browser verification. It is related to the changeset.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch

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

The banner rests above the view
The page gains its measured space
The nav stays still while pages open
Content follows the ad’s height
A tidy dock keeps flow in place

Comment @coderabbitai help to get the list of available commands.

@evanpelle evanpelle added this to the v34 milestone Sep 16, 2026
@evanpelle
evanpelle merged commit adfffd3 into main Sep 16, 2026
17 of 19 checks passed
@evanpelle
evanpelle deleted the fix/flex-ad-modal-scroll branch September 16, 2026 17:27
@github-project-automation github-project-automation Bot moved this from Triage to Complete in OpenFront Release Management Sep 16, 2026

This branch was successfully deployed

1 active deployment
staging — 6a758500 Deployed Sep 16, 2026 by openfrontio[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Complete

Development

Successfully merging this pull request may close these issues.

1 participant