fix(livechat): collapse theatre full-bleed chat container when live chat is hidden (#3664) - #4267
Open
yu2971512385-ui wants to merge 1 commit into
Open
Conversation
…hat is hidden (code-charity#3664) In theatre mode YouTube reparents the live chat into #panels-full-bleed-container. The existing rule only sets `ytd-live-chat-frame#chat { display: none }`, so the container keeps reserving its width and the theatre player stays offset as if the sidebar were still present. Collapse #panels-full-bleed-container while it is hosting the hidden chat, scoped to theatre mode, and exclude the case where the user has an engagement panel (transcript, chapters, ...) explicitly expanded so those panels remain usable. Adds tests/unit/livechat-theater-offset.test.js mirroring the existing CSS-content unit tests.
yu2971512385-ui
force-pushed
the
fix/3664-theatre-livechat-offset
branch
from
August 5, 2026 08:42
7375ae4 to
3b6acaf
Compare
Author
|
Tested locally as an unpacked extension on a live stream in theatre mode:
Happy to adjust the selector scope if you'd prefer. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this fixes
Fixes #3664 — in theatre mode, when Live chat is set to Hidden, the player stays offset to the left as if the sidebar/chat were still there, leaving an empty column on the right.
Root cause
The existing rule only hides the chat frame itself:
In theatre mode YouTube reparents the live chat into
#panels-full-bleed-container. Setting only#chattodisplay:noneremoves the chat contents but the surrounding#panels-full-bleed-containerkeeps reserving its width, so the theatre player never reclaims that space. (This matches the community uBlock workaround###panels-full-bleed-containermentioned in the issue.)A repo-wide search confirms
#panels-full-bleed-containerwas not handled anywhere before this change.The fix
Collapse
#panels-full-bleed-containerwhile it is hosting the hidden chat, scoped to theatre mode:ytd-watch-flexy[theater]so the normal (non-theatre) layout is untouched.:has(ytd-live-chat-frame#chat)— only act on the container that hosts the chat.:not(:has(...EXPANDED))— if the user explicitly opens an engagement panel (transcript, chapters, …) in theatre mode, the container stays visible so those panels remain usable.Tests
Added
tests/unit/livechat-theater-offset.test.js, mirroring the existinghide-sidebar-transcript.test.jsCSS-content style.npx jestpasses locally.How to reproduce / verify
I've verified the rule loads via the manifest content-script CSS and that unit tests pass; a second visual confirmation from anyone on the issue is very welcome.