mobile icon indicating copy to clipboard operation
mobile copied to clipboard

Filter games

Open Mauritz8 opened this issue 1 year ago • 22 comments

Partially implement #454

Mauritz8 avatar Jul 21 '24 00:07 Mauritz8

I've implemented a filter for perf:

Screencast from 2024-07-21 14:50:36.webm

Mauritz8 avatar Jul 21 '24 13:07 Mauritz8

It looks awesome! One samll suggestion tho, is it possible to use chips for filtering like the recommended design in material 3? (https://m3.material.io/components/chips/overview)

ZTL-UwU avatar Jul 21 '24 13:07 ZTL-UwU

I agree with @ZTL-UwU. Another reason for this is because there will ultimately probably be other filters beyond variant such as result type and piece color

ijm8710 avatar Jul 21 '24 22:07 ijm8710

Thanks! Using chips seems like a great idea, I'll try to make it work.

Mauritz8 avatar Jul 23 '24 20:07 Mauritz8

I think this is a significant improvement, let me know what you think.

Screencast from 2024-07-25 17:41:35.webm

Mauritz8 avatar Jul 25 '24 15:07 Mauritz8

Thanks!

Can you try to:

  • make the chip smaller
  • call it only "variant" instead of "Time control / variant": it will be shorter;
  • put the chip in the app bar, or make it look like it is in the app bar; (I guess it is not that hard to do, but I'm not sure)

veloce avatar Jul 25 '24 18:07 veloce

For a first version this is great but would yall agree formatting the chips more similarly organized to the style laid out in the link shared earlier (screenshotting image) ?

That way you can add a few more categories for sub-filters such as win/loss and white/black

I think this organization looks a bit more streamlined

image

ijm8710 avatar Jul 25 '24 18:07 ijm8710

Yeah good idea. We could also separate the "Time control" chips from the variant chips. Using a line separator.

veloce avatar Jul 25 '24 18:07 veloce

Now it looks like the picture, big improvement again I think. I also implemented your suggestions veloce. Though I'm not exactly sure what you mean by making it smaller, was shortening the text to just 'variant' enough? Also, I'm not able to test on ios, so I'm not sure whether the app bar will look good on it.

Screencast from 2024-07-26 07:50:33.webm

Mauritz8 avatar Jul 26 '24 06:07 Mauritz8

I think a filter icon button on the right of the appbar will be more concise.

Also, I think putting the chips into a bottom sheet or a separate screen instead of a dialog is better as it gives more space for the chips to spread.

ZTL-UwU avatar Jul 26 '24 07:07 ZTL-UwU

If I understand correctly, you want a single button in the app bar, that opens all the filters? That would be a different design than what's detailed in #454. To quote:

On top of the list, an horizontal list of filters should be displayed (like in the notifications screen of GitHub app). Filters would include: "rated", "perf type", "bookmarks", etc. (list non exhaustive).

I would prefer using a popup, rather than a separate screen. There's less context switching, and you can easily exit by pressing outside the popup. Overall I think it's a better experience. Also, I don't think space is an issue, It easily fits, and this is one of the filters with the most chips. Filters like color and rated will only have 2 chips, so a separate screen seems excessive, and a bottom sheet would be very far down since there would be so little content on it.

Mauritz8 avatar Jul 26 '24 08:07 Mauritz8

I do think I had similar comments to @ZTL-UwU (even before I read his).

Was also thinking:

  • separate screen or bottom sheet may work better for this
  • a filter button rather than a chip to launch the screen with all the choices
  • Smaller chips with headers by section

Just design wise closer to the picture so we can have more sections

You can even have little icons in front of the section names to make it slightly prettier (like some pawn or something before variant type)

ijm8710 avatar Jul 26 '24 12:07 ijm8710

So, I created a new branch locally and implemented the design that you both want. I think it looks nice, and I'm willing to go for this design instead of the proposed one. @veloce what do you think?

Screencast from 2024-07-27 14:41:50.webm

Mauritz8 avatar Jul 27 '24 12:07 Mauritz8

Awesome @Mauritz8 i thinks it's starting to look a lot better.

Few more things that I think would get it to finish line

  • I feel order of variants should be either based on the same order of your perf cards (which I believe is based on total games played) or based on just most popular variant sitewide.
  • I like that we have the starting filter now! is it still possible to have the filter but still have the designation you had before to show what the filter is currently selecting? Perhaps can change the title of the header screen to say like bullet or something especially if it's just one filter selected
  • would you be able to add a section for result: won/loss/draw
  • I think icons before the section names would be the final polish to make them easy to discern quickly? Like perhaps the rabbit, bullet or turtle before the variant section. A black or white pawn before the side section. And the green plus icon for the result section? I'm not to picky with which icon you choose, I just personally feel icons before section names really work well.
  • posing one question: if you have zero activity for a variant should it show? Personally I lean no so, for example, if you've only played bullet and rapid, you would only see 2 chips. I'm not stubborn on this one, but just my personal take (if it doesn't tax the server to gather that info).

Thanks for trialing out our ideas! It's getting really good!

ijm8710 avatar Jul 27 '24 13:07 ijm8710

So, I created a new branch locally and implemented the design that you both want. I think it looks nice, and I'm willing to go for this design instead of the proposed one. @veloce what do you think?

Looks good to me. I think on top of the "filter" icon we need a chip indicating the number of selected filters. Same appearance as the "unread messages" chip on the chat icon on game screen.

veloce avatar Jul 27 '24 15:07 veloce

Thanks @ijm8710, I've made adjustments now in regards to your feedback:

  • Variants now work the same as the perf cards on the home screen. That is, they are ordered based on total games played, and ones with no games played are not shown.
  • Chip indicating how many filters are in use, like veloce suggested.
  • Icon before filter name

would you be able to add a section for result: won/loss/draw

Not supported in the api yet.

This is how it looks:

Screencast from 2024-07-28 11:26:40.webm

Mauritz8 avatar Jul 28 '24 09:07 Mauritz8

Thanks @Mauritz8 think it looks perfect! You rock

Two questions for you:

  • if only one filter is chosen, any chance to have the title reflect filter chosen as well as the result count "83 classical games"...."83 games" if multi filters chosen (this would then match the format used when opening specific games from the variant screens)
  • these same filters can be run from another user profile too, correct?

And two questions for @veloce

  • mauritz mentioned game result is not supported in api. Would this be something worth adding to api if possible? I feel being able to query a win vs loss will have use-case here and possibly elsewhere
  • on web, there are many more filters. Do you think it may make sense to have a link on the filter screen "advanced filters" for even more advanced filter access? Dream scenario is a user would be able to open an overlay web screen of the filters, choose what they want and they generate in a native screen within the app. But perhaps this is overboard.

ijm8710 avatar Jul 28 '24 14:07 ijm8710

if only one filter is chosen, any chance to have the title reflect filter chosen as well as the result count "83 classical games"...."83 games" if multi filters chosen (this would then match the format used when opening specific games from the variant screens)

Games are only fetched a few at a time, so it's unfortunately not possible to count the total when using filters. We could change the title when only a single filter is used, but I'm a bit worried that there might be too little horizontal space in the app bar.

these same filters can be run from another user profile too, correct?

Yes!

Mauritz8 avatar Jul 28 '24 18:07 Mauritz8

Okay, only reason I thought otherwise is because your other pr if you pull all classical games from the variant card it had the count. No worries then! Thanks again for your work on this

ijm8710 avatar Jul 28 '24 23:07 ijm8710

Yes it's technically possible to get the number of games if the filter is only made up of variants, but it would require an additional api request for each variant selected, which doesn't seem great. I think it could be done in a better way, and in my opinon it's not that useful unless it works no matter how complex the filter is. If it should be implemented, I think the number of results should probably be a part of the api response instead. The advanced search on the website shows the number of results, so it should be possible to implement.

Mauritz8 avatar Jul 29 '24 04:07 Mauritz8

mauritz mentioned game result is not supported in api. Would this be something worth adding to api if possible? I feel being able to query a win vs loss will have use-case here and possibly elsewhere

Yes it is planned to add more filters later.

veloce avatar Jul 30 '24 07:07 veloce

@Mauritz8 one other request, not sure if you agree.

Before filtering on game type in your pr it says Ivan's games

Currently in beta it'll say total # games. I don't think that total count is visible anywhere else in app so can we have it still say total count before filtering?

ijm8710 avatar Jul 31 '24 19:07 ijm8710

@Mauritz8 one other request, not sure if you agree.

Before filtering on game type in your pr it says Ivan's games

Currently in beta it'll say total # games. I don't think that total count is visible anywhere else in app so can we have it still say total count before filtering?

I'll add it back in.

Mauritz8 avatar Aug 04 '24 12:08 Mauritz8

Thanks again for this!

veloce avatar Aug 05 '24 13:08 veloce

would you be able to add a section for result: won/loss/draw

Not supported in the api yet.

Hi @Mauritz8, I had inquired about win/loss/draw chips for the full game list filtering and at the time, you said api currently didn't support.

This would also include chips for analyzed games, imported games and rated/casual. Plus if you wanted to get a step further, perhaps the full suite of options that web has as advanced filers to sort thru your full game list.

Right now, I was most curious about imported games! As far as I can tell, without it being implemented here, there's no tagging to be able to even get to imported games in the new app.

Do you happen to know if the list afforded by the api changed since to allow for filter by imported (or even the other options mentioned that had not been implemented yet)?

If there needs to be an issue ticket or if I ultimately need to ask Veloce, no worries but since you worked with the api here originally, figured best to start with you since your past work here may give a quick clue if the api has been expanded since the original work.

ijm8710 avatar Jun 26 '25 10:06 ijm8710

From what I can tell there seems to be support for filtering for analyzed games and rated games, but not for win/loss/draw nor imported games.

Mauritz8 avatar Jun 30 '25 15:06 Mauritz8