From 3864f3550153617e23ad9979fb543d8a7fb4dc0a Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Thu, 10 Apr 2025 19:11:11 +0200 Subject: [PATCH] fix(YouTube - Hide layout components): Do not hide video description music/game links if hide horizontal shelves is enabled --- .../components/LayoutComponentsFilter.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/components/LayoutComponentsFilter.java b/extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/components/LayoutComponentsFilter.java index 2d617d4a4..4f6c1366c 100644 --- a/extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/components/LayoutComponentsFilter.java +++ b/extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/components/LayoutComponentsFilter.java @@ -454,16 +454,20 @@ public final class LayoutComponentsFilter extends Filter { } private static boolean hideShelves() { - // If the player is opened while library is selected, - // then filter any recommendations below the player. - if (PlayerType.getCurrent().isMaximizedOrFullscreen() - // Or if the search is active while library is selected, then also filter. - || NavigationBar.isSearchBarActive()) { + // Horizontal shelves are used for music/game links in video descriptions, + // such as https://youtube.com/watch?v=W8kI1na3S2M + if (PlayerType.getCurrent().isMaximizedOrFullscreen()) { + return false; + } + + // Must check search bar after player type, since search results + // can be in the background behind an open player. + if (NavigationBar.isSearchBarActive()) { return true; } // Do not hide if the navigation back button is visible, - // otherwise the content shelves in the YouTube Movie/Courses pages is hidden. + // otherwise the content shelves in the explore/music/courses pages are hidde. if (NavigationBar.isBackButtonVisible()) { return false; }