Skip to content

Commit 9946d31

Browse files
committed
Improve commit status icons
- Show them on hover/focus (tippy default) instead of click - If there is only one status, add href to trigger element - Increase tippy interactiveBorder, making it easier to keep interactive tooltips open with sloppy mouse movement - Fix a overflow issue in the commit list
1 parent b5d21c0 commit 9946d31

File tree

4 files changed

+7
-2
lines changed

4 files changed

+7
-2
lines changed

templates/repo/commit_statuses.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<a class="ui link commit-statuses-trigger vm">{{template "repo/commit_status" .Status}}</a>
1+
<a class="ui link commit-statuses-trigger vm"{{if eq (len .Statuses) 1}}{{$status := index .Statuses 0}}{{if $status.TargetURL}} href="{{$status.TargetURL}}"{{end}}{{end}}>{{template "repo/commit_status" .Status}}</a>
22
<div class="ui commit-statuses-popup commit-statuses tippy-target">
33
<div class="ui relaxed list divided">
44
{{range .Statuses}}

web_src/js/features/repo-commit.js

-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ export function initCommitStatuses() {
6161
const top = $('.repository.file.list').length > 0 || $('.repository.diff').length > 0;
6262

6363
createTippy(this, {
64-
trigger: 'click',
6564
content: this.nextElementSibling,
6665
placement: top ? 'top-start' : 'bottom-start',
6766
interactive: true,

web_src/js/modules/tippy.js

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export function createTippy(target, opts = {}) {
66
placement: target.getAttribute('data-placement') || 'top-start',
77
animation: false,
88
allowHTML: false,
9+
interactiveBorder: 30,
910
maxWidth: 500, // increase over default 350px
1011
arrow: `<svg width="16" height="7"><path d="m0 7 8-7 8 7Z" class="tippy-svg-arrow-outer"/><path d="m0 8 8-7 8 7Z" class="tippy-svg-arrow-inner"/></svg>`,
1112
...(opts?.role && {theme: opts.role}),

web_src/less/_repository.less

+5
Original file line numberDiff line numberDiff line change
@@ -2827,6 +2827,11 @@ tbody.commit-list {
28272827
vertical-align: middle;
28282828
}
28292829

2830+
// in the commit list, messages can wrap so we can use inline
2831+
.commit-list .message-wrapper {
2832+
display: inline;
2833+
}
2834+
28302835
@media @mediaSm {
28312836
tr.commit-list {
28322837
width: 100%;

0 commit comments

Comments
 (0)