Skip to content
This repository has been archived by the owner on Dec 11, 2024. It is now read-only.

Commit

Permalink
chore(YouTube - Hide feed components): Slightly reduced the height of…
Browse files Browse the repository at this point in the history
… the empty space left behind by the `Hide expandable chip under videos` setting
  • Loading branch information
anddea committed Sep 30, 2024
1 parent 99a8746 commit d96ecc7
Showing 1 changed file with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ public final class FeedComponentsFilter extends Filter {
private static final String CONVERSATION_CONTEXT_SUBSCRIPTIONS_IDENTIFIER =
"heightConstraint=null";
private static final String INLINE_EXPANSION_PATH = "inline_expansion";
private static final String FEED_VIDEO_PATH = "video_lockup_with_attachment";

private static final ByteArrayFilterGroup expansion =
private static final ByteArrayFilterGroup inlineExpansion =
new ByteArrayFilterGroup(
Settings.HIDE_EXPANDABLE_CHIP,
INLINE_EXPANSION_PATH
"inline_expansion"
);

private static final ByteArrayFilterGroup mixPlaylists =
Expand All @@ -38,8 +39,8 @@ public final class FeedComponentsFilter extends Filter {

private final StringFilterGroup channelProfile;
private final StringFilterGroup communityPosts;
private final StringFilterGroup expandableChip;
private final ByteArrayFilterGroup visitStoreButton;

private final StringFilterGroup videoLockup;

private static final StringTrieSearch communityPostsFeedGroupSearch = new StringTrieSearch();
Expand Down Expand Up @@ -83,7 +84,7 @@ public FeedComponentsFilter() {

videoLockup = new StringFilterGroup(
null,
"video_lockup_with_attachment.eml"
FEED_VIDEO_PATH
);

addIdentifierCallbacks(
Expand Down Expand Up @@ -124,10 +125,11 @@ public FeedComponentsFilter() {
"attribution.eml" // new layout
);

final StringFilterGroup expandableChip = new StringFilterGroup(
expandableChip = new StringFilterGroup(
Settings.HIDE_EXPANDABLE_CHIP,
INLINE_EXPANSION_PATH,
"inline_expander"
"inline_expander",
"expandable_metadata.eml"
);

final StringFilterGroup feedSurvey = new StringFilterGroup(
Expand Down Expand Up @@ -240,8 +242,13 @@ public boolean isFiltered(String path, @Nullable String identifier, String allVa
if (!communityPostsFeedGroup.check(allValue).isFiltered()) {
return false;
}
} else if (matchedGroup == expandableChip) {
if (path.startsWith(FEED_VIDEO_PATH)) {
return super.isFiltered(path, identifier, allValue, protobufBufferArray, matchedGroup, contentType, contentIndex);
}
return false;
} else if (matchedGroup == videoLockup) {
if (path.startsWith("CellType|") && expansion.check(protobufBufferArray).isFiltered()) {
if (path.startsWith("CellType|") && inlineExpansion.check(protobufBufferArray).isFiltered()) {
return super.isFiltered(path, identifier, allValue, protobufBufferArray, matchedGroup, contentType, contentIndex);
}
return false;
Expand Down

0 comments on commit d96ecc7

Please sign in to comment.