-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Improve scroll behavior when folding files on pull request "files changed" tab #23604
Conversation
Codecov Report
@@ Coverage Diff @@
## main #23604 +/- ##
==========================================
+ Coverage 47.14% 47.17% +0.02%
==========================================
Files 1149 1154 +5
Lines 151446 152327 +881
==========================================
+ Hits 71397 71854 +457
- Misses 71611 71992 +381
- Partials 8438 8481 +43
... and 38 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
I think behaviour 1. is great. But 2. looks a little odd to me. I think when a user clicks on an UI element and then suddenly that UI element is gone from his view he might be confused. Ideally the filled checkbox of "viewed" would still be directly under the cursor of the user. At least that sounds more intuitive behaviour to me, no? |
85073d8
to
579bd34
Compare
Yes I think so. And I think that means to make them have the same behavior (1st one). Added a commit to change that, please check the update video in description or checkout to try. |
Don't have the time to check it out locally right now but from the video it looks great! Thank you! ❤️ |
There is an alternate ? |
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>
Close #23515
As described in the issue above, right now when "fold file" icon or "viewed" is clicked to fold files, it will scroll to the position before folding, resulting in confusing file jumping when
scrollY
is greater than certain value(approximately theoffsetTop
of current diff file header). This PR is to adjust scrolling behavior when folding the files (no scrolling when expanding the files).Files can be folded in two ways: clicking viewed or clicking "fold file" icon. The folding of these two behaviors will be a little different in this PR(which can be discussed):
scrollY
is greater than current diff file header, scroll to header of the folded file.scrollY
is greater than current diff file header, scroll to next file.File folding behavior after this PR:
default.mov
Update:
Make the behavior the same in both cases(first behavior)
default.mov