rommapp / romm

A beautiful, powerful, self-hosted rom manager and player.
https://romm.app
GNU Affero General Public License v3.0
3.08k stars 128 forks source link

[ROMM-1503] Remember search query when going back to page #1514

Closed gantoine closed 2 weeks ago

gantoine commented 2 weeks ago

Store the query in the URL as a query param, and use it on search page load to prepopulate the results

Fixes #1503

zurdi15 commented 2 weeks ago

Shouldn't it better to just store the roms fetched by the search in a store like we do with the platforms and collections so the results will be there until another search happens? Also, the searched term can be stored in a pinia store and just show it each time the user visits the search view.

Apart from that, I should keep the url query params since that will allow to share or bookmark searches as URLs

gantoine commented 2 weeks ago

Shouldn't it better to just store the roms fetched by the search in a store like we do with the platforms and collections so the results will be there until another search happens?

Yes that would be good, but more work then what I've done here IMO

Also, the searched term can be stored in a pinia store and just show it each time the user visits the search view.

That I'm not sure about, having two sources of truth (pinia store + url query param) would cause issues. i was just dealing with something similar at work a couple weeks ago, but with x-state and query params lol