ReVanced / revanced-patches

🧩 Patches for ReVanced
https://revanced.app
GNU General Public License v3.0
2.43k stars 282 forks source link

bug(YouTube - Hide search result shelf header): Search result headers showing up when searching #8

Open ILoveOpenSourceApplications opened 11 months ago

ILoveOpenSourceApplications commented 11 months ago

Bug description

When searching for individuals with YouTube account such as artists and all, official headers are showing up in search results. Examples: Screenshot_20231213_000154_YouTube Screenshot_20231213_001742_YouTube

Error logs

No response

Solution

No response

Additional context

No response

Acknowledgements

KobeW50 commented 11 months ago

There isn't anything called "official header" in YT ReVanced. Is this what the Hide search result shelf header toggle is supposed to hide?

ILoveOpenSourceApplications commented 11 months ago

There isn't anything called "official header" in YT ReVanced. Is this what the Hide search result shelf header toggle is supposed to hide?

Ah yes, I believe so too. I could be wrong.

ILoveOpenSourceApplications commented 8 months ago

I tried to see if it's a litho component and can be hidden via the custom filter, but using shelf_header or modern_type_shelf_header_context hides every header throughout the search UI, even hiding shorts header.

LisoUseInAIKyrios commented 8 months ago

Maybe there is a buffer string that can be used with the path.

But since there is no icons in the UI header, there may not be anything in the buffer to pick out that is not localized text.

oSumAtrIX commented 8 months ago

I tried searching for mkbhd and I do not see such a header. Is this still occurring?

ILoveOpenSourceApplications commented 8 months ago

Yes, it's still present.

Edit: If the user has hide shorts in feed on, then the search header is hidden.

ILoveOpenSourceApplications commented 6 months ago

Using the following litho+buffer string in custom filter hides the artists header as long as they have some kind of title related to song in them. ^shelf_header.eml$song

ILoveOpenSourceApplications commented 6 months ago

Similarly for YouTuber headers, ^shelf_header.eml$YouTuber should work as well.

ILoveOpenSourceApplications commented 6 months ago

We'll have to somehow find all channels with a different but generalizable key word so we can hide many with lesser number of filters. As of now the following are the ones I came across. ^shelf_header.eml$YouTuber ^shelf_header.eml$song ^shelf_header.eml$rapper ^shelf_header.eml$actor

ILoveOpenSourceApplications commented 6 months ago

@LisoUseInAIKyrios, is this a viable solution? We'll have to do a scoop of all possible headers and add them one by one to the filter for this to work.

LisoUseInAIKyrios commented 6 months ago

It's not a viable general solution if a filter relies on identifying localized (English) text.

LisoUseInAIKyrios commented 6 months ago

Another idea, is to handle shelf_header.eml in search results with a whitelist. In other words, hide it unless it can be identified as something that is not the user detail shelf.

That would require finding unique path/buffer strings that appear in all other uses of the shelf for search.

ILoveOpenSourceApplications commented 6 months ago

It's not a viable general solution if a filter relies on identifying localized (English) text.

Yeah, I did think about language being an issue when using English words as filter.

ILoveOpenSourceApplications commented 6 months ago

That would require finding unique path/buffer strings that appear in all other uses of the shelf for search.

Is that an easily attainable solution?

LisoUseInAIKyrios commented 6 months ago

Is that an easily attainable solution?

When does the shelf show up in search results? Is it just this and Shorts? Or does it show up at other times too?

ILoveOpenSourceApplications commented 6 months ago

The header shows up when searching individual persons with channel I think. Examples I have come across are any music artists (like Charlie Puth, Selena Gonez), MKBHD, Will Smith, rappers (like Eminem), etc.

LisoUseInAIKyrios commented 6 months ago

Right. But does shelf_header.eml show up in the search for anything that is not Shorts or this individual person header?

If shelf_header.eml only shows up for Shorts and people, then it can hide shelf_header.eml unless the path contains Shorts specific components.

But if shelf_header.eml shows up in search for other stuff, then that other stuff needs to be identified.

ILoveOpenSourceApplications commented 6 months ago

But if shelf_header.eml shows up in search for other stuff, then that other stuff needs to be identified.

It hides all types of headers, in search, in channel, in homepage (for shorts). Headers such as from the issues #6 and #2959. So yeah, there's more than just the shorts and individual person header.

LisoUseInAIKyrios commented 6 months ago

Many of those can be ignored, because they do not show up in search. The search bar is now hooked so the whitelist would only apply when the shelf shows up and the search bar is on screen.

Channel pages do not show up with the search bar active, nor does anything in the feed. So the only stuff a whitelist needs to identify is search specific usage of the shelf.

Edit: these will be a problem with a whitelist, because many of these have no icon and are just as hard to identify as the user pages here. So the idea of a whitelist probably won't work just because of these.

ILoveOpenSourceApplications commented 6 months ago

Ah I see, whilst it'll ignore the shelf headers in other parts except search, if search has a different type of header then that'll be an issue.

ILoveOpenSourceApplications commented 6 months ago

For reference.

04-22 15:25:10.220 22440 23157 D revanced: LithoFilterPatch: Searching ID: null Path: shelf_header.eml|87bbd5cf2f80c456|CellType|modern_type_shelf_header_content.eml|7b97cca7dd81f118|ContainerType| BufferStrings: American YouTuberΓ¥Ösans-serifΓ¥ÖMarques BrownleeΓ¥Ösans-serifΓ¥ÖMarques Brownlee, American YouTuberΓ¥Öeml.shelf_headerΓ¥Ö
04-22 15:28:55.827 22440 23157 D revanced: LithoFilterPatch: Searching ID: null Path: shelf_header.eml|87bbd5cf2f80c456|CellType|modern_type_shelf_header_content.eml|7b97cca7dd81f118|ContainerType| BufferStrings: American singer-songwriterΓ¥Ösans-serifΓ¥ÖCharlie PuthΓ¥Ösans-serifΓ¥ÖCharlie Puth, American singer-songwriterΓ¥Öeml.shelf_headerΓ¥Ö
04-22 15:30:02.988 22440 23157 D revanced: LithoFilterPatch: Searching ID: null Path: shelf_header.eml|87bbd5cf2f80c456|CellType|modern_type_shelf_header_content.eml|7b97cca7dd81f118|ContainerType| BufferStrings: American rapperΓ¥Ösans-serifΓ¥ÖEminemΓ¥Ösans-serifΓ¥ÖEminem, American rapperΓ¥Öeml.shelf_headerΓ¥Ö
04-22 15:31:08.517 22440 23158 D revanced: LithoFilterPatch: Searching ID: null Path: shelf_header.eml|87bbd5cf2f80c456|CellType|modern_type_shelf_header_content.eml|7b97cca7dd81f118|ContainerType| BufferStrings: American actor and rapperΓ¥Ösans-serifΓ¥ÖWill SmithΓ¥Ösans-serifΓ¥ÖWill Smith, American actor and rapperΓ¥Öeml.shelf_headerΓ¥Ö
ILoveOpenSourceApplications commented 2 months ago

YouTube has changed the design of the header and now adding compact_channel.eml to custom filter hides it.

oSumAtrIX commented 2 months ago

Compact_channel matches to other components

ILoveOpenSourceApplications commented 2 months ago

I did a check to see if that's the case or not, but I didn't see it hiding anything else other than the header itself.

ILoveOpenSourceApplications commented 1 week ago

@LisoUseInAIKyrios, given that it's no longer a header, shouldn't Hide search result shelf header be removed as its obsolete now?

LisoUseInAIKyrios commented 1 week ago

Is it certain it's obsolete? If so then yes if should be removed.

Want to make a PR with the changes?

ILoveOpenSourceApplications commented 1 week ago

I can if needed, as it's simply removing the obsolete patch lines.