Skip to content

Commit

Permalink
Fix some UI regressions for commit list (#30920) (#30937)
Browse files Browse the repository at this point in the history
Backport #30920 by wxiaoguang

Close #30919

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
  • Loading branch information
3 people committed May 10, 2024
1 parent b99473f commit 94c5a30
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
14 changes: 9 additions & 5 deletions templates/repo/commits_list_small.tmpl
Expand Up @@ -13,13 +13,12 @@

{{$commitLink:= printf "%s/commit/%s" $.comment.Issue.PullRequest.BaseRepo.Link (PathEscape .ID.String)}}

<span class="tw-flex-1 gt-ellipsis tw-font-mono{{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{RenderCommitMessageLinkSubject $.root.Context .Message $commitLink ($.comment.Issue.PullRequest.BaseRepo.ComposeMetas ctx)}}</span>
<span class="tw-flex-1 tw-font-mono gt-ellipsis" title="{{.Summary}}">
{{- RenderCommitMessageLinkSubject $.root.Context .Message $commitLink ($.comment.Issue.PullRequest.BaseRepo.ComposeMetas ctx) -}}
</span>

{{if IsMultilineCommitMessage .Message}}
<button class="ui button js-toggle-commit-body ellipsis-button" aria-expanded="false">...</button>
{{end}}
{{if IsMultilineCommitMessage .Message}}
<pre class="commit-body tw-hidden">{{RenderCommitBody $.root.Context .Message ($.comment.Issue.PullRequest.BaseRepo.ComposeMetas ctx)}}</pre>
<button class="ui button ellipsis-button show-panel toggle" data-panel="[data-singular-commit-body-for='{{$tag}}']">...</button>
{{end}}

<span class="shabox tw-flex tw-items-center">
Expand Down Expand Up @@ -47,5 +46,10 @@
</a>
</span>
</div>
{{if IsMultilineCommitMessage .Message}}
<pre class="commit-body tw-ml-[33px] tw-hidden" data-singular-commit-body-for="{{$tag}}">
{{- RenderCommitBody $.root.Context .Message ($.comment.Issue.PullRequest.BaseRepo.ComposeMetas ctx) -}}
</pre>
{{end}}
{{end}}
</div>
1 change: 1 addition & 0 deletions web_src/css/base.css
Expand Up @@ -734,6 +734,7 @@ input:-webkit-autofill:active,
font-weight: var(--font-weight-normal);
margin: 0 6px;
padding: 5px 10px;
flex-shrink: 0;
}

.ui .sha.label .shortsha {
Expand Down
6 changes: 1 addition & 5 deletions web_src/css/repo.css
Expand Up @@ -2349,14 +2349,10 @@ tbody.commit-list {
.commit-body {
margin: 0.25em 0;
white-space: pre-wrap;
overflow-wrap: anywhere;
line-height: initial;
}

/* PR-comment */
.repository .timeline-item .commit-body {
margin-left: 45px;
}

.git-notes.top {
text-align: left;
}
Expand Down

0 comments on commit 94c5a30

Please sign in to comment.