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

File scrolls out of view when collapsing / marking as viewed via sticky header #23701

Closed
jpraet opened this issue Mar 25, 2023 · 2 comments · Fixed by #23702
Closed

File scrolls out of view when collapsing / marking as viewed via sticky header #23701

jpraet opened this issue Mar 25, 2023 · 2 comments · Fixed by #23702
Labels
topic/ui Change the appearance of the Gitea UI type/bug

Comments

@jpraet
Copy link
Member

jpraet commented Mar 25, 2023

Description

When you are reviewing a file, scrolling down to the end of the file, and then collapsing it via the image or by marking it as image in the sticky header, the file scrolls out of view and you end up somewhere further on in another file of the diff.

https://try.gitea.io/jpraet/test/pulls/13/files

Screenshots

when I click "viewed" here on the first file:
image

It disappears out of view and I end up somewhere near the end of the 2nd file, and need to scroll back up to review that 2nd file.

image

Gitea Version

1.20.0+dev-265-gc5cfc0855

Can you reproduce the bug on the Gitea demo site?

Yes

Operating System

No response

Browser Version

Firefox 102.8.0.esr

@jpraet jpraet added type/bug topic/ui Change the appearance of the Gitea UI labels Mar 25, 2023
jpraet added a commit to jpraet/gitea that referenced this issue Mar 25, 2023
@HesterG
Copy link
Contributor

HesterG commented Mar 27, 2023

I think this issue is similar to #23515, and maybe check #23604 to see if this fixed the issue.

@jpraet
Copy link
Member Author

jpraet commented Mar 27, 2023

I think this issue is similar to #23515, and maybe check #23604 to see if this fixed the issue.

Indeed, it's the same issue. The CSS scroll-margin-top solution on #23702 also takes care of direct links to files in a diff.

On the PR diff, this currently shows the previous file first: https://try.gitea.io/jpraet/test/pulls/13/files#diff-b94d08b409f9d05fb65b6cccaf7b3e4ecc7cc333

On the commit diff, the first line of the linked file is currently under the sticky header: https://try.gitea.io/jpraet/test/commit/1a19e6b14e31d295b7372f3346580c3e85690ff5#diff-b94d08b409f9d05fb65b6cccaf7b3e4ecc7cc333

jpraet added a commit to jpraet/gitea that referenced this issue Mar 30, 2023
# Conflicts:
#	web_src/css/repository.css
silverwind added a commit to jpraet/gitea that referenced this issue Apr 4, 2023
lafriks pushed a commit that referenced this issue Apr 5, 2023
Backport #23702 by @jpraet

Fixes #23701, #23515.

Alternate approach to #23604 using CSS scroll-margin-top, which is also
taken into account for direct links to files in a diff:

* On the PR diff, this currently shows the previous file first:
https://try.gitea.io/jpraet/test/pulls/13/files#diff-b94d08b409f9d05fb65b6cccaf7b3e4ecc7cc333
* On the commit diff, the first line of the linked file is currently
under the sticky header:
https://try.gitea.io/jpraet/test/commit/1a19e6b14e31d295b7372f3346580c3e85690ff5#diff-b94d08b409f9d05fb65b6cccaf7b3e4ecc7cc333

Co-authored-by: Jimmy Praet <jimmy.praet@ksz-bcss.fgov.be>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
topic/ui Change the appearance of the Gitea UI type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants