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

Closed
opened 2025-11-02 09:09:53 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @jpraet on GitHub (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

Originally created by @jpraet on GitHub (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](https://user-images.githubusercontent.com/2212615/227718790-b5546f96-f8f7-4adc-a8e6-7f72af5851ce.png) or by marking it as ![image](https://user-images.githubusercontent.com/2212615/227718830-0db9b9cd-3ebc-429d-a7a4-72ad7699e591.png) 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](https://user-images.githubusercontent.com/2212615/227719228-1923230d-cbb9-41d3-b3f6-8f0a074c76ae.png) 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](https://user-images.githubusercontent.com/2212615/227719255-625b4f1b-72b0-4ce1-af1b-37ad08447f37.png) ### 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
GiteaMirror added the topic/uitype/bug labels 2025-11-02 09:09:53 -06:00
Author
Owner

@HesterG commented on GitHub (Mar 27, 2023):

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

@HesterG commented on GitHub (Mar 27, 2023): I think this issue is similar to #23515, and maybe check #23604 to see if this fixed the issue.
Author
Owner

@jpraet commented on GitHub (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: 1a19e6b14e (diff-b94d08b409f9d05fb65b6cccaf7b3e4ecc7cc333)

@jpraet commented on GitHub (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
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#10512