Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(site): stop forcing overflow-y on the scroll-locked body - #29236

Open
DanielleMaywood wants to merge 2 commits into
mainfrom
fix/popover-layout-shift
Open

fix(site): stop forcing overflow-y on the scroll-locked body#29236
DanielleMaywood wants to merge 2 commits into
mainfrom
fix/popover-layout-shift

Conversation

@DanielleMaywood

@DanielleMaywood DanielleMaywood commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Stops layout shift from happening on the AgentsPage when opening a portal/dialog/dropdown.

LLM Slop description

Opening any popover or dropdown on the agents page slightly shrank the visible page width, because the global scrollbar rules forced overflow-y: scroll !important on body[data-scroll-locked]. On the agents page, where <html> has inline overflow: hidden, the forced scroll no longer propagated to the viewport and instead grew a scrollbar on <body> itself, reserving scrollbar width every time a Radix overlay opened.

The forced scroll (added in #22387 to keep the scrollbar thumb visible during scroll lock) is not needed to prevent the layout shift: scrollbar-gutter: stable keeps the gutter reserved while the body is locked, so page width stays constant even though the scrollbar is hidden. This removes the forced overflow-y, along with the agents page <style> injection that existed only to override it (from #22448).

One visible trade-off, accepted deliberately: the scrollbar thumb now disappears into the reserved gutter while a modal or dropdown is open, instead of staying painted. This also removes the !important cascade dependency that the Tailwind v4 migration (@layer base becoming a real cascade layer with reversed !important precedence) had silently broken.

Refs radix-ui/primitives#3251

Verification

Verified against a dev server with classic (layout-consuming) scrollbars:

  • /agents: sidebar dropdown opens, data-scroll-locked set, body overflow-y: hidden, page width 1280px before and during, 0px shift
  • /templates (scrollable body): overlay open hides the scrollbar but the stable gutter preserves width, 0px shift
  • pnpm lint:types, pnpm check, pnpm format, and the AgentsPageLayout unit tests pass

Generated by Coder Agents

The global scrollbar rules forced overflow-y: scroll on
body[data-scroll-locked] so the scrollbar would not disappear while a
Radix overlay was open. On the agents page, where <html> has inline
overflow: hidden, the forced scroll no longer propagated to the
viewport and instead grew a scrollbar on <body>, reserving width and
shrinking the page every time a popover opened.

The forced scroll is unnecessary: scrollbar-gutter: stable keeps the
gutter reserved while the body is locked, so page width is stable even
though the scrollbar is hidden. Remove it, along with the agents page
<style> injection that existed only to override it.
@DanielleMaywood
DanielleMaywood marked this pull request as ready for review September 11, 2026 14:41
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 11, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-11T14:44:23.747962Z 6c0a5bc Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6c0a5bc66e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread site/src/index.css
Comment on lines +757 to +760
Do not set overflow-y on body[data-scroll-locked]. A forced overflow-y
overrides the scroll lock. On pages that set overflow: hidden on
<html> (for example /agents), the body then shows a new scrollbar and
the page width changes.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Add visual coverage for scroll-lock layout behavior

With classic scrollbars, this changes page-width behavior for every scroll-locking Radix overlay, but no story opens an overlay while rendering either a scrollable dashboard page or the /agents layout. The existing AgentsPageLayout stories therefore never activate data-scroll-locked, so Pixel cannot catch the layout shift this fix targets or a regression to it; add a story whose play function opens the affected dropdown or dialog on an overflowing page.

AGENTS.md reference: site/AGENTS.md:L7-L7

Useful? React with 👍 / 👎.

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