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

Let Previous/ Next Button Cycle When There is no Previous/ Next Comment #16317

Closed
delvh opened this issue Jun 30, 2021 · 2 comments · Fixed by #16319
Closed

Let Previous/ Next Button Cycle When There is no Previous/ Next Comment #16317

delvh opened this issue Jun 30, 2021 · 2 comments · Fixed by #16319

Comments

@delvh
Copy link
Member

delvh commented Jun 30, 2021

Description

Currently, the next/ previous button for the next or previous PR comment will be shown regardless whether there actually is a next or previous PR comment. Clicking them in this state simply does nothing.
It would be more intuitive if either these buttons would be disabled or completely removed when no such comment exists.

Another approach would be to circularly link to the next comment, meaning that clicking on previous on the first comment would link to the last comment, and vice versa. This could even be better than disabling them, especially when they are still opened.

Screenshots

image
Currently, the previous button gets displayed even for the first PR comment

@delvh delvh changed the title Disable previous/ next button when there is no previous/ next comment or circular link it Disable Previous/ Next Button When There is no Previous/ Next Comment Jun 30, 2021
@jpraet
Copy link
Member

jpraet commented Jun 30, 2021

Making it wrap around circularly between first and last comment would be easiest.

Review comments can be added and deleted dynamically without a page refresh, so what is at one point the first comment, could become the second comment later on, if you add a new comment above it in the diff. Dynamically toggling the visibility of these buttons could be challenging.

@delvh
Copy link
Member Author

delvh commented Jun 30, 2021

Then I would suggest the circular approach instead of the disabling approach. Also, I can see this to be much easier to implement. In parts, it should even be more user friendly, as it allows to switch in the best case from top to bottom or vice versa instantly, which is definitely needed from time to time.

@delvh delvh changed the title Disable Previous/ Next Button When There is no Previous/ Next Comment Let Previous/ Next Button Cycle When There is no Previous/ Next Comment Jun 30, 2021
jpraet added a commit to jpraet/gitea that referenced this issue Jun 30, 2021
Fixes go-gitea#16317

Wrap around from last to first comment when clicking "Next" on last comment.
Wrap around from first to last comment when clicking "Previous" on first comment.
6543 pushed a commit that referenced this issue Jul 1, 2021
Fixes #16317

Wrap around from last to first comment when clicking "Next" on last comment.
Wrap around from first to last comment when clicking "Previous" on first comment.
AbdulrhmnGhanem pushed a commit to kitspace/gitea that referenced this issue Aug 10, 2021
Fixes go-gitea#16317

Wrap around from last to first comment when clicking "Next" on last comment.
Wrap around from first to last comment when clicking "Previous" on first comment.
@go-gitea go-gitea locked and limited conversation to collaborators Oct 19, 2021
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 a pull request may close this issue.

2 participants