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

Refactor/rework recipe list filter #2037

Merged
merged 47 commits into from
Jan 10, 2024

Conversation

seyfeb
Copy link
Collaborator

@seyfeb seyfeb commented Jan 2, 2024

Topic and Scope

Considering issues like #253, which request more options for filtering recipes by different properties, the large keyword cloud does not seem to provide the best UI when mixed with additional ways to filter along different vectors. To create a more unified and extensible filter experience I reworked the current UX.

The new UI

  • allows filtering by recipe name, category, and keywords
  • allows selecting if the resulting recipes should match all or any of the selected categories or keywords
    • default is to show recipes "matching any category" and "matching all keywords"
  • allows applying all filters at the same time
  • allows sorting the results
  • allows clearing the filters
  • instantly updates results on desktop and updates results after confirming the selected filters in a full-screen modal on mobile devices

The categories filter is only shown, when no category is selected.

Caveats, features and other noteworthy changes

  • for name, keywords, and recipeCategory both single string and an array of strings is supported, even though the cookbook app currently only supports a single name and category.
    • The ORfiltering for categories therefore currently makes not too much sense
  • Filtering is still done in the frontend on the recipe list obtained from the backend
  • The recipe name is filtered via a fuzzy search using the fuse.js library
  • Jest is added for testing JS code, but there it is not included in the CI pipeline yet
  • The keyword-cloud setting has been replaced by a setting for displaying sorting and filters

Impressions

Mobile devices

Desktop

cookbook_new_filter.mov

Formal requirements

There are some formal requirements that should be satisfied. Please mark those by checking the corresponding box.

  • I did check that the app can still be opened and does not throw any browser logs
  • I created tests for newly added PHP code (check this if no PHP changes were made)
  • I updated the OpenAPI specs and added an entry to the API changelog (check if API was not modified)
  • I notified the matrix channel if I introduced an API change

@seyfeb seyfeb added javascript Pull requests that update Javascript code Frontend Issue or PR related to the frontend code labels Jan 2, 2024
@seyfeb seyfeb requested a review from christianlupus January 2, 2024 22:20
Copy link

codecov bot commented Jan 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (c55a175) 80.07% compared to head (7ea8520) 80.07%.
Report is 1 commits behind head on master.

❗ Current head 7ea8520 differs from pull request most recent head 3d73d73. Consider uploading reports for the commit 3d73d73 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2037   +/-   ##
=======================================
  Coverage   80.07%   80.07%           
=======================================
  Files          92       92           
  Lines        2650     2650           
=======================================
  Hits         2122     2122           
  Misses        528      528           
Flag Coverage Δ
integration 21.43% <ø> (ø)
migration 5.69% <ø> (ø)
unittests 57.09% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Copy link

github-actions bot commented Jan 2, 2024

Test Results

   12 files    572 suites   1m 31s ⏱️
  552 tests   552 ✅ 0 💤 0 ❌
2 208 runs  2 207 ✅ 1 💤 0 ❌

Results for commit 7ea8520.

♻️ This comment has been updated with latest results.

@seyfeb seyfeb force-pushed the refactor/rework-recipe-list-filter branch from febd21d to a66e2e6 Compare January 4, 2024 09:42
Signed-off-by: Sebastian Fey <info@sebastianfey.de>
Signed-off-by: Sebastian Fey <info@sebastianfey.de>
Signed-off-by: Sebastian Fey <info@sebastianfey.de>
…f recipes

Signed-off-by: Sebastian Fey <info@sebastianfey.de>
@christianlupus christianlupus force-pushed the refactor/rework-recipe-list-filter branch 3 times, most recently from a6b2008 to 7ea8520 Compare January 10, 2024 20:09
seyfeb and others added 16 commits January 10, 2024 21:27
Signed-off-by: Sebastian Fey <info@sebastianfey.de>
Signed-off-by: Christian Wolf <github@christianwolf.email>
Signed-off-by: Sebastian Fey <info@sebastianfey.de>
Signed-off-by: Sebastian Fey <info@sebastianfey.de>
Signed-off-by: Sebastian Fey <info@sebastianfey.de>
…name filters. Support arrays in name filter

Signed-off-by: Sebastian Fey <info@sebastianfey.de>
Signed-off-by: Sebastian Fey <info@sebastianfey.de>
…ers export

Signed-off-by: Sebastian Fey <info@sebastianfey.de>
Signed-off-by: Sebastian Fey <info@sebastianfey.de>
…value is not defined on recipe

Signed-off-by: Sebastian Fey <info@sebastianfey.de>
Signed-off-by: Sebastian Fey <info@sebastianfey.de>
…KeywordsFilter` can handle this now. Also add tests for this.

Signed-off-by: Sebastian Fey <info@sebastianfey.de>
Signed-off-by: Sebastian Fey <info@sebastianfey.de>
Signed-off-by: Sebastian Fey <info@sebastianfey.de>
Signed-off-by: Sebastian Fey <info@sebastianfey.de>

Signed-off-by: Sebastian Fey <info@sebastianfey.de>
…t to OR for categories filter. Update tests.

Signed-off-by: Sebastian Fey <info@sebastianfey.de>
Signed-off-by: Sebastian Fey <info@sebastianfey.de>
seyfeb and others added 25 commits January 10, 2024 21:28
Signed-off-by: Sebastian Fey <info@sebastianfey.de>
Signed-off-by: Sebastian Fey <info@sebastianfey.de>
Signed-off-by: Sebastian Fey <info@sebastianfey.de>
…ory and keywords selection displaying no. of selected items

Signed-off-by: Sebastian Fey <info@sebastianfey.de>
…isplaying no. of selected items

Signed-off-by: Sebastian Fey <info@sebastianfey.de>
Signed-off-by: Sebastian Fey <info@sebastianfey.de>
Signed-off-by: Sebastian Fey <info@sebastianfey.de>
Signed-off-by: Sebastian Fey <info@sebastianfey.de>
Signed-off-by: Sebastian Fey <info@sebastianfey.de>
… keyword filter. Add AND/OR operator selectors for keywords and categories to inline filter controls

Signed-off-by: Sebastian Fey <info@sebastianfey.de>
Signed-off-by: Sebastian Fey <info@sebastianfey.de>
… selection modal.

Signed-off-by: Sebastian Fey <info@sebastianfey.de>
Signed-off-by: Sebastian Fey <info@sebastianfey.de>
Signed-off-by: Sebastian Fey <info@sebastianfey.de>
Signed-off-by: Sebastian Fey <info@sebastianfey.de>
Signed-off-by: Sebastian Fey <info@sebastianfey.de>
Signed-off-by: Sebastian Fey <info@sebastianfey.de>
Signed-off-by: Sebastian Fey <info@sebastianfey.de>
Signed-off-by: Sebastian Fey <info@sebastianfey.de>
Signed-off-by: Christian Wolf <github@christianwolf.email>
… setting to display sorting and filters

Signed-off-by: Sebastian Fey <info@sebastianfey.de>
…settings

Signed-off-by: Sebastian Fey <info@sebastianfey.de>
Signed-off-by: Christian Wolf <github@christianwolf.email>
Signed-off-by: Christian Wolf <github@christianwolf.email>
Signed-off-by: Christian Wolf <github@christianwolf.email>
Signed-off-by: Christian Wolf <github@christianwolf.email>
@christianlupus christianlupus force-pushed the refactor/rework-recipe-list-filter branch from 7ea8520 to 3d73d73 Compare January 10, 2024 20:28
@christianlupus christianlupus merged commit a71cc8d into master Jan 10, 2024
26 of 27 checks passed
@christianlupus christianlupus deleted the refactor/rework-recipe-list-filter branch January 10, 2024 20:33
@christianlupus christianlupus added the manual-backport-required The backpoort needs to be carried out manually. label Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Frontend Issue or PR related to the frontend code javascript Pull requests that update Javascript code manual-backport-required The backpoort needs to be carried out manually.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants