-
-
Notifications
You must be signed in to change notification settings - Fork 503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
comment sidebar; extra sidebars; related videos grid view;... (previously: Double sidebars at 2560px width) #1960
Comments
Hi! I'm a student from the University of Florida looking to make a first-time contribution for an assignment. Mind if I take a look at this issue? If you could point me to the location of the issue I'd greatly appreciate it! |
Go for it, but I just found this issue and reported it, so I don't know where it comes from. If I had to guess, it's probably because in 1440 there's enough space for two sidebars. |
hi! @Rulawtor
Not the first one these days. Wonderful surprise! @a1exanderklein To solve #1960 we got to disable one or both of these blocks conditionally:
- ..., through adding a toggle to our menu skeleton youtube/menu/skeleton-parts/appearance.js Line 669 in f5cdcb4
- the toggle can be called: "columns" (with the message in _locales/en/ "Extra sidebar column/s (if your screen window is wide)" - until recently CSS didn't allow nesting statements inside anything besides @media ... { ... @media ... { ... @media ... { ...} } }, so we can add :not([columns=true]) to every selector line inside the media queries. ALSO, CSS can be nested now (Breaking news: https://sass-lang.com/blog/sass-and-native-nesting/ https://www.w3.org/TR/css-nesting-1/ https://caniuse.com/css-nesting). So the new/short/convenient way must be suggestible (and SCSS & SASS lose a big original reason. However the old way will sometimes make sense if it is just two lines or starts with a block, we likely need for multiple reasons still such as @media > 1920px. ) more & structure:
|
What is going on!?Well, this is a hidden feature available for Why was this addedThe main reason apart from aesthetic was that the Primary Container (video + description + comments) had a growing limit (around 1080px). Having an extra-wide YouTube window would only increase the page margin, basically empty space. This is why I added another bar for recommended videos, which then brought the idea of having grid view recommendations. youtube/js&css/web-accessible/www.youtube.com/appearance.js Lines 162 to 174 in f5cdcb4
If you also enable What's next?Well, due to the negative reception (sigh 🥲) you might:
|
hi! @D-Rekk am i tagging you too much? (It is for appreciation / credits. And also just sharing the process, as slow or also mentally nice continuity it might be - i might feel guilty / alone not having finished each point earlier, thus happy when the topic continues a bit)
not negative (the wish said it should be an option, not a default. did you also try hiding related videos? @Rulawtor ) As we are a customization thing, wishes wont stop 🎉, so i put emphasis on the process & structure.
typo? starts > 1952px.
( layed out the steps for adding a toggle above) (still a small task /good first PR for Florida undergraduates, who hopefully even might back one day after having felt some efficiency :D) |
Hi! I finally received approval from my instructor to move forward with this issue (my apologies for the wait 😵💫). I have made a few changes that I believe add a toggle correctly.
Following @ImprovedTube guidance, I have added this to appearance.js columns: {
component: "switch",
text: "toggleColumnComments"
} And this to _locales/en/messages.json "columns": {"message":"Extra sidebar column/s (if your screen window is wide)"}
I have added the :not([columns=true]) to each selector inside the queries (at least I believe I did) @media screen and (min-width: 1599px) {
html[data-page-type=video][it-comments-sidebar-simple='true'] #player:not([columns=true]) { margin-left: -20px !important;}
html[data-page-type=video][it-comments-sidebar-simple='true'] #columns:not([columns=true]) { display:flex !important; max-width:100% !important;}
html[data-page-type=video][it-comments-sidebar-simple='true'] #comments:not([columns=true]) { max-width: min(850px, 19vw) !important; margin-left:-12px; }
html[data-page-type=video][it-comments-sidebar-simple='true'][it-sidebar-left='true'] #comments:not([columns=true]) { max-right: -25px !important; }
html[data-page-type=video][it-comments-sidebar-simple='true'] #related:not([columns=true]) { margin-right: -22px !important; max-width: max(360px, 18vw) !important; }
html[data-page-type=video][it-comments-sidebar-simple='true'] #secondary:not([columns=true]) { margin-right: -22px !important; max-width: max(360px, 18vw) !important; }
html[data-page-type=video][it-comments-sidebar-simple='true']:not([it-player-size='1080p']):not([it-player-size='1440p']):not([it-player-size='2160p']):not([it-player-size='custom']):not([it-player-size='max_width']) ytd-watch-flexy:not([fullscreen]) #primary:not([columns=true]) {
min-width: min(calc(100vw - 1000px), 1260px) !important; max-width: 1260px !important; }
}
/* 2 COLS FEATURE */
@media screen and (min-width: 1952px) {
html[data-page-type=video][it-comments-sidebar='true'] ytd-watch-flexy #related:not([columns=true]) { flex-shrink: 4; min-width: 300px;}
html[data-page-type=video][it-comments-sidebar='true'] ytd-watch-flexy:not([theater]):not([fullscreen]) #related:not([columns=true]) { width: auto !important;}
html[data-page-type=video][it-comments-sidebar='true'] ytd-watch-flexy #columns:not([columns=true]) { max-width: 100%;}
html[data-page-type=video][it-comments-sidebar='true'] ytd-watch-flexy #secondary:not([columns=true]) {min-width: 300px !important; max-width: 420px;}
html[data-page-type=video][it-comments-sidebar='true'] ytd-watch-flexy #primary:not([columns=true]) {
flex: 0 0 auto;
max-width: 1280px !important;
}
html[data-page-type=video][it-comments-sidebar='true'][it-sidebar-left='true'] ytd-watch-flexy:not([theater]):not([fullscreen]) #secondary:not([columns=true]) {flex-shrink: 2;}
/*--------------------------------------------------------------
#TODO: there should be 2 new option in settings:
1 - [it-comments-sidebar-left] so we can shift comments-sidebar to the left (should appear only when 'Comments:Sidebar' is activated).
2 - [swap-sidebars] so we exchange the sidebars order (that would only apply to 1952px+ wide-screens, because player resize
is messy AT THE MOMENT. Once resize works properly we can re-arrange this entire media-screen in its own setting option too).
Might also think on the edge-cases were both options are active
--------------------------------------------------------------*/
html[data-page-type=video][it-comments-sidebar='true'][it-sidebar-left='true'] ytd-watch-flexy #secondary {order: 6;} /*TO DELETE once top is implemented*/
/* PADDINGS */
html[data-page-type=video][it-comments-sidebar='true']:not([it-sidebar-left='true']) ytd-watch-flexy #primary:not([columns=true]) {padding: 0 14px 0 24px;}
html[data-page-type=video][it-comments-sidebar='true']:not([it-sidebar-left='true']) ytd-watch-flexy #secondary:not([columns=true]) {padding-right: 0;}
html[data-page-type=video][it-comments-sidebar='true']:not([it-sidebar-left='true']) ytd-watch-flexy #secondary-inner:not([columns=true]) {padding-left: 14px; padding-right: 14px;}
html[data-page-type=video][it-comments-sidebar='true'][it-sidebar-left='true'] ytd-watch-flexy #primary:not([columns=true]) {padding: 0 14px}
html[data-page-type=video][it-comments-sidebar='true'][it-sidebar-left='true'] ytd-watch-flexy #secondary-inner:not([columns=true]) {padding-right: 24px; padding-left: 14px}
html[data-page-type=video][it-comments-sidebar='true'][it-sidebar-left='true'] ytd-watch-flexy:not([theater]):not([fullscreen]) #related:not([columns=true]),
html[data-page-type=video][it-comments-sidebar='true'] ytd-watch-flexy:not([theater]):not([fullscreen]) #related:not([columns=true]){ height: inherit; overflow-y: scroll}
html[data-page-type=video][it-comments-sidebar='true'][it-sidebar-left='true'] ytd-watch-flexy #secondary:not([columns=true]){border-right: 1px solid var(--yt-spec-10-percent-layer)}
html[data-page-type=video][it-comments-sidebar='true']:not([it-sidebar-left='true']) ytd-watch-flexy #secondary:not([columns=true]){border-left: 1px solid var(--yt-spec-10-percent-layer)}
html[data-page-type=video][it-comments-sidebar='true'] ytd-watch-flexy #related:not([columns=true]) > :first-child {padding-top: 24px;}
html[data-page-type=video][it-comments-sidebar='true'][it-sidebar-left='true'] ytd-watch-flexy #related:not([columns=true]){ padding: 0 14px 0 24px; border-right: 1px solid var(--yt-spec-10-percent-layer) }
html[data-page-type=video][it-comments-sidebar='true']:not([it-sidebar-left='true']) ytd-watch-flexy #related:not([columns=true]){ padding: 0 24px 0 14px; border-left: 1px solid var(--yt-spec-10-percent-layer)}
html[data-page-type=video][it-comments-sidebar='true'] ytd-watch-flexy[theater] #columns:not([columns=true]),
html[data-page-type=video][it-comments-sidebar='true'] ytd-watch-flexy[fullscreen] #columns:not([columns=true]) {height: auto}
html[data-page-type=video][it-comments-sidebar='true'][it-sidebar-left='true'] ytd-watch-flexy #secondary:not([columns=true]){border-left: 1px solid var(--yt-spec-10-percent-layer)}
/* or unset */
html[data-page-type=video][it-comments-sidebar='true'] #columns:not([columns=true]) {max-width: 2400px !important; }
} My only issue is that I do not know how to test this code locally. If anyone could steer me in the right direction or let me know if there is any issues in my implementation, it would be greatly appreciated! 😆 |
i just moved it up, made it true by default, but only visible when the comments sidebar (or comments sidebar-simple) are on. |
Thank you! @a1exanderklein
You can download the repo (https://github.com/code-charity/youtube/archive/refs/heads/master.zip)
|
This is great 🥰. |
while the reqeust is solved, i'm leaving this thread open so that i / we remember everything else mentioned |
⚬ PROBLEM:
Putting the comments on the sidebar in 2560x1440 resolution makes two sidebars, one with recommendations and one with comments, unlike in 1920x1080 where the recommendations get placed beneath the player.
⚬ SOLUTION:
An option to force the recommendations to go beneath the player.
⚬ ALTERNATIVES:
I don't know if this already exists, but being able to change the size of the mini-player when scrolling down to the comments would work just as well.
⚬ RELEVANCE / SCOPE:
It would be good for people who like to read the comments while watching videos.
⚬ "SIDE EFFECTS":
People who prefer the double sidebar thing wouldn't like this, but that's why it should be an option rather than the default.
⚬ CONTEXT:
//
Thank you!
The text was updated successfully, but these errors were encountered: