NewPipe icon indicating copy to clipboard operation
NewPipe copied to clipboard

Add support for advanced content and sort filters in searches

Open evermind-zz opened this issue 1 year ago • 70 comments

What is it?

  • [x] Bugfix (user facing)
  • [x] Feature (user facing)
  • [x] Codebase improvement (dev facing)
  • [ ] Meta improvement to the project (dev facing)

Description of the changes in your PR

  • provide sort filters (and content filters) that are available by the supported platforms itself

There are 4 different UI to test

  • (1) dialog like (default)
  • (2) action menu look alike dialog (my favourite)
  • (3) action menu (legacy)
  • (4) chip dialog

To choose go to settings -> appearance -> 'Select Search Filter UI'

Notes:

  • UI (3) is slow but working (slow maybe because of misusing the action menu
Feedback needed
  • which UIs do you want (to merge)? I would like to keep 1 and 2 and 4. 3 seems to be also liked. So keep them all!. ~~I will then rework the code as there is some duplication right now that should be eliminated first~~ Any duplication has been removed.
Todo
  • ~~fix sonar findings~~
  • ~~fix your findings~~
  • ~~string L10n~~

Before/After Screenshots/Screen Record

Select the UI (Ui 1) YouTube (UI 2) YouTube (UI 2) Peertube (UI 3) Live in action (UI 4) YouTube

Fixes the following issue(s)

  • Fixes #2251

Relies on the following changes

  • https://github.com/TeamNewPipe/NewPipeExtractor/pull/904

APK testing

The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR.

Due diligence

evermind-zz avatar Aug 19 '22 14:08 evermind-zz

Maybe the UI could be changed from this giant scroll. Ideas?

opusforlife2 avatar Aug 19 '22 19:08 opusforlife2

@opusforlife2 something like https://github.com/TeamNewPipe/NewPipe/issues/2251#issuecomment-477288259 would be great in my opinion.

triallax avatar Aug 19 '22 21:08 triallax

@evermind-zz Is that UI something you would be interested in implementing? If not, we could always go with the current one as a minimum viable product and improve it later.

opusforlife2 avatar Aug 19 '22 21:08 opusforlife2

@evermind-zz Is that UI something you would be interested in implementing? If not, we could always go with the current one as a minimum viable product and improve it later.

For me the interaction with the current UI is quick and I would like to keep it. But I am willing to give implementing the other UI a shot. Maybe I will like the new UI too or I could make it configurable in settings if someone like me prefer the 'old way'

evermind-zz avatar Aug 20 '22 08:08 evermind-zz

first thank you for this... is it possible to have all the options to show up in one box without scrolling... same like the playback speed mene... with a proper layout for both portrait and landscape mode

also i think it is important to have [ok] [reset] buttons... so we can choose the filter /sort options in one go... not in multiple times and reloading results in each time

MD77MD avatar Aug 23 '22 22:08 MD77MD

For me the interaction with the current UI is quick and I would like to keep it. But I am willing to give implementing the other UI a shot. Maybe I will like the new UI too or I could make it configurable in settings if someone like me prefer the 'old way'

If we go with the current design for now, I would at least suggest using a dedicated filter icon (via Google's material icons). Having it be stuffed into the hamburger menu isn't very intuitive, IMO.

TacoTheDank avatar Aug 25 '22 01:08 TacoTheDank

@MD77MD I do not really understand what you mean by you have to reload the gui. This version modifies the current menu filter behaviour. Here you first select everything in the menu and than you have to scroll to the top and push search inside the menu. Than the menu will disappear. Have you tested this PR here?

But nevertheless I will come up with a dialog style UI

evermind-zz avatar Aug 25 '22 06:08 evermind-zz

For me the interaction with the current UI is quick and I would like to keep it. But I am willing to give implementing the other UI a shot. Maybe I will like the new UI too or I could make it configurable in settings if someone like me prefer the 'old way'

If we go with the current design for now, I would at least suggest using a dedicated filter icon (via Google's material icons). Having it be stuffed into the hamburger menu isn't very intuitive, IMO.

no matter which UI but a filter icon would be nice

evermind-zz avatar Aug 25 '22 06:08 evermind-zz

@evermind-zz : Are there any news?

still working on it! I've rewrote the logic part and have a new UI! But my time is very limited so it will still take some time

evermind-zz avatar Sep 12 '22 20:09 evermind-zz

first thank you for this... is it possible to have all the options to show up in one box without scrolling... same like the playback speed mene... with a proper layout for both portrait and landscape mode

This is the closest thing to what i was trying to convey

Portrait mode: 108641489-b6429f00-74c9-11eb-8008-f086ab9a1574 from #5662 by @SameenAhnaf

landscape mode: the same as the idea above but stacked like pic below 94719607-ae843180-0353-11eb-8646-a957e1d6f41e from https://github.com/TeamNewPipe/NewPipe/issues/110#issuecomment-701536291

MD77MD avatar Sep 13 '22 21:09 MD77MD

With Ok, Reset buttons 20220914_013146

****** OR *****

190019317-4e61378c-ebb3-4e30-8509-1c42daffc22a

Personally, I prefer first one

MD77MD avatar Sep 13 '22 22:09 MD77MD

Also do you think adding #3824 , whether now or later, is possible?

MD77MD avatar Sep 13 '22 22:09 MD77MD

@evermind-zz, @MD77MD : Are there any news?

Angelk90 avatar Sep 25 '22 17:09 Angelk90

@Angelk90 13 days since the last author reply is not nearly enough time to be asking for updates. This is closer to spam territory.

opusforlife2 avatar Sep 25 '22 18:09 opusforlife2

I'm still working on it. I'll post an update ASAP

evermind-zz avatar Sep 27 '22 22:09 evermind-zz

Edit: comment obsolete. See first post There are 3 different UI

  • (1) dialog like (default)
  • (2) action menu look alike dialog (my favourite)
  • (3) action menu (legacy)

To choose go to settings -> appearance -> 'Select Search Filter UI'

Notes: All UI should work:

  • UI (1) is working. But I need some help. Sometimes in the spinners you can manage that the selected item is not visible
  • UI (2) is working! Also need some help with layouting.
  • UI (3) is slow but working (slow maybe because of misusing the action menu

The attached apk newpipe-with-search-filters.zip is just a snapshot of my working copy that is bit older than 0.24 release. But I've no time for a rebase atm.

In the next days/weeks I will update the code for this PR. Than you can drop me your insights of layouting it better programatically.

evermind-zz avatar Sep 29 '22 14:09 evermind-zz

I would love to test it but the apk does not install on Android 11. Can you provide a suitable apk? Normally I can install the artifacts from the workflows, so there must be something wrong with this specific one.

nicoursi avatar Sep 29 '22 14:09 nicoursi

I would love to test it but the apk does not install on Android 11. Can you provide a suitable apk? Normally I can install the artifacts from the workflows, so there must be something wrong with this specific one.

the problem is that this one has no signature: but with adb install -t app-debug.apk it should be installable. If not possible I will create a new one with a signature Edit: @nicoursi above is now a hopefully working apk

evermind-zz avatar Sep 29 '22 15:09 evermind-zz

It became obvious in just a few tries that the dialog menu is far better to use compared to the action menu. Not only is it comfortably info dense without the need for lots of scrolling, it lets you change multiple settings before applying the filter/sort.

opusforlife2 avatar Oct 01 '22 00:10 opusforlife2

@evermind-zz : It does not allow to be installed.

Angelk90 avatar Oct 01 '22 08:10 Angelk90

@evermind-zz : It does not allow to be installed.

The new 'artifact' one should work. See first post where to find it.

evermind-zz avatar Oct 14 '22 06:10 evermind-zz

@evermind-zz : Tested on tablet, here are some screens:

Simple Dialog (default): Screenshot_20221014-134856_NewPipe content-sort-filter-framework.jpg

Screenshot_20221014-134011_NewPipe content-sort-filter-framework.jpg Screenshot_20221014-134033_NewPipe content-sort-filter-framework.jpg

Action Menu styled Dialog: Screenshot_20221014-134133_NewPipe content-sort-filter-framework.jpg

Action Menu (legacy): Screenshot_20221014-134200_NewPipe content-sort-filter-framework.jpg

Angelk90 avatar Oct 14 '22 11:10 Angelk90

@Angelk90 thx! Are screens in portrait mode?

evermind-zz avatar Oct 14 '22 12:10 evermind-zz

@evermind-zz : Yes, in portrait mode.

Angelk90 avatar Oct 14 '22 12:10 Angelk90

@evermind-zz : Yes, in portrait mode.

Could you @Angelk90 do one screenshot for landscape too? That would be great.

evermind-zz avatar Oct 14 '22 12:10 evermind-zz

@evermind-zz :

Simple Dialog (default): Screenshot_20221014-144752_NewPipe content-sort-filter-framework.jpg

Action Menu styled Dialog: Screenshot_20221014-144718_NewPipe content-sort-filter-framework.jpg

Action Menu (legacy), weird bug first, once I click I get first image then second image.:

Screenshot_20221014-144639_NewPipe content-sort-filter-framework.jpg

Screenshot_20221014-144648_NewPipe content-sort-filter-framework.jpg

Angelk90 avatar Oct 14 '22 12:10 Angelk90

Action Menu (legacy), weird bug first, once I click I get first image then second image.:

Screenshot_20221014-144639_NewPipe content-sort-filter-framework.jpg

Screenshot_20221014-144648_NewPipe content-sort-filter-framework.jpg

This seems due to the fact that the keyboard is removed programmatically. But as I think this UI will not make it into NewPipe, we can ignore it as I probably remove it if no one wants to have it:)

evermind-zz avatar Oct 14 '22 16:10 evermind-zz

@evermind-zz : Graphically it's my favorite of the three, don't remove it.

Angelk90 avatar Oct 14 '22 17:10 Angelk90

Regarding https://github.com/TeamNewPipe/NewPipe/issues/2251#issuecomment-1308826374, since your PR is not marked as draft, the team already knows that it is up for review. You don't need to take any specific action.

The team is usually quite short on reviewing time, though, which is why we ask devs to help review other open PRs in the repo.

opusforlife2 avatar Nov 09 '22 14:11 opusforlife2