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

Changing sort order of search results table reloads page and resets search query text #1005

Closed
corneliusroemer opened this issue Feb 12, 2024 · 10 comments
Labels
website Tasks related to the web application
Milestone

Comments

@corneliusroemer
Copy link
Contributor

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

@corneliusroemer corneliusroemer added the website Tasks related to the web application label Feb 12, 2024
@chaoran-chen
Copy link
Member

Maybe we can use Astro's new transition API: https://astro.build/blog/astro-4/#new-view-transition-apis (but definitely post-MVP)

@chaoran-chen chaoran-chen added this to the post-MVP priorities milestone Feb 12, 2024
@chaoran-chen chaoran-chen moved this to Backlog in Planning Feb 12, 2024
@theosanderson
Copy link
Member

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

@chaoran-chen
Copy link
Member

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.

@corneliusroemer
Copy link
Contributor Author

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

@theosanderson
Copy link
Member

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)

@corneliusroemer corneliusroemer mentioned this issue Feb 12, 2024
2 tasks
@corneliusroemer
Copy link
Contributor Author

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?

No, I don't think that concern re POST is true. It should be persisted.

@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.

2024-02-12 22 22 13

@theosanderson
Copy link
Member

Huh thanks, sorry to have the wrong instinct there – will look into it

@theosanderson
Copy link
Member

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)

@github-project-automation github-project-automation bot moved this from Backlog to Done in Planning Feb 13, 2024
@corneliusroemer
Copy link
Contributor Author

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

@theosanderson
Copy link
Member

There's lots of those on the site elsewhere too :) I don't think fixing them is incompatible with a MPA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
website Tasks related to the web application
Projects
Archived in project
Development

No branches or pull requests

3 participants