From db04bcb31a3cbab9a7893e6c10d18eece59332b6 Mon Sep 17 00:00:00 2001 From: Nicolas Date: Thu, 28 May 2026 07:51:45 +0200 Subject: [PATCH] enhance(actions): set descriptive browser tab title on run view (#37870) --- routers/web/repo/actions/view.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/routers/web/repo/actions/view.go b/routers/web/repo/actions/view.go index 0ed38496218..d95b8679b8d 100644 --- a/routers/web/repo/actions/view.go +++ b/routers/web/repo/actions/view.go @@ -14,6 +14,7 @@ import ( "net/http" "net/url" "strconv" + "strings" "time" actions_model "gitea.dev/models/actions" @@ -206,6 +207,16 @@ func View(ctx *context_module.Context) { jobID := ctx.PathParamInt64("job") ctx.Data["JobID"] = jobID // it can be 0 when no job (e.g.: run summary view) + // Browser tab title, ordered most-specific → least-specific so narrow tabs keep the useful part. + // Separator matches the " - " used by head.tmpl when joining to PageTitleCommon. + titleParts := []string{run.Title, run.WorkflowID} + if jobID > 0 { + if job, err := actions_model.GetRunJobByRunAndID(ctx, run.ID, jobID); err == nil && job.Name != "" { + titleParts = append([]string{job.Name}, titleParts...) + } + } + ctx.Data["Title"] = strings.Join(titleParts, " - ") + attemptNum := ctx.PathParamInt64("attempt") // ActionsViewURL is the endpoint for viewing a run (job summary), a job, or a job attempt.