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

add persistent query and paging #70

Merged
merged 5 commits into from
Nov 23, 2023

Conversation

crsct
Copy link
Collaborator

@crsct crsct commented Nov 14, 2023

closes #45 by adding the base64 encoded query to the url

Copy link
Member

@lukasjelonek lukasjelonek left a comment

Choose a reason for hiding this comment

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

The current code requires only minor changes, but I think it does not implement a robust persistent navigation yet.

  • It is possible to restore the search when reloading or coming from another page, but it is not possible to move back/forward on the history of the search page, e.g. the pagination information is part of the url, but going back to a previous page via the browser back button does not work.

  • Classically search parameters are encoded in the query-part of an url. I propose to do this here as well, instead of having them as a part of the path. It might also be better to have the primitive types in plain text in the url, e.g. /search?offset=0&limit=20&query=<encoded query and ordering>, as this allows manual override for expert users.

src/views/search/SearchView.vue Outdated Show resolved Hide resolved
src/views/search/SearchView.vue Outdated Show resolved Hide resolved
src/views/search/SearchView.vue Outdated Show resolved Hide resolved
src/views/search/SearchView.vue Outdated Show resolved Hide resolved
src/views/search/SearchView.vue Outdated Show resolved Hide resolved
@lukasjelonek
Copy link
Member

I observed the following changes:

  • The search is executed everytime, even on the first page load. Previously it was required that the user presses the search button
  • Everytime the page is reloaded, two search requests are send to the server
  • When the second page is opened and the page is reloaded, it loads the first page
  • When the second page is opened and the back button is used, the second page is reloaded

The network traffic suggests that one of the two requests requests the current page and the other requests the expected page. Getting rid of the first one should eliminate most of the problems stated above.

@lukasjelonek lukasjelonek merged commit 4979df4 into main Nov 23, 2023
1 check passed
@lukasjelonek lukasjelonek deleted the feature/persist-search-query-and-pagination branch November 23, 2023 11:59
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.

Persist the search query and the pagination state on page reload
2 participants