From a77edc7ba4d6283c4bf86bd486b2288f344809fc Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sun, 14 Jun 2026 12:44:53 -0700 Subject: [PATCH 01/12] chore(actions): Add icon for status filter (#38082) image --------- Co-authored-by: bircni --- models/actions/run_list.go | 2 ++ models/actions/run_list_test.go | 13 +++++++++++++ templates/repo/actions/list.tmpl | 5 ++++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/models/actions/run_list.go b/models/actions/run_list.go index 553fd7bae99..88f3d3dd822 100644 --- a/models/actions/run_list.go +++ b/models/actions/run_list.go @@ -111,6 +111,7 @@ func (opts FindRunOptions) ToOrders() string { type StatusInfo struct { Status int + StatusName string DisplayedStatus string } @@ -122,6 +123,7 @@ func GetStatusInfoList(ctx context.Context, lang translation.Locale) []StatusInf for _, s := range allStatus { statusInfoList = append(statusInfoList, StatusInfo{ Status: int(s), + StatusName: s.String(), DisplayedStatus: s.LocaleString(lang), }) } diff --git a/models/actions/run_list_test.go b/models/actions/run_list_test.go index 70d8dd91b1b..74f630bb553 100644 --- a/models/actions/run_list_test.go +++ b/models/actions/run_list_test.go @@ -7,6 +7,7 @@ import ( "testing" "gitea.dev/models/unittest" + "gitea.dev/modules/translation" "github.com/stretchr/testify/assert" ) @@ -22,3 +23,15 @@ func TestGetRunWorkflowIDs(t *testing.T) { assert.NoError(t, err) assert.Empty(t, ids) } + +func TestGetStatusInfoList(t *testing.T) { + statusInfoList := GetStatusInfoList(t.Context(), translation.MockLocale{}) + + assert.Equal(t, []StatusInfo{ + {Status: int(StatusSuccess), StatusName: StatusSuccess.String(), DisplayedStatus: "actions.status.success"}, + {Status: int(StatusFailure), StatusName: StatusFailure.String(), DisplayedStatus: "actions.status.failure"}, + {Status: int(StatusWaiting), StatusName: StatusWaiting.String(), DisplayedStatus: "actions.status.waiting"}, + {Status: int(StatusRunning), StatusName: StatusRunning.String(), DisplayedStatus: "actions.status.running"}, + {Status: int(StatusCancelling), StatusName: StatusCancelling.String(), DisplayedStatus: "actions.status.cancelling"}, + }, statusInfoList) +} diff --git a/templates/repo/actions/list.tmpl b/templates/repo/actions/list.tmpl index 1eec365cef9..bf2a1db0a7d 100644 --- a/templates/repo/actions/list.tmpl +++ b/templates/repo/actions/list.tmpl @@ -78,7 +78,10 @@ {{range .StatusInfoList}} - {{.DisplayedStatus}} + + {{template "repo/icons/action_status" (dict "Status" .StatusName)}} + {{.DisplayedStatus}} + {{end}} From e70b91d8ecffc9a34ca63101e83131043a555dcb Mon Sep 17 00:00:00 2001 From: Karthik Bhandary <34509856+karthikbhandary2@users.noreply.github.com> Date: Mon, 15 Jun 2026 07:59:41 +0530 Subject: [PATCH 02/12] chore: center info message for unsupported jupyter notebook versions (#38114) Co-authored-by: wxiaoguang --- modules/markup/jupyter/jupyter.go | 34 ++++++++++++++------------ modules/markup/jupyter/jupyter_test.go | 2 +- templates/repo/blame.tmpl | 2 +- templates/repo/settings/lfs_file.tmpl | 2 +- templates/repo/view_file.tmpl | 2 +- web_src/css/repo/file-view.css | 6 +++++ 6 files changed, 29 insertions(+), 19 deletions(-) diff --git a/modules/markup/jupyter/jupyter.go b/modules/markup/jupyter/jupyter.go index 059046c1365..a02eb4a0287 100644 --- a/modules/markup/jupyter/jupyter.go +++ b/modules/markup/jupyter/jupyter.go @@ -6,6 +6,7 @@ package jupyter import ( "encoding/base64" "fmt" + "html/template" "io" "strings" "sync" @@ -150,10 +151,8 @@ func (renderer) Render(ctx *markup.RenderContext, input io.Reader, outputWriter // Check nbformat version if notebook.Nbformat < 4 { - htmlWriter.WriteFormat( - `
This notebook uses an older format (nbformat %d). Only nbformat 4+ is supported for rendering. Please upgrade the notebook in Jupyter or view the raw JSON.
`, - notebook.Nbformat, - ) + msg := htmlutil.HTMLFormat("This notebook uses an older format (nbformat %d). Only nbformat 4+ is supported for rendering. Please upgrade the notebook in Jupyter or view the raw JSON.", notebook.Nbformat) + htmlWriter.WriteFormat(`
%s
`, msg) return htmlWriter.Err() } @@ -190,9 +189,7 @@ func (renderer) Render(ctx *markup.RenderContext, input io.Reader, outputWriter } if truncated { - htmlWriter.WriteHTML(`
`) - htmlWriter.WriteHTML(`Output truncated. This notebook contains too many cells to display efficiently.`) - htmlWriter.WriteHTML(`
`) + renderCellPrompt(htmlWriter, "Warning:", "Output truncated. This notebook contains too many cells to display efficiently.") } htmlWriter.WriteHTML(``) @@ -254,6 +251,16 @@ func renderCellCode(output htmlutil.HTMLWriter, cell Cell, language string) erro return output.Err() } +func renderCellPrompt(output htmlutil.HTMLWriter, left, right template.HTML) { + output.WriteFormat(` +
+
+
%s
+
%s
+
+
`, left, right) +} + func renderCell(ctx *markup.RenderContext, output htmlutil.HTMLWriter, cell Cell, language string) error { switch cell.CellType { case "markdown": @@ -265,7 +272,10 @@ func renderCell(ctx *markup.RenderContext, output htmlutil.HTMLWriter, cell Cell if err := renderCellMarkdown(ctx, output, joinSource(cell.Source)); err != nil { return err } - output.WriteHTML(``) + output.WriteHTML(` + + +`) case "code": output.WriteHTML(`
`) if err := renderCellCode(output, cell, language); err != nil { @@ -273,13 +283,7 @@ func renderCell(ctx *markup.RenderContext, output htmlutil.HTMLWriter, cell Cell } output.WriteHTML(`
`) default: - output.WriteFormat(` -
-
-
Cell:
-
[Cell type %s - unsupported, skipped]
-
-
`, cell.CellType) + renderCellPrompt(output, "Cell:", htmlutil.HTMLFormat("[Cell type %s - unsupported, skipped]", cell.CellType)) } return output.Err() } diff --git a/modules/markup/jupyter/jupyter_test.go b/modules/markup/jupyter/jupyter_test.go index fd1464d1727..61d362da987 100644 --- a/modules/markup/jupyter/jupyter_test.go +++ b/modules/markup/jupyter/jupyter_test.go @@ -215,7 +215,7 @@ func TestRender(t *testing.T) { err := r.Render(ctx, strings.NewReader(input), &output) assert.NoError(t, err) - assert.Regexp(t, `
This notebook uses an older format.*
`, output.String()) + assert.Regexp(t, `
This notebook uses an older format.*
`, output.String()) }) } diff --git a/templates/repo/blame.tmpl b/templates/repo/blame.tmpl index d108ea33797..ef3415d52e5 100644 --- a/templates/repo/blame.tmpl +++ b/templates/repo/blame.tmpl @@ -28,7 +28,7 @@ -
+
{{if .IsFileTooLarge}} {{template "shared/filetoolarge" dict "RawFileLink" .RawFileLink}} diff --git a/templates/repo/settings/lfs_file.tmpl b/templates/repo/settings/lfs_file.tmpl index b04dc16cdfb..96148f57a9f 100644 --- a/templates/repo/settings/lfs_file.tmpl +++ b/templates/repo/settings/lfs_file.tmpl @@ -11,7 +11,7 @@ {{ctx.Locale.Tr "repo.settings.lfs_findcommits"}}
-
+
{{template "repo/unicode_escape_prompt" dict "EscapeStatus" .EscapeStatus "root" $}}
{{if .IsFileTooLarge}} diff --git a/templates/repo/view_file.tmpl b/templates/repo/view_file.tmpl index 9f936afb8e0..7d139efceb2 100644 --- a/templates/repo/view_file.tmpl +++ b/templates/repo/view_file.tmpl @@ -91,7 +91,7 @@
-
+
{{if not .RenderAsMarkup}} {{template "repo/unicode_escape_prompt" dict "EscapeStatus" .EscapeStatus}} {{end}} diff --git a/web_src/css/repo/file-view.css b/web_src/css/repo/file-view.css index 3f1c42a4a1f..fec1c7cd8f5 100644 --- a/web_src/css/repo/file-view.css +++ b/web_src/css/repo/file-view.css @@ -1,3 +1,9 @@ +.file-view-container { + padding: 0 !important; /* the file-view itself provides padding */ + width: 100% !important; /* override fomantic's "100% + 2px" */ + max-width: 100% !important; +} + .file-view tr.active .lines-num, .file-view tr.active .lines-escape, .file-view tr.active .lines-code { From bce6df24b799a2fc7f9be7bb8a5ac2a4075d66e0 Mon Sep 17 00:00:00 2001 From: bircni Date: Mon, 15 Jun 2026 06:56:26 +0200 Subject: [PATCH 03/12] feat(actions): show run status on browser tab favicon (#38071) --- web_src/js/components/ActionStatusIcon.vue | 21 ++--- web_src/js/components/RepoActionView.vue | 11 ++- web_src/js/modules/action-status-icon.test.ts | 9 ++ web_src/js/modules/action-status-icon.ts | 37 ++++++++ web_src/js/modules/favicon-status.test.ts | 29 ++++++ web_src/js/modules/favicon-status.ts | 90 +++++++++++++++++++ web_src/js/svg.ts | 2 + 7 files changed, 188 insertions(+), 11 deletions(-) create mode 100644 web_src/js/modules/action-status-icon.test.ts create mode 100644 web_src/js/modules/action-status-icon.ts create mode 100644 web_src/js/modules/favicon-status.test.ts create mode 100644 web_src/js/modules/favicon-status.ts diff --git a/web_src/js/components/ActionStatusIcon.vue b/web_src/js/components/ActionStatusIcon.vue index 12da669ac4d..bebb510467b 100644 --- a/web_src/js/components/ActionStatusIcon.vue +++ b/web_src/js/components/ActionStatusIcon.vue @@ -2,32 +2,33 @@ action status accepted: success, skipped, waiting, blocked, running, failure, cancelled, cancelling, unknown. --> diff --git a/web_src/js/components/RepoActionView.vue b/web_src/js/components/RepoActionView.vue index 03d62bd7ccf..9ce926673b9 100644 --- a/web_src/js/components/RepoActionView.vue +++ b/web_src/js/components/RepoActionView.vue @@ -1,7 +1,8 @@