fix: keep transcript visible when hiding sidebar (#1530)#3884
Open
jiangyj545 wants to merge 1 commit into
Open
fix: keep transcript visible when hiding sidebar (#1530)#3884jiangyj545 wants to merge 1 commit into
jiangyj545 wants to merge 1 commit into
Conversation
When both 'Hide sidebar' and 'Transcript' are enabled, the transcript engagement panel should remain visible while related videos and other sidebar content stay hidden. Changes: - Exclude div#panels from hiding when transcript is enabled - Explicitly show transcript panel when both features are active - Hide non-transcript panels (chapters, etc.) to keep sidebar clean - Ensure secondary div has proper width for transcript panel layout - Add comprehensive unit tests for the feature interaction Fixes code-charity#1530
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.
Fixes #1530
Problem: When "Hide sidebar" is enabled, the transcript engagement panel is also hidden because
div#secondary div#panelsis set todisplay: none. Users want to hide related videos but still access the transcript.Changes
CSS (
sidebar.css)Exclude panels from hiding when transcript is enabled — Changed the
div#panelsselector tohtml[it-hide-sidebar='true']:not([it-transcript='true']) div#secondary div#panelsso panels are only hidden when transcript is NOT active.Explicitly show transcript panel — Added
html[it-hide-sidebar='true'][it-transcript='true'] div#secondary div#panels { display: block !important }with higher specificity to override the sidebar auto-sizing rules.Hide non-transcript panels — Added
html[it-hide-sidebar='true'][it-transcript='true'] div#secondary div#panels > :not([target-id*='transcript'])to ensure other engagement panels (chapters, etc.) remain hidden while only the transcript is visible.Fix secondary width for transcript layout — Added
html[it-hide-sidebar='true'][it-transcript='true'] ytd-watch-flexy[flexy] #secondary.ytd-watch-flexy { width: fit-content !important; min-width: max(445px, 17vw) !important }to ensure the secondary div has enough space for the transcript panel, overriding thewidth: autocollapse from hide-sidebar.Tests
Added comprehensive unit tests covering all 6 scenarios:
Improvements over #3851
The existing PR #3851 only adds
:not([it-transcript='true'])to the panels selector. This PR goes further:Testing
Bounty claim: This PR addresses issue #1530 which is labeled with the Bounty tag.