Skip to content

Commit b9f69b4

Browse files
authored
Fix various overflows on actions view (#30344)
Fix a number of text overflow issues in actions view and run list. Also improve mobile view of run list. Fixes: #30328 <img width="782" alt="Screenshot 2024-04-08 at 23 10 16" src="https://github.com/go-gitea/gitea/assets/115237/3d9f9f88-3eab-44a0-8144-30c2b58b24cb"> <img width="935" alt="Screenshot 2024-04-08 at 23 17 46" src="https://github.com/go-gitea/gitea/assets/115237/581d73ea-a31d-416b-be3a-47313b879b12"> <img width="1008" alt="Screenshot 2024-04-08 at 23 49 05" src="https://github.com/go-gitea/gitea/assets/115237/c5d10565-f285-477f-8659-1caf94797647"> <img width="397" alt="Screenshot 2024-04-08 at 23 55 30" src="https://github.com/go-gitea/gitea/assets/115237/368aaa75-1903-4058-9d75-d1fe91c564d6">
1 parent 2c80421 commit b9f69b4

File tree

3 files changed

+43
-13
lines changed

3 files changed

+43
-13
lines changed

templates/repo/actions/runs_list.tmpl

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="flex-list">
1+
<div class="flex-list run-list">
22
{{if not .Runs}}
33
<div class="empty-placeholder">
44
{{svg "octicon-no-entry" 48}}
@@ -28,14 +28,14 @@
2828
</div>
2929
<div class="flex-item-trailing">
3030
{{if .RefLink}}
31-
<a class="ui label tw-px-1 tw-mx-0" href="{{.RefLink}}">{{.PrettyRef}}</a>
31+
<a class="ui label run-list-ref gt-ellipsis" href="{{.RefLink}}">{{.PrettyRef}}</a>
3232
{{else}}
33-
<span class="ui label tw-px-1 tw-mx-0">{{.PrettyRef}}</span>
33+
<span class="ui label run-list-ref gt-ellipsis">{{.PrettyRef}}</span>
3434
{{end}}
35-
</div>
36-
<div class="run-list-item-right">
37-
<div class="run-list-meta">{{svg "octicon-calendar" 16}}{{TimeSinceUnix .Updated ctx.Locale}}</div>
38-
<div class="run-list-meta">{{svg "octicon-stopwatch" 16}}{{.Duration}}</div>
35+
<div class="run-list-item-right">
36+
<div class="run-list-meta">{{svg "octicon-calendar" 16}}{{TimeSinceUnix .Updated ctx.Locale}}</div>
37+
<div class="run-list-meta">{{svg "octicon-stopwatch" 16}}{{.Duration}}</div>
38+
</div>
3939
</div>
4040
</div>
4141
{{end}}

web_src/css/actions.css

+25-1
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,10 @@
4444
}
4545

4646
.run-list-item-right {
47-
flex: 0 0 min(20%, 130px);
47+
width: 130px;
4848
display: flex;
4949
flex-direction: column;
50+
flex-shrink: 0;
5051
gap: 3px;
5152
color: var(--color-text-light);
5253
}
@@ -57,3 +58,26 @@
5758
gap: .25rem;
5859
align-items: center;
5960
}
61+
62+
.run-list .flex-item-trailing {
63+
flex-wrap: nowrap;
64+
width: 280px;
65+
flex: 0 0 280px;
66+
}
67+
68+
.run-list-ref {
69+
display: inline-block !important;
70+
}
71+
72+
@media (max-width: 767.98px) {
73+
.run-list .flex-item-trailing {
74+
flex-direction: column;
75+
align-items: flex-end;
76+
width: auto;
77+
flex-basis: auto;
78+
}
79+
.run-list-item-right,
80+
.run-list-ref {
81+
max-width: 110px;
82+
}
83+
}

web_src/js/components/RepoActionView.vue

+11-5
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ export function initRepositoryActionView() {
377377
<button class="ui basic small compact button red" @click="cancelRun()" v-else-if="run.canCancel">
378378
{{ locale.cancel }}
379379
</button>
380-
<button class="ui basic small compact button tw-mr-0 link-action" :data-url="`${run.link}/rerun`" v-else-if="run.canRerun">
380+
<button class="ui basic small compact button tw-mr-0 tw-whitespace-nowrap link-action" :data-url="`${run.link}/rerun`" v-else-if="run.canRerun">
381381
{{ locale.rerun_all }}
382382
</button>
383383
</div>
@@ -386,8 +386,8 @@ export function initRepositoryActionView() {
386386
<a class="muted" :href="run.commit.link">{{ run.commit.shortSHA }}</a>
387387
{{ run.commit.localePushedBy }}
388388
<a class="muted" :href="run.commit.pusher.link">{{ run.commit.pusher.displayName }}</a>
389-
<span class="ui label" v-if="run.commit.shortSHA">
390-
<a :href="run.commit.branch.link">{{ run.commit.branch.name }}</a>
389+
<span class="ui label tw-max-w-full" v-if="run.commit.shortSHA">
390+
<a class="gt-ellipsis" :href="run.commit.branch.link">{{ run.commit.branch.name }}</a>
391391
</span>
392392
</div>
393393
</div>
@@ -426,8 +426,8 @@ export function initRepositoryActionView() {
426426
427427
<div class="action-view-right">
428428
<div class="job-info-header">
429-
<div class="job-info-header-left">
430-
<h3 class="job-info-header-title">
429+
<div class="job-info-header-left gt-ellipsis">
430+
<h3 class="job-info-header-title gt-ellipsis">
431431
{{ currentJob.title }}
432432
</h3>
433433
<p class="job-info-header-detail">
@@ -503,6 +503,7 @@ export function initRepositoryActionView() {
503503
display: flex;
504504
align-items: center;
505505
justify-content: space-between;
506+
gap: 8px;
506507
}
507508
508509
.action-info-summary-title {
@@ -513,6 +514,7 @@ export function initRepositoryActionView() {
513514
font-size: 20px;
514515
margin: 0 0 0 8px;
515516
flex: 1;
517+
overflow-wrap: anywhere;
516518
}
517519
518520
.action-commit-summary {
@@ -728,6 +730,10 @@ export function initRepositoryActionView() {
728730
font-size: 12px;
729731
}
730732
733+
.job-info-header-left {
734+
flex: 1;
735+
}
736+
731737
.job-step-container {
732738
max-height: 100%;
733739
border-radius: 0 0 var(--border-radius) var(--border-radius);

0 commit comments

Comments
 (0)