Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

library: Add Language and Category filters #967

Merged
merged 9 commits into from
Sep 23, 2024
Merged

library: Add Language and Category filters #967

merged 9 commits into from
Sep 23, 2024

Conversation

BharatAtbrat
Copy link
Contributor

@BharatAtbrat BharatAtbrat commented Jul 11, 2024

Initial implementation to add language and category filters for available demos.
Minor issue

  • With the current implementation the Dropdown uses a StringList to store the names of the categories, and Platform APIs as a category only shows demos if the category is named Platform in the string list. Therefore the category in the dropdown is also shown as Platform instead of the ideal Platform APIs
  • Another thing I noticed is when the scroll is at the topmost position (default) it takes two clicks to select the overflowing demo categories.
    Screengrab of it in action:
2024-07-12.01-19-07.mp4

Let me know if there are any issues with the implementation :)

Current state [commit]

2024-07-29.12-30-23.mp4

Initial implementation to add filters for demos
Copy link
Contributor

@sonnyp sonnyp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good start
I merged main into this branch, make sure to git pull

A few points

We shouldn't repeat the languages / categories - you can constructs the GTK from JavaScript

We shouldn't use human strings such as “All Languages” to keep track of the currently selected item. Use the index or some constant.

src/Library/Library.blp Outdated Show resolved Hide resolved
src/Library/Library.js Outdated Show resolved Hide resolved
Set dropdown to flat style
Construct dropdown values from JavaScript
Logic change for filtering, make use of index values instead of
strings
Copy link
Contributor

@andyholmes andyholmes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking good.

I guess based on #510 this will eventually use a list model of demos with a GridView, so the filtering logic can be re-used later with GtkExpressions.

src/Library/Library.js Outdated Show resolved Hide resolved
src/Library/Library.blp Outdated Show resolved Hide resolved
Static maps for all category and Language filter strings
style change for "No results" label
src/Library/Library.js Outdated Show resolved Hide resolved
Copy link
Contributor

@andyholmes andyholmes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@andyholmes andyholmes requested a review from sonnyp August 6, 2024 19:08
@sonnyp sonnyp mentioned this pull request Sep 20, 2024
10 tasks
@sonnyp sonnyp merged commit 7aa97b6 into main Sep 23, 2024
1 check passed
@sonnyp sonnyp deleted the atbrat/addfilters branch September 23, 2024 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants