Skip to content

Commit 94048f3

Browse files
fix toggle commit body button ui when latest commit message is long (#32997)
#### Before ![before](https://github.com/user-attachments/assets/fe36bdb3-10e8-4fe7-9106-0897f49bedb3) #### After ![after](https://github.com/user-attachments/assets/745bd164-5f25-41ca-b340-36cb695551db) ## Edit: I found an issue on mobile view and changed the code as using flex gap ![small](https://github.com/user-attachments/assets/dd7c2093-6860-4800-a2bc-676a03e764c8) ![large](https://github.com/user-attachments/assets/5c933779-8281-4d48-9fd0-4d7b245bf4ac) --------- Co-authored-by: wxiaoguang <[email protected]>
1 parent a92f505 commit 94048f3

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

templates/repo/commit_statuses.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{{if .Statuses}}
22
{{if and (eq (len .Statuses) 1) .Status.TargetURL}}
3-
<a class="tw-align-middle {{.AdditionalClasses}} tw-no-underline" data-tippy="commit-statuses" href="{{.Status.TargetURL}}">
3+
<a class="flex-text-inline tw-no-underline {{.AdditionalClasses}}" data-tippy="commit-statuses" href="{{.Status.TargetURL}}">
44
{{template "repo/commit_status" .Status}}
55
</a>
66
{{else}}
7-
<span class="tw-align-middle {{.AdditionalClasses}}" data-tippy="commit-statuses" tabindex="0">
7+
<span class="flex-text-inline {{.AdditionalClasses}}" data-tippy="commit-statuses" tabindex="0">
88
{{template "repo/commit_status" .Status}}
99
</span>
1010
{{end}}

templates/repo/latest_commit.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
44
{{else}}
55
{{if .LatestCommitUser}}
6-
{{ctx.AvatarUtils.Avatar .LatestCommitUser 24 "tw-mr-1"}}
6+
{{ctx.AvatarUtils.Avatar .LatestCommitUser 24}}
77
{{if and .LatestCommitUser.FullName DefaultShowFullName}}
88
<a class="muted author-wrapper" title="{{.LatestCommitUser.FullName}}" href="{{.LatestCommitUser.HomeLink}}"><strong>{{.LatestCommitUser.FullName}}</strong></a>
99
{{else}}
1010
<a class="muted author-wrapper" title="{{if .LatestCommit.Author}}{{.LatestCommit.Author.Name}}{{else}}{{.LatestCommitUser.Name}}{{end}}" href="{{.LatestCommitUser.HomeLink}}"><strong>{{if .LatestCommit.Author}}{{.LatestCommit.Author.Name}}{{else}}{{.LatestCommitUser.Name}}{{end}}</strong></a>
1111
{{end}}
1212
{{else}}
1313
{{if .LatestCommit.Author}}
14-
{{ctx.AvatarUtils.AvatarByEmail .LatestCommit.Author.Email .LatestCommit.Author.Name 24 "tw-mr-1"}}
14+
{{ctx.AvatarUtils.AvatarByEmail .LatestCommit.Author.Email .LatestCommit.Author.Name 24}}
1515
<span class="author-wrapper" title="{{.LatestCommit.Author.Name}}"><strong>{{.LatestCommit.Author.Name}}</strong></span>
1616
{{end}}
1717
{{end}}

web_src/css/repo.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,12 @@ td .commit-summary {
123123
gap: 0.25em;
124124
}
125125

126+
@media (max-width: 767.98px) {
127+
.latest-commit .commit-id-short {
128+
display: none;
129+
}
130+
}
131+
126132
.repo-path {
127133
display: flex;
128134
overflow-wrap: anywhere;
@@ -1670,6 +1676,10 @@ tbody.commit-list {
16701676
white-space: nowrap;
16711677
}
16721678

1679+
.latest-commit .message-wrapper {
1680+
max-width: calc(100% - 2.5rem);
1681+
}
1682+
16731683
/* in the commit list, messages can wrap so we can use inline */
16741684
.commit-list .message-wrapper {
16751685
display: inline;

0 commit comments

Comments
 (0)