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

Scroll collapsed file into view #23702

Merged
merged 8 commits into from
Apr 4, 2023
Merged

Scroll collapsed file into view #23702

merged 8 commits into from
Apr 4, 2023

Conversation

jpraet
Copy link
Member

@jpraet jpraet commented Mar 25, 2023

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:

@jpraet jpraet marked this pull request as ready for review March 25, 2023 19:02
@codecov-commenter
Copy link

codecov-commenter commented Mar 25, 2023

Codecov Report

Merging #23702 (a08b6c1) into main (f521e88) will increase coverage by 0.03%.
The diff coverage is 41.40%.

❗ Current head a08b6c1 differs from pull request most recent head aadecb9. Consider uploading reports for the commit aadecb9 to get more accurate results

@@            Coverage Diff             @@
##             main   #23702      +/-   ##
==========================================
+ Coverage   47.14%   47.18%   +0.03%     
==========================================
  Files        1149     1155       +6     
  Lines      151446   152396     +950     
==========================================
+ Hits        71397    71901     +504     
- Misses      71611    72015     +404     
- Partials     8438     8480      +42     
Impacted Files Coverage Δ
cmd/dump.go 0.66% <0.00%> (-0.01%) ⬇️
cmd/web.go 0.00% <0.00%> (ø)
models/actions/run.go 1.64% <0.00%> (-0.08%) ⬇️
models/actions/runner.go 1.44% <ø> (ø)
models/packages/package.go 45.45% <0.00%> (-1.13%) ⬇️
models/user/search.go 77.50% <0.00%> (-6.29%) ⬇️
modules/actions/workflows.go 0.00% <0.00%> (ø)
modules/context/context.go 64.54% <0.00%> (-3.53%) ⬇️
modules/doctor/storage.go 30.65% <0.00%> (-1.29%) ⬇️
modules/setting/git.go 45.45% <ø> (ø)
... and 37 more

... and 47 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.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Mar 25, 2023
@lunny lunny added the type/bug label Mar 26, 2023
@jpraet jpraet added topic/ui Change the appearance of the Gitea UI outdated/backport/v1.19 This PR should be backported to Gitea 1.19 labels Mar 26, 2023
@silverwind
Copy link
Member

I think this might have a dependency/interaction on #23553, so would wait until that one is in.

jpraet added 2 commits March 30, 2023 18:14
# Conflicts:
#	web_src/css/repository.css
@jpraet
Copy link
Member Author

jpraet commented Mar 30, 2023

I think this might have a dependency/interaction on #23553, so would wait until that one is in.

seems to be OK

@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 Apr 4, 2023
@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 Apr 4, 2023
@lunny lunny merged commit 54197b6 into go-gitea:main Apr 4, 2023
GiteaBot pushed a commit to GiteaBot/gitea that referenced this pull request Apr 4, 2023
@GiteaBot GiteaBot added the backport/done All backports for this PR have been created label Apr 4, 2023
lafriks pushed a commit that referenced this pull request 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>
zjjhot added a commit to zjjhot/gitea that referenced this pull request Apr 5, 2023
* giteaoffical/main:
  Fix image border-radius (go-gitea#23886)
  [skip ci] Updated translations via Crowdin
  Scroll collapsed file into view (go-gitea#23702)
  docs: make the required backticks in email password more explicit (go-gitea#23923)
  docs: fix typo (go-gitea#23924)
  Update docs markdown file weight to make it clear (go-gitea#23909)
  Add activity feeds API (go-gitea#23494)
  Fix code view (diff) broken layout (go-gitea#23096)
  Use ghost user if package creator does not exist (go-gitea#23822)
  Org pages style fixes (go-gitea#23901)
  User/Org Feed render description as per web (go-gitea#23887)
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Aug 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/done All backports for this PR have been created lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. outdated/backport/v1.19 This PR should be backported to Gitea 1.19 topic/ui Change the appearance of the Gitea UI type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

File scrolls out of view when collapsing / marking as viewed via sticky header
5 participants