sqrl-planner / sqrl-client

Frontend web app for Sqrl Planner, a timetable planner for the University of Toronto.
https://sqrlplanner.com
MIT License
17 stars 7 forks source link

[QOL Feature Request] Remember search page number when switching between "Search" & other tabs #87

Closed irinajinli closed 2 years ago

irinajinli commented 2 years ago

Hey! Your app is amazing and I appreciate it so much. I have a QOL suggestion.

Current behaviour:

  1. Search a term that will produce enough results for pagination. Go to the second page of results.
  2. Switch to a different tab (ex. click a course)
  3. Switch back to the Search tab. You will be taken back to the first page of results.

sqrl pages

Not a big problem, but it would be nice if you would be taken back to the original page of search results you were looking at.

eamonma commented 2 years ago

Thanks for the suggestion. We are currently migrating the backend to a different architecture with a much better pagination paradigm, so we will add this when the migration is done.

eamonma commented 2 years ago

For a current implementation, we can lift the state https://github.com/sqrl-planner/sqrl-client/blob/2a3fada70ae108c8afe29b265ecad6e0d5199687/components/sidebar/SearchView/SearchView.tsx#L45 to https://github.com/sqrl-planner/sqrl-client/blob/main/components/sidebar/Sidebar.tsx and pass it as a prop.