Skip to content

Commit

Permalink
Fix overflow in commit graph
Browse files Browse the repository at this point in the history
Limit commit message to 50% width. This is rather crude but should work
for common use cases with not too-long author names.

Fixes: go-gitea#17944
  • Loading branch information
silverwind committed Dec 10, 2021
1 parent 3ca5dc7 commit bdeecdf
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion templates/repo/graph/commits.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
{{- end -}}
</a>
</span>
<span class="message df ac mr-2">{{RenderCommitMessage $commit.Subject $.RepoLink $.Repository.ComposeMetas}}</span>
<span class="message dib ellipsis mr-2">{{RenderCommitMessage $commit.Subject $.RepoLink $.Repository.ComposeMetas}}</span>
<span class="tags df ac">
{{range $commit.Refs}}
{{$refGroup := .RefGroup}}
Expand Down
4 changes: 4 additions & 0 deletions web_src/less/features/gitgraph.less
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@
width: auto;
height: 18px;
}

.message {
max-width: 50%;
}
}

#graph-raw-list {
Expand Down
6 changes: 6 additions & 0 deletions web_src/less/helpers.less
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@
word-wrap: break-word !important;
}

.ellipsis {
overflow: hidden !important;
white-space: nowrap !important;
text-overflow: ellipsis !important;
}

.full-screen-width { width: 100vw !important; }
.full-screen-height { height: 100vh !important; }

Expand Down

0 comments on commit bdeecdf

Please sign in to comment.