fix(YouTube - Hide layout components): Remove broken option 'Hide comments emoji picker' (#5121)

This commit is contained in:
LisoUseInAIKyrios
2025-06-05 21:09:25 +02:00
committed by GitHub
parent f2ca0eeac0
commit 9a6a639c49
4 changed files with 9 additions and 27 deletions

View File

@ -7,11 +7,6 @@ import app.revanced.extension.youtube.settings.Settings;
@SuppressWarnings("unused") @SuppressWarnings("unused")
final class CommentsFilter extends Filter { final class CommentsFilter extends Filter {
private static final String TIMESTAMP_OR_EMOJI_BUTTONS_ENDS_WITH_PATH
= "|CellType|ContainerType|ContainerType|ContainerType|ContainerType|ContainerType|";
private final StringFilterGroup commentComposer;
private final ByteArrayFilterGroup emojiPickerBufferGroup;
private final StringFilterGroup filterChipBar; private final StringFilterGroup filterChipBar;
private final ByteArrayFilterGroup aiCommentsSummary; private final ByteArrayFilterGroup aiCommentsSummary;
@ -50,14 +45,9 @@ final class CommentsFilter extends Filter {
"super_thanks_button.eml" "super_thanks_button.eml"
); );
commentComposer = new StringFilterGroup( StringFilterGroup timestampButton = new StringFilterGroup(
Settings.HIDE_COMMENTS_TIMESTAMP_AND_EMOJI_BUTTONS, Settings.HIDE_COMMENTS_TIMESTAMP_BUTTON,
"comment_composer.eml" "composer_timestamp_button.eml"
);
emojiPickerBufferGroup = new ByteArrayFilterGroup(
null,
"id.comment.quick_emoji.button"
); );
filterChipBar = new StringFilterGroup( filterChipBar = new StringFilterGroup(
@ -77,7 +67,7 @@ final class CommentsFilter extends Filter {
createAShort, createAShort,
previewComment, previewComment,
thanksButton, thanksButton,
commentComposer, timestampButton,
filterChipBar filterChipBar
); );
} }
@ -85,14 +75,6 @@ final class CommentsFilter extends Filter {
@Override @Override
boolean isFiltered(@Nullable String identifier, String path, byte[] protobufBufferArray, boolean isFiltered(@Nullable String identifier, String path, byte[] protobufBufferArray,
StringFilterGroup matchedGroup, FilterContentType contentType, int contentIndex) { StringFilterGroup matchedGroup, FilterContentType contentType, int contentIndex) {
if (matchedGroup == commentComposer) {
// To completely hide the emoji buttons (and leave no empty space), the timestamp button is
// also hidden because the buffer is exactly the same and there's no way selectively hide.
return contentIndex == 0
&& path.endsWith(TIMESTAMP_OR_EMOJI_BUTTONS_ENDS_WITH_PATH)
&& emojiPickerBufferGroup.check(protobufBufferArray).isFiltered();
}
if (matchedGroup == filterChipBar) { if (matchedGroup == filterChipBar) {
return aiCommentsSummary.check(protobufBufferArray).isFiltered(); return aiCommentsSummary.check(protobufBufferArray).isFiltered();
} }

View File

@ -179,7 +179,7 @@ public class Settings extends BaseSettings {
public static final BooleanSetting HIDE_COMMENTS_AI_SUMMARY = new BooleanSetting("revanced_hide_comments_ai_summary", FALSE); public static final BooleanSetting HIDE_COMMENTS_AI_SUMMARY = new BooleanSetting("revanced_hide_comments_ai_summary", FALSE);
public static final BooleanSetting HIDE_COMMENTS_BY_MEMBERS_HEADER = new BooleanSetting("revanced_hide_comments_by_members_header", FALSE); public static final BooleanSetting HIDE_COMMENTS_BY_MEMBERS_HEADER = new BooleanSetting("revanced_hide_comments_by_members_header", FALSE);
public static final BooleanSetting HIDE_COMMENTS_CREATE_A_SHORT_BUTTON = new BooleanSetting("revanced_hide_comments_create_a_short_button", TRUE); public static final BooleanSetting HIDE_COMMENTS_CREATE_A_SHORT_BUTTON = new BooleanSetting("revanced_hide_comments_create_a_short_button", TRUE);
public static final BooleanSetting HIDE_COMMENTS_TIMESTAMP_AND_EMOJI_BUTTONS = new BooleanSetting("revanced_hide_comments_timestamp_and_emoji_buttons", TRUE); public static final BooleanSetting HIDE_COMMENTS_TIMESTAMP_BUTTON = new BooleanSetting("revanced_hide_comments_timestamp_button", FALSE);
public static final BooleanSetting HIDE_COMMENTS_PREVIEW_COMMENT = new BooleanSetting("revanced_hide_comments_preview_comment", FALSE); public static final BooleanSetting HIDE_COMMENTS_PREVIEW_COMMENT = new BooleanSetting("revanced_hide_comments_preview_comment", FALSE);
public static final BooleanSetting HIDE_COMMENTS_SECTION = new BooleanSetting("revanced_hide_comments_section", FALSE); public static final BooleanSetting HIDE_COMMENTS_SECTION = new BooleanSetting("revanced_hide_comments_section", FALSE);
public static final BooleanSetting HIDE_COMMENTS_THANKS_BUTTON = new BooleanSetting("revanced_hide_comments_thanks_button", TRUE); public static final BooleanSetting HIDE_COMMENTS_THANKS_BUTTON = new BooleanSetting("revanced_hide_comments_thanks_button", TRUE);

View File

@ -161,7 +161,7 @@ val hideLayoutComponentsPatch = bytecodePatch(
SwitchPreference("revanced_hide_comments_by_members_header"), SwitchPreference("revanced_hide_comments_by_members_header"),
SwitchPreference("revanced_hide_comments_section"), SwitchPreference("revanced_hide_comments_section"),
SwitchPreference("revanced_hide_comments_create_a_short_button"), SwitchPreference("revanced_hide_comments_create_a_short_button"),
SwitchPreference("revanced_hide_comments_timestamp_and_emoji_buttons"), SwitchPreference("revanced_hide_comments_timestamp_button"),
SwitchPreference("revanced_hide_comments_preview_comment"), SwitchPreference("revanced_hide_comments_preview_comment"),
SwitchPreference("revanced_hide_comments_thanks_button"), SwitchPreference("revanced_hide_comments_thanks_button"),
), ),

View File

@ -371,9 +371,9 @@ You will not be notified of any unexpected events."</string>
<string name="revanced_hide_comments_create_a_short_button_title">Hide \'Create a Short\' button</string> <string name="revanced_hide_comments_create_a_short_button_title">Hide \'Create a Short\' button</string>
<string name="revanced_hide_comments_create_a_short_button_summary_on">Create a Short button is hidden</string> <string name="revanced_hide_comments_create_a_short_button_summary_on">Create a Short button is hidden</string>
<string name="revanced_hide_comments_create_a_short_button_summary_off">Create a Short button is shown</string> <string name="revanced_hide_comments_create_a_short_button_summary_off">Create a Short button is shown</string>
<string name="revanced_hide_comments_timestamp_and_emoji_buttons_title">Hide emoji and timestamp buttons</string> <string name="revanced_hide_comments_timestamp_button_title">Hide timestamp button</string>
<string name="revanced_hide_comments_timestamp_and_emoji_buttons_summary_on">Emoji and timestamp buttons are hidden</string> <string name="revanced_hide_comments_timestamp_button_summary_on">Timestamp button is hidden</string>
<string name="revanced_hide_comments_timestamp_and_emoji_buttons_summary_off">Emoji and timestamp buttons are shown</string> <string name="revanced_hide_comments_timestamp_button_summary_off">Timestamp button is shown</string>
<string name="revanced_hide_comments_preview_comment_title">Hide preview comment</string> <string name="revanced_hide_comments_preview_comment_title">Hide preview comment</string>
<string name="revanced_hide_comments_preview_comment_summary_on">Preview comment is hidden</string> <string name="revanced_hide_comments_preview_comment_summary_on">Preview comment is hidden</string>
<string name="revanced_hide_comments_preview_comment_summary_off">Preview comment is shown</string> <string name="revanced_hide_comments_preview_comment_summary_off">Preview comment is shown</string>