fix: improve actions status icons and texts (#37206)

Action runs, jobs and steps have 8 statuses but the UI only showed 5
(from the commit status api) for the latter two. Align all 8 to GitHub
as closely as possible:

  - waiting — `octicon-circle` (hollow circle), gray
  - blocked — `octicon-blocked` (slashed circle), yellow
  - running — `gitea-running` (rotating spinner), yellow
  - cancelled — `octicon-stop` (gray), was `octicon-x` (red)

Descriptions also aligned with GitHub:

  - "Has started running" → "In progress"
  - "Has been cancelled" → "Cancelled after {dur}"
  - "Has been skipped" → "Skipped"

Fixes: https://github.com/go-gitea/gitea/issues/32228

---------

Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
Signed-off-by: silverwind <me@silverwind.io>
Co-authored-by: Claude (Opus 4.6) <noreply@anthropic.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Nicolas <bircni@icloud.com>
This commit is contained in:
silverwind
2026-05-09 15:24:08 +08:00
committed by GitHub
co-authored by Claude wxiaoguang Nicolas
parent a5d81d9ce2
commit ce089f498b
22 changed files with 248 additions and 70 deletions
+3 -1
View File
@@ -8,7 +8,9 @@
{{range $run := .Runs}}
<div class="item tw-items-center">
<div class="item-leading">
{{template "repo/actions/status" (dict "status" $run.Status.String)}}
<span data-tooltip-content="{{ctx.Locale.Tr (printf "actions.status.%s" $run.Status.String)}}">
{{template "repo/icons/action_status" (dict "Status" $run.Status.String "IconVariant" "circle-fill")}}
</span>
</div>
<div class="item-main">
<span class="item-title" title="{{$run.Title}}">
-23
View File
@@ -1,23 +0,0 @@
<!-- This template should be kept the same as web_src/js/components/ActionRunStatus.vue
Please also update the vue file above if this template is modified.
action status accepted: success, skipped, waiting, blocked, running, failure, cancelled, unknown
-->
{{- $size := Iif .size .size 16 -}}
{{- $className := Iif .className .className "" -}}
<span data-tooltip-content="{{ctx.Locale.Tr (printf "actions.status.%s" .status)}}">
{{if eq .status "success"}}
{{svg "octicon-check-circle-fill" $size (printf "tw-text-green %s" $className)}}
{{else if eq .status "skipped"}}
{{svg "octicon-skip" $size (printf "tw-text-text-light %s" $className)}}
{{else if eq .status "cancelled"}}
{{svg "octicon-stop" $size (printf "tw-text-text-light %s" $className)}}
{{else if eq .status "waiting"}}
{{svg "octicon-circle" $size (printf "tw-text-text-light %s" $className)}}
{{else if eq .status "blocked"}}
{{svg "octicon-blocked" $size (printf "tw-text-yellow %s" $className)}}
{{else if eq .status "running"}}
{{svg "gitea-running" $size (printf "tw-text-yellow rotate-clockwise %s" $className)}}
{{else}}{{/*failure, unknown*/}}
{{svg "octicon-x-circle-fill" $size (printf "tw-text-red %s" $className)}}
{{end}}
</span>
+2 -2
View File
@@ -1,11 +1,11 @@
{{if .Statuses}}
{{if and (eq (len .Statuses) 1) .Status.TargetURL}}
<a class="flex-text-inline tw-no-underline {{.AdditionalClasses}}" data-global-init="initCommitStatuses" href="{{.Status.TargetURL}}">
{{template "repo/commit_status" .Status}}
{{template "repo/icons/commit_status" .Status}}
</a>
{{else}}
<span class="flex-text-inline {{.AdditionalClasses}}" data-global-init="initCommitStatuses" tabindex="0">
{{template "repo/commit_status" .Status}}
{{template "repo/icons/commit_status" .Status}}
</span>
{{end}}
<div class="tippy-target">
+28
View File
@@ -0,0 +1,28 @@
{{/* Status icons used for runs, jobs and steps.
Template Attributes:
* Status: one of success, skipped, waiting, blocked, running, failure, cancelled, unknown
* Size: icon size in pixels (default 16)
* ClassName: additional CSS classes
* IconVariant: "circle-fill" octicon-check-circle-fill / octicon-x-circle-fill
Keep this template in sync with web_src/js/components/ActionStatusIcon.vue.
*/}}
{{- $size := or .Size 16 -}}
{{- $className := or .ClassName "" -}}
{{- $circleFill := eq .IconVariant "circle-fill" -}}
{{if eq .Status "success"}}
{{svg (Iif $circleFill "octicon-check-circle-fill" "octicon-check") $size (printf "tw-text-green %s" $className)}}
{{else if eq .Status "skipped"}}
{{svg "octicon-skip" $size (printf "tw-text-text-light %s" $className)}}
{{else if eq .Status "cancelled"}}
{{svg "octicon-stop" $size (printf "tw-text-text-light %s" $className)}}
{{else if eq .Status "waiting"}}
{{svg "octicon-circle" $size (printf "tw-text-text-light %s" $className)}}
{{else if eq .Status "blocked"}}
{{svg "octicon-blocked" $size (printf "tw-text-yellow %s" $className)}}
{{else if eq .Status "running"}}
{{svg "gitea-running" $size (printf "tw-text-yellow rotate-clockwise %s" $className)}}
{{else}}{{/*failure, unknown*/}}
{{svg (Iif $circleFill "octicon-x-circle-fill" "octicon-x") $size (printf "tw-text-red %s" $className)}}
{{end}}
+7 -1
View File
@@ -3,10 +3,16 @@
* StatusCheckData: optional, additional status check data, see backend pullCommitStatusCheckData struct
*/}}
{{$statusCheckData := $.StatusCheckData}}
{{$commitActionsStatuses := ctx.ActionsUtils.CommitStatusesToActionsStatuses $.CommitStatuses}}
{{range $cs := $.CommitStatuses}}
<div class="item commit-status-item">
<div class="flex-text-block">
{{template "repo/commit_status" $cs}}
{{$actionStatus := $commitActionsStatuses.IconStatus $cs}}
{{if $actionStatus}}
{{template "repo/icons/action_status" (dict "Status" $actionStatus "Size" 18 "ClassName" "commit-status icon")}}
{{else}}
{{template "repo/icons/commit_status" $cs}}
{{end}}
<div class="status-context gt-ellipsis">
{{$cs.Context}} <span class="tw-text-text-light-2">{{$cs.Description}}</span>
</div>