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

fix: Recipe Search Quirks and Session Storage #3541

Merged

Conversation

michael-genson
Copy link
Collaborator

What type of PR is this?

(REQUIRED)

  • bug
  • feature

What this PR does / why we need it:

(REQUIRED)

This fixes a few issues with the recipe search state from #3332. #3332 fixed most issues, but introduced a few smaller ones. This mostly had to do with the search param not updating properly when cleared.

@Kuchenpirat also mentioned in #3332 that persisting state forever seems weird (e.g. if I search for a recipe, then come back to Mealie the next day, I don't really want to see that search again). This moves the search params to session storage so it's cleared when you leave (note: if you just refresh the page it may not look cleared since your query params are there. This behavior is only when navigating back to the home page without query params).

I also refactored a bit and moved default values to an object, since it made some of these changes easier. As a bonus, if we ever implement user-preferred default sorts, this will be very easy to merge in (just load the defaults).

Which issue(s) this PR fixes:

(REQUIRED)

N/A, I'm a little surprised no one's opened an issue for the search being wonky.

Special notes for your reviewer:

(fill-in or delete this section)

Testing

(fill-in or delete this section)

Manually poked around the search a lot.

@Kuchenpirat Kuchenpirat self-assigned this May 6, 2024
Copy link
Collaborator

@Kuchenpirat Kuchenpirat left a comment

Choose a reason for hiding this comment

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

LGTM 👍
Never really realised some search quirks were annoying but this feels quite a bit more polished 🧹

@Kuchenpirat Kuchenpirat enabled auto-merge (squash) May 6, 2024 14:56
@Kuchenpirat Kuchenpirat merged commit 418a8ec into mealie-recipes:mealie-next May 6, 2024
10 checks passed
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.

None yet

3 participants