Skip to content

fixed incorrect page navigation with up and down arrow on last item of dashboard repos #34570

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 3 commits into from
Jun 3, 2025

Conversation

metiftikci
Copy link
Member

@metiftikci metiftikci commented May 30, 2025

Previously, pressing the down arrow key on the last item of a list would incorrectly load the latest page when not release key. This commit corrects the logic to ensure that the next page is loaded as intended.

After the fix:

after

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label May 30, 2025
@lunny lunny added type/bug backport/v1.24 This PR should be backported to Gitea 1.24 labels May 30, 2025
@lunny
Copy link
Member

lunny commented Jun 1, 2025

Is the screenshot the previous one or updated one?

@metiftikci
Copy link
Member Author

yes its after. before cant see second page but last page if not release the key

@lunny
Copy link
Member

lunny commented Jun 2, 2025

I couldn't reproduce it. The old logic does work for me.

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jun 2, 2025
@metiftikci

This comment was marked as resolved.

@metiftikci
Copy link
Member Author

metiftikci commented Jun 2, 2025

@wxiaoguang can you please review again, i fixed the up arrow key also.

the problem for up arrow key is, this line works before the fetch repos. repos.count is 0 and it sets the index to 0 again and request for previous page again, so never shows pages between first and last pages

if (this.activeIndex === -1 || this.activeIndex > this.repos.length - 1) {
this.activeIndex = 0;
}

@metiftikci metiftikci changed the title fixed incorrect page navigation with down arrow on last item fixed incorrect page navigation with up and down arrow on last item of dashboard repos Jun 2, 2025
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jun 3, 2025
@wxiaoguang
Copy link
Contributor

Actually it will be quite complex to make the logic completely right here.

For example: this PR fixes some problems, but I think it introduces new problems:

  • If a previous "loading" is slow (due to network problems), then clicking a new page won't start the new loading, the user just gets stuck on current page.

@metiftikci
Copy link
Member Author

@wxiaoguang you are right okey i will look for better solution

@metiftikci metiftikci marked this pull request as draft June 3, 2025 09:25
@metiftikci metiftikci marked this pull request as ready for review June 3, 2025 17:26
@metiftikci
Copy link
Member Author

@wxiaoguang looked again but it looks like slow network or stuck in loading state is not a concern

because in loading state we do not show buttons or repos, user can change tab or input search text which is changeReposFilter function and this change does not block this function on loading state

image

@wxiaoguang wxiaoguang enabled auto-merge (squash) June 3, 2025 17:53
@wxiaoguang wxiaoguang merged commit fe57ee3 into go-gitea:main Jun 3, 2025
26 checks passed
@GiteaBot GiteaBot added this to the 1.25.0 milestone Jun 3, 2025
GiteaBot pushed a commit to GiteaBot/gitea that referenced this pull request Jun 3, 2025
…f dashboard repos (go-gitea#34570)

Previously, pressing the down arrow key on the last item of a list would
incorrectly load the latest page when not release key. This commit
corrects the logic to ensure that the next page is loaded as intended.
@GiteaBot GiteaBot added the backport/done All backports for this PR have been created label Jun 3, 2025
wxiaoguang pushed a commit that referenced this pull request Jun 3, 2025
…f dashboard repos (#34570) (#34596)

Backport #34570 by metiftikci

Co-authored-by: metiftikci <[email protected]>
zjjhot added a commit to zjjhot/gitea that referenced this pull request Jun 4, 2025
* giteaofficial/main:
  Fix issue label delete incorrect labels webhook payload (go-gitea#34575)
  fixed incorrect page navigation with up and down arrow on last item of dashboard repos (go-gitea#34570)
  Remove unnecessary duplicate code (go-gitea#34552)
  Make pull request and issue history more compact (go-gitea#34588)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/done All backports for this PR have been created backport/v1.24 This PR should be backported to Gitea 1.24 lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/frontend type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants