Skip to content

fix(site): display not found page when pagination page is invalid #12611

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

Merged
merged 5 commits into from
Mar 18, 2024

Conversation

BrunoQuaresma
Copy link
Collaborator

Screenshot 2024-03-15 at 11 29 51

Closes #11795

@BrunoQuaresma BrunoQuaresma requested a review from a team March 15, 2024 14:30
@BrunoQuaresma BrunoQuaresma self-assigned this Mar 15, 2024
@BrunoQuaresma BrunoQuaresma requested review from aslilac and removed request for a team March 15, 2024 14:30
@mtojek mtojek self-requested a review March 15, 2024 16:02
Copy link
Member

@mtojek mtojek left a comment

Choose a reason for hiding this comment

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

@BrunoQuaresma Can you implement this accordingly to what we agreed with @mafredri or is it impossible now?

In my fantasy, we'd show a tooltip/banner that this page doesn't exist, but we'd still show the page 85 button as selected, with the ability to select a previous page (that exists).

(post)

@BrunoQuaresma
Copy link
Collaborator Author

@mtojek can you be more specific? In this case, what is missing is the pagination widget right?

@mtojek
Copy link
Member

mtojek commented Mar 15, 2024

Yes, I can. The reason why we implemented the count on the backend side was so the frontend DOES NOT show the 404, but rather renders or goes to the last page.

What I can see here is just "Go to the first page", but the idea is to render the last available page.

@BrunoQuaresma
Copy link
Collaborator Author

Go to the last page would add one redirect and maybe unexpected IMO. What I see other apps doing is a not found error message, wdyt @mafredri ?

@BrunoQuaresma BrunoQuaresma requested a review from mafredri March 15, 2024 16:37
Copy link
Member

@aslilac aslilac left a comment

Choose a reason for hiding this comment

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

one small suggestion for code readability, but I like the look of this! thanks for the change!

@mafredri
Copy link
Member

mafredri commented Mar 15, 2024

Here's how I think about it @BrunoQuaresma.

Imagine the following situation:

  1. Pagination is 10 workspaces / page
  2. There are 31 workspaces (4 pages)
  3. User is on page 4
  4. Someone deletes 11 workspaces
  5. There are now only 20 workspaces (2 pages)
  6. What happens to the user viewing page 4? Keep in mind we refresh workspaces list on such events

As a user, I would like for the pagination to contain [1] [2] [4] where 4 can be highlighted to signify it's selected (and maybe somehow indicate it doesn't exist). The workspace list would also show "no workspaces", similar to a search producing no results.

This way, I can easily recover and choose whether or not I want to go to the first or the last page (1 or 2). Given more pages it could look like [1] ... [10] [11] [12] ... [14] or something like that.

I think encountering a 404 in my described scenario would feel pretty weird and unexpected (since it used to he a page).

@BrunoQuaresma
Copy link
Collaborator Author

@mafredri I see that, I just think redirecting the user to the last page is not usual, at least in other apps, but I'm ok with showing the pagination.

@BrunoQuaresma
Copy link
Collaborator Author

Updated:

Screenshot 2024-03-15 at 15 38 45

Copy link
Member

@mtojek mtojek left a comment

Choose a reason for hiding this comment

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

👍

@BrunoQuaresma BrunoQuaresma merged commit c84d96b into main Mar 18, 2024
@BrunoQuaresma BrunoQuaresma deleted the bq/fix-wrong-page-number branch March 18, 2024 13:36
@github-actions github-actions bot locked and limited conversation to collaborators Mar 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Workspace list shows nothing if page number is too big
4 participants