Skip to content

Fix sidebar scroll position reset on fullscreen exit#14493

Open
shaun6jrome wants to merge 1 commit into
zen-browser:devfrom
shaun6jrome:fix/sidebar-scroll-fullscreen-exit
Open

Fix sidebar scroll position reset on fullscreen exit#14493
shaun6jrome wants to merge 1 commit into
zen-browser:devfrom
shaun6jrome:fix/sidebar-scroll-fullscreen-exit

Conversation

@shaun6jrome

Copy link
Copy Markdown

Fixes #14389

Problem

Sidebar tab scroll position resets to top after exiting fullscreen video, specifically when the new-tab-button is positioned at the bottom of the sidebar. Caused by _handleTabSelect re-triggering during the fullscreen exit transition, when arrowScrollbox's layout geometry is still transiently distorted.

Fix

Adds an inDOMFullscreen guard to #ensureTabIsVisible(), matching the existing guard pattern already used in ZenSpaceManager's onPinnedTabsResize() for the same class of fullscreen-transition layout bug.

Testing

Submitted from source review — I wasn't able to build and manually test this locally yet due to environment constraints. The fix follows an existing, precedented guard pattern in the codebase for this exact transition. Happy to verify against a running build once my environment is set up, or sooner if a maintainer can confirm the approach.

Adds an inDOMFullscreen guard to #ensureTabIsVisible(), mirroring the existing
guard pattern in ZenSpaceManager's onPinnedTabsResize(). Prevents
ensureElementIsVisible from running against a transiently-distorted scrollbox
layout during fullscreen exit, which was causing the sidebar to snap to the top.

Fixes zen-browser#14389
@shaun6jrome shaun6jrome requested a review from mr-cheffy as a code owner July 6, 2026 12:21
@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. Bug labels Jul 6, 2026
@mr-cheffy

Copy link
Copy Markdown
Member

I wonder why this function is getting called in the first place? We shouldn't be calling it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sidebar position set to top after exiting fullscreen YouTube video

2 participants