youtube icon indicating copy to clipboard operation
youtube copied to clipboard

🐞[Bug] "Comments in Sidebar" feature reverts to default bottom layout on page refresh (F5)

Open jjaasson566 opened this issue 6 months ago • 2 comments

Concise Description

Bug Description

The "Comments -> Sidebar" option fails to persist after refreshing the page (F5), restarting the browser, or restarting the PC.

It temporarily works only when clearing cookies (which signs out the account), but as soon as the page is refreshed (F5) or when logged into the YouTube account, the layout immediately reverts to the default YouTube layout with comments at the bottom. It seems like the extension fails to override YouTube's native account-based A/B testing/experimental layout scripts during the initial F5 page load.

Steps to Reproduce

  1. Enable "Sidebar" in the Comments settings of Improve YouTube!.
  2. The comments move to the sidebar (or it works after clearing cookies/logging out).
  3. Refresh the page (F5) or reopen the page while logged into a YouTube account.
  4. The comment section drops back to the bottom, ignoring the extension setting.

Expected Behavior

The comment section should stay fixed in the sidebar even after pressing F5 or restarting the browser.

Actual Behavior

The layout reverts to the default bottom layout on every page refresh.

Environment & Troubleshooting Done

  • Browser: Microsoft Edge
  • Extension Version: 4.2026
  • Isolations Tested: I have completely disabled ALL other extensions (including Adblock Plus, DanMage) and disabled all userscripts in Violentmonkey (including YouTube CPU Tamer). The issue still persists on F5 refresh, meaning it is a direct conflict between the extension and YouTube's native UI loading sequence.

Browser/s

Edge

Other Browser:

No response

'Steps to reproduce' - Which of our features is required for the bug to happen?

  1. Open Improve YouTube! settings -> Go to "Comments" -> Enable "Sidebar". 2. Watch any video, the comment section correctly moves to the sidebar. 3. Press F5 to refresh the page (or restart the browser/PC). 4. The comment section breaks and reverts back to the default layout at the bottom.

Since when?

Recently, after a recent YouTube UI backend update rollout.

Does the bug still happen when you log out of YouTube?

None

..No? Then please paste your yt.config_.EXPERIMENT_FLAGS. Twice (With the error & Without)

No response

Are any errors or related log-messages shown in the Browser-Console? (F12)

No response

Tested as the only active extension? (incognito mode or another browser users):

None

Expected preferred behavior:

No response

ImprovedTube Version

No response

Your Settings (From the Extension's ⋮-Hamburger menu > Settings > Backup & reset > Export settings)

No response

Your YouTube-Document

No response

OS / Device:

No response

jjaasson566 avatar May 21 '26 13:05 jjaasson566

Root Cause: YouTube uses account-level experimental flags (such as kevlar_watch_grid) for A/B layout testing. When these flags are active (especially when logged into an account), they load YouTube's new watch grid design. This clashing layout prevents ImprovedTube from correctly finding and positioning the comments in the sidebar manually.

Although ImprovedTube has a helper function (YouTubeExperiments) to force these experiment flags to false (classic layout), it was only checking the undo_the_new_sidebar and description === 'sidebar' options. It was completely ignoring the comments_sidebar and comments_sidebar_simple settings, leading to the layout reverting on page refresh.

SHANip9 avatar May 22 '26 15:05 SHANip9

One thing can be done is to update ImprovedTube.YouTubeExperiments to check both comments_sidebar and comments_sidebar_simple (supporting both boolean true and string "true" values)

SHANip9 avatar May 22 '26 15:05 SHANip9