-
Notifications
You must be signed in to change notification settings - Fork 2
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
Changing sort order of search results table reloads page and resets search query text #1005
Comments
Maybe we can use Astro's new transition API: https://astro.build/blog/astro-4/#new-view-transition-apis (but definitely post-MVP) |
The search text deletion is maybe worth thinking about pre-MVP. We should check I didn't accidentally break this with my changes to search |
I don't think you broke anything. On main, if you perform a search and then sort the table, the search values are persisted. @corneliusroemer, please note that we have decided to use a multi-page application (MPA) framework and not a single-page application (SPA) (see original discussion, "SPA vs. MPA") which by default means every navigation reloads the page. In this case, changing the order changes the URL, thus, is a navigation event. The search results are fetched and the table rendered only on the server side. |
Yep it's persisted when you execute the search. It's just quite against common user intuition (with modern websites) that sorting a table reloads the whole thing and eradicates everything that's not persisted in the url. One extra downside of this is that in the post query case of Theo the page might come back with the entire search query wiped. Is that true? I'll get used to it 😃 Not a big deal |
No, I don't think that concern re POST is true. It should be persisted. It will be good to hear what the beta testers think – (I don't think it's unintuitive, but let's see) |
@theosanderson I tested it with your helpful test deployment #1002 and it turns out that the search does get wiped (as I thought) - though this might be fixable of course. |
Huh thanks, sorry to have the wrong instinct there – will look into it |
IMO this is mostly resolved for now either by the discussion above or by my eventual realisation that the last point is already fixed (#1016) |
Semi-fixed :) there's still a lot of layout shift which wouldn't occur in SPA and which might be avoidable at some point in the far future - will open issue for that |
There's lots of those on the site elsewhere too :) I don't think fixing them is incompatible with a MPA |
I was surprised to see that when changed the search results sorting on the main page, it reloaded the whole page.
In itself that was just a bit odd and causing unnecessary animations (e.g. buttons changing size). But I discovered that this also causes any text entered in the search fields to be deleted, which is definitely not desirable.
I would expect only the search results part of the page to change upon clicking the sort button, not the whole page.
See demo:
![2024-02-12 18 58 37](https://private-user-images.githubusercontent.com/25161793/304180414-51818283-1f8f-4a59-a288-900295c82d97.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg4ODk5MjIsIm5iZiI6MTczODg4OTYyMiwicGF0aCI6Ii8yNTE2MTc5My8zMDQxODA0MTQtNTE4MTgyODMtMWY4Zi00YTU5LWEyODgtOTAwMjk1YzgyZDk3LmdpZj9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA3VDAwNTM0MlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWE0MGJhOTk5MDJjYTBjMjljMmY0NWI2MGMyZWE3NDU3NzY2MWEwMjE4ZjhhNDE4MmI2ODJjZDFlNjJkZjEzYWYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.aHiGGug-xo27C2x_oSnynpUnKAYKpU_NN-s81EJM6iQ)
The text was updated successfully, but these errors were encountered: