Skip to content

Fix blame row height alignment #15863

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

Merged
merged 5 commits into from
May 15, 2021

Conversation

noerw
Copy link
Member

@noerw noerw commented May 13, 2021

fixes #15858 (check there for a screenshot)

I'm not a CSS guru, so my approach may be suboptimal:
We ensure all rows have at least 20px height, and .bottom-line rows get 21px, to reproduce in .lines-commit what was already configured in for the code view.

I tested in current FF and chromium, would be nice if someone could test on Safari as well.

@noerw noerw added type/bug topic/ui Change the appearance of the Gitea UI labels May 13, 2021
@noerw noerw added this to the 1.15.0 milestone May 13, 2021
@silverwind
Copy link
Member

silverwind commented May 14, 2021

I think this is the third time now that this alignment broke. Blame should really be refactored to be line-based and not two columns side-by-side, but I guess we can workaround for now by manually aligning again.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label May 14, 2021
@silverwind
Copy link
Member

silverwind commented May 14, 2021

Tested, working, except Safari which needs one additional fix to prevent line wrapping breaking the alignment:

diff --git a/web_src/less/_base.less b/web_src/less/_base.less
index e44e2ab84..c3a7f6ca2 100644
--- a/web_src/less/_base.less
+++ b/web_src/less/_base.less
@@ -1503,8 +1503,9 @@ a.ui.label:hover {

 .blame .code-inner {
   white-space: pre;
   word-break: normal;
+  word-wrap: normal; /* not using overflow-wrap because safari does not treat is an an alias */
 }

 .lines-commit {
   vertical-align: top;

Normally overflow-wrap should be an alias to the deprecated word-wrap but I could only get it to work using word-wrap.

@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 May 14, 2021
@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 May 14, 2021
@codecov-commenter
Copy link

codecov-commenter commented May 15, 2021

Codecov Report

Merging #15863 (ba9afda) into main (1a56599) will decrease coverage by 0.00%.
The diff coverage is 30.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #15863      +/-   ##
==========================================
- Coverage   44.00%   44.00%   -0.01%     
==========================================
  Files         681      681              
  Lines       82257    82270      +13     
==========================================
+ Hits        36199    36201       +2     
- Misses      40150    40161      +11     
  Partials     5908     5908              
Impacted Files Coverage Δ
cmd/web_letsencrypt.go 0.00% <0.00%> (ø)
modules/git/pipeline/lfs_nogogit.go 0.00% <0.00%> (ø)
modules/migrations/gitea_uploader.go 7.47% <0.00%> (-0.02%) ⬇️
routers/admin/repos.go 0.00% <0.00%> (ø)
routers/api/v1/repo/repo.go 57.71% <0.00%> (-0.28%) ⬇️
modules/git/batch_reader.go 53.75% <100.00%> (ø)
modules/git/commit_info_nogogit.go 68.09% <100.00%> (ø)
routers/repo/setting.go 13.61% <100.00%> (+0.25%) ⬆️
modules/process/manager.go 72.83% <0.00%> (-2.47%) ⬇️
modules/queue/workerpool.go 51.64% <0.00%> (-1.10%) ⬇️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f3febeb...ba9afda. Read the comment docs.

@techknowlogick techknowlogick merged commit b6b8b19 into go-gitea:main May 15, 2021
@zeripath
Copy link
Contributor

I think we need a backport of this to 1.14 too.

@silverwind
Copy link
Member

Yeah looks like it.

noerw added a commit to noerw/gitea that referenced this pull request May 15, 2021
* fix blame row alignment on firefox
* fix blame row alignment in chrome
* fix blame row alignment in safari

Co-authored-by: techknowlogick <[email protected]>
@noerw noerw added the backport/done All backports for this PR have been created label May 15, 2021
@noerw noerw deleted the fix-15858-blame-height branch May 15, 2021 13:40
6543 pushed a commit that referenced this pull request May 15, 2021
* fix blame row alignment on firefox
* fix blame row alignment in chrome
* fix blame row alignment in safari

Co-authored-by: techknowlogick <[email protected]>
AbdulrhmnGhanem pushed a commit to kitspace/gitea that referenced this pull request Aug 10, 2021
* fix blame row alignment on firefox

* fix blame row alignment in chrome

* fix blame row alignment in safari

as per @silverwind

Co-authored-by: techknowlogick <[email protected]>
@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
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. topic/ui Change the appearance of the Gitea UI type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Display problem in blame
6 participants