Skip to content

fix(sidebar): keep the shell frame from scrolling - #706

Open
itsprade wants to merge 5 commits into
mainfrom
fix/sidebar-frame-scroll
Open

itsprade wants to merge 5 commits into
mainfrom
fix/sidebar-frame-scroll

Conversation

@itsprade

Copy link
Copy Markdown
Contributor

What

Long pages could shift the whole AppShell up: the top bar slid off screen, the sidebar moved out of line, and the page looked cut off at the bottom. It happened on any page with several Select or Combobox fields when something jumped to a point off screen, such as an in-page #anchor link, scrollIntoView, focusing a field below the fold, or a form moving focus to its first invalid field.

Why it happened

  • Select and Combobox render absolutely positioned hidden inputs for form submission. Their positioning box was SidebarInset, not the content scroll area, so on a long form they stretched the shell's outer frame (sidebar-wrapper) far past the window. On one demo page the frame was about 6,900px tall in a 768px window.
  • That frame is overflow: hidden, which hides the extra height but can still be scrolled programmatically. Anchor jumps, scrollIntoView and focus scroll every scrollable ancestor, so they scrolled the frame itself.

Fix

  • The content scroll container ([data-appshell-scroll-container]) is now position: relative, so absolutely positioned content scrolls with the page instead of stretching the frame.
  • The frame uses overflow: clip instead of overflow: hidden, so nothing can scroll it. The two look identical.

Testing

  • Regression tests in sidebar-layout.test.tsx cover both classes.
  • Checked in the example app:
    • On a long form page, the frame stays at window height and forcing it to scroll does nothing.
    • scrollIntoView and anchor jumps scroll only the content.
    • Dropdowns open in the right place.
    • Sticky elements (a sticky action bar and a sticky side column) still stick.
    • The DataTable fill page lays out as before.
  • All checks pass: tests (2,866), types, lint, format and docs.

Patch changeset included. This PR is independent of the forms PRs and can merge on its own.

🤖 Generated with Claude Code

Absolutely positioned descendants of the content area, such as the hidden
inputs Select and Combobox render, were positioned against SidebarInset
and stretched the sidebar wrapper far past the window. The wrapper is
overflow-hidden, which still allows anchor jumps, scrollIntoView and focus
to scroll it, so the header and sidebar shifted out of place.

- The content scroll container is now `position: relative`, so those
  descendants scroll with the content.
- The wrapper uses `overflow: clip`, which cannot be scrolled at all.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@itsprade
itsprade requested a review from a team as a code owner November 10, 2026 14:30
@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Code Metrics Report

main (923933d) #706 (1db37f0) +/-
Coverage 62.9% 62.9% 0.0%
Test Execution Time 4m3s 2m54s -1m9s
Details
  |                     | main (923933d) | #706 (1db37f0) |  +/-  |
  |---------------------|----------------|----------------|-------|
  | Coverage            |          62.9% |          62.9% |  0.0% |
  |   Files             |            294 |            294 |     0 |
  |   Lines             |          13483 |          13483 |     0 |
  |   Covered           |           8485 |           8485 |     0 |
+ | Test Execution Time |           4m3s |          2m54s | -1m9s |

Code coverage of files in pull request scope (91.3% → 91.3%)

Files Coverage +/- Status
packages/core/src/components/sidebar/content-container.tsx 100.0% 0.0% modified
packages/core/src/components/sidebar/primitives.tsx 91.0% 0.0% modified

Reported by octocov

@itsprade
itsprade marked this pull request as draft November 10, 2026 15:23

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.

🟢 Approval recommended

The review reports no active issues with the change to keep AppShell scrolling confined to page content.

No open issues 🎉

What changed in this PR

This PR keeps the AppShell frame stationary during anchor jumps, scrollIntoView, and focus changes, leaving scrolling within the page content.

Changes:

  • Replace the frame’s overflow: hidden with overflow: clip to prevent programmatic scrolling.
  • Position the content scroller relatively so absolute descendants remain contained.
  • Add regression assertions for both CSS classes and a patch changeset.
File Description
packages/​core/​src/​components/​sidebar/​sidebar-layout.test.tsx Assert frame clipping and relative content positioning.
packages/​core/​src/​components/​sidebar/​primitives.tsx Prevent frame scrolling with overflow-clip.
packages/​core/​src/​components/​sidebar/​content-container.tsx Make the content scroller the positioning container for absolute descendants.
.changeset/​shell-frame-stays-put.md Document the scrolling fix for a patch release.

Review effort: Balanced

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.

3 participants