Skip to content

Commit 2ed21e7

Browse files
gary-kimlunny
authored andcommitted
Prevent Commit Status and Message From Overflowing On Branch Page (#7800)
* Prevent Commit Status From Overflowing On Branch Page It is possible for the commit ci status on the branches page for a repository to become an ellipsis due to overflowing. This commit will fix that issue by using flex. Signed-off-by: Gary Kim <[email protected]> * Fix multiple overflowing issues in commits table It was possible that the commit message would overflow hiding the expand commits button and commit status. This change ensures that the correct elements overflow without hiding anything else. This change also reverts using flex in the commits list because it was causing issues in Blink based browsers. Signed-off-by: Gary Kim <[email protected]> * Remove unnecessary html element and fix indentation issues
1 parent 2b6f452 commit 2ed21e7

File tree

3 files changed

+19
-12
lines changed

3 files changed

+19
-12
lines changed

public/css/index.css

+3-2
Original file line numberDiff line numberDiff line change
@@ -632,6 +632,7 @@ footer .ui.left,footer .ui.right{line-height:40px}
632632
.repository #commits-table thead .sha{width:140px}
633633
.repository #commits-table thead .shatd{text-align:center}
634634
.repository #commits-table td.sha .sha.label{margin:0}
635+
.repository #commits-table td.message{text-overflow:unset}
635636
.repository #commits-table.ui.basic.striped.table tbody tr:nth-child(2n){background-color:rgba(0,0,0,.02)!important}
636637
.repository #commits-table td.sha .sha.label,.repository #repo-files-table .sha.label{border:1px solid #bbb}
637638
.repository #commits-table td.sha .sha.label .detail.icon,.repository #repo-files-table .sha.label .detail.icon{background:#fafafa;margin:-6px -10px -4px 0;padding:5px 3px 5px 6px;border-left:1px solid #bbb;border-top-left-radius:0;border-bottom-left-radius:0}
@@ -825,8 +826,8 @@ footer .ui.left,footer .ui.right{line-height:40px}
825826
.stats-table .table-cell{display:table-cell}
826827
.stats-table .table-cell.tiny{height:.5em}
827828
tbody.commit-list{vertical-align:baseline}
828-
.commit-list .message-wrapper{overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 24px);display:inline-block;vertical-align:middle}
829-
.commit-list .message-wrapper .commit-status-link{display:inline-block;vertical-align:middle}
829+
.commit-list .message-wrapper{overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 50px);display:inline-block;vertical-align:middle}
830+
.commit-list .commit-status-link{display:inline-block;vertical-align:middle}
830831
.commit-body{white-space:pre-wrap}
831832
.git-notes.top{text-align:left}
832833
.git-notes .commit-body{margin:0}

public/less/_repository.less

+6-2
Original file line numberDiff line numberDiff line change
@@ -1156,6 +1156,10 @@
11561156
margin: 0;
11571157
}
11581158

1159+
td.message {
1160+
text-overflow: unset;
1161+
}
1162+
11591163
&.ui.basic.striped.table tbody tr:nth-child(2n) {
11601164
background-color: rgba(0, 0, 0, 0.02) !important;
11611165
}
@@ -2172,12 +2176,12 @@ tbody.commit-list {
21722176
.commit-list .message-wrapper {
21732177
overflow: hidden;
21742178
text-overflow: ellipsis;
2175-
max-width: calc(100% - 24px);
2179+
max-width: calc(100% - 50px);
21762180
display: inline-block;
21772181
vertical-align: middle;
21782182
}
21792183

2180-
.commit-list .message-wrapper .commit-status-link {
2184+
.commit-list .commit-status-link {
21812185
display: inline-block;
21822186
vertical-align: middle;
21832187
}

templates/repo/commits_table.tmpl

+10-8
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@
4646
<tr>
4747
<td class="author">
4848
{{if .User}}
49-
{{if .User.FullName}}
49+
{{if .User.FullName}}
5050
<img class="ui avatar image" src="{{.User.RelAvatarLink}}" alt=""/>&nbsp;&nbsp;<a href="{{AppSubUrl}}/{{.User.Name}}">{{.User.FullName}}</a>
51-
{{else}}
51+
{{else}}
5252
<img class="ui avatar image" src="{{.User.RelAvatarLink}}" alt=""/>&nbsp;&nbsp;<a href="{{AppSubUrl}}/{{.User.Name}}">{{.Author.Name}}</a>
53-
{{end}}
53+
{{end}}
5454
{{else}}
5555
<img class="ui avatar image" src="{{AvatarLink .Author.Email}}" alt=""/>&nbsp;&nbsp;{{.Author.Name}}
5656
{{end}}
@@ -71,13 +71,15 @@
7171
</td>
7272
<td class="message">
7373
<span class="message-wrapper">
74-
<span class="commit-summary has-emoji{{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{.Summary}}</span>
75-
{{if IsMultilineCommitMessage .Message}}
76-
<button class="basic compact mini ui icon button commit-button"><i class="ellipsis horizontal icon"></i></button>
77-
<pre class="commit-body" style="display: none;">{{RenderCommitBody .Message $.RepoLink $.Repository.ComposeMetas}}</pre>
78-
{{end}}
74+
<span class="commit-summary has-emoji{{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{.Summary}}</span>
7975
</span>
76+
{{if IsMultilineCommitMessage .Message}}
77+
<button class="basic compact mini ui icon button commit-button"><i class="ellipsis horizontal icon"></i></button>
78+
{{end}}
8079
{{template "repo/commit_status" .Status}}
80+
{{if IsMultilineCommitMessage .Message}}
81+
<pre class="commit-body" style="display: none;">{{RenderCommitBody .Message $.RepoLink $.Repository.ComposeMetas}}</pre>
82+
{{end}}
8183
</td>
8284
<td class="grey text right aligned">{{TimeSince .Author.When $.Lang}}</td>
8385
</tr>

0 commit comments

Comments
 (0)