Skip to content

Conversation

@staticpayload
Copy link

@staticpayload staticpayload commented Dec 28, 2025

Summary

Fixes #17

The Problem

When navigating between rooms, the sidebar scrollbar would jump momentarily unless it was already at the top position. This visual glitch occurred on all browsers.

Root Cause

The browser's native scroll anchoring feature was conflicting with the app's existing scroll position management during Turbo navigation. When Turbo updates the sidebar content via turbo-frame, the content height temporarily changes. The browser's scroll anchoring tries to maintain position relative to visible content, causing the scrollbar to "jump".

The Fix

Added overflow-anchor: none to the .sidebar__container element to disable native scroll anchoring.

.sidebar__container {
  /* ... existing styles ... */
  overflow-anchor: none;
}

Why This Works

  1. The app already has a custom scroll position controller (maintain_scroll_controller.js) that handles scroll restoration during Turbo navigation
  2. Native scroll anchoring was conflicting with this custom logic
  3. Disabling native anchoring lets the custom controller handle it properly

Browser Support

overflow-anchor: none is supported in all modern browsers:

  • Chrome 56+
  • Firefox 66+
  • Safari 16+
  • Edge 79+

Testing

  • Scrollbar no longer jumps when changing rooms
  • Scroll position is still restored correctly on navigation
  • Works on Chrome, Firefox, Safari

AI Disclosure

This PR was developed with AI assistance:

  • Opus 4.5 for planning and code review
  • GLM 4.7 for code execution
  • GitHub PR review for quality assurance

@staticpayload

This comment was marked as spam.

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.

Sidebar scrollbar jumps when changing rooms

1 participant