From 2e96e8227fa2df08197cb29d2d9051fe56aa8a8a Mon Sep 17 00:00:00 2001 From: silverwind Date: Thu, 21 May 2026 09:02:05 +0200 Subject: [PATCH] style: misc UI fixes (#37691) - Action view sidebar: rename `job-brief-item` to `action-view-sidebar-item`, fix trash icon overflow on long artifact names, align artifact and workflow hover styles with the jobs list - Branches: expand new PR button cell to three wide so the button is not clipped on narrow viewports - Dashboard feed: add `tw-max-w-full` so long issue titles truncate - Reactions: tighten label padding Screenshot 2026-05-13 at 16 18 33 Screenshot 2026-05-13 at 16 19 25 Screenshot 2026-05-13 at 16 47 18 Screenshot 2026-05-13 at 16 55 53 Screenshot 2026-05-13 at 16 58 41 Screenshot 2026-05-13 at 17 00 43 --- This PR was written with the help of Claude Opus 4.7 --------- Signed-off-by: silverwind Co-authored-by: Claude (Opus 4.7) Co-authored-by: wxiaoguang --- modules/templates/util_render.go | 49 ++++-------- modules/templates/util_render_test.go | 13 ++- templates/repo/branch/list.tmpl | 26 +++--- templates/repo/issue/card.tmpl | 2 +- .../repo/issue/view_content/comments.tmpl | 2 +- templates/shared/issuelist.tmpl | 12 +-- templates/user/dashboard/feeds.tmpl | 2 +- tests/integration/issue_test.go | 2 +- web_src/css/base.css | 9 +++ web_src/css/modules/button.css | 4 - web_src/css/modules/label.css | 27 ++++--- web_src/css/repo.css | 9 +-- web_src/css/repo/issue-list.css | 7 ++ web_src/css/repo/reactions.css | 4 +- web_src/css/shared/flex-list.css | 2 - web_src/js/components/ActionRunJobView.vue | 29 ++++++- web_src/js/components/RepoActionView.vue | 80 +++++++++++-------- 17 files changed, 154 insertions(+), 125 deletions(-) diff --git a/modules/templates/util_render.go b/modules/templates/util_render.go index da186f87f21..9d05bb2a0b6 100644 --- a/modules/templates/util_render.go +++ b/modules/templates/util_render.go @@ -121,23 +121,7 @@ func (ut *RenderUtils) RenderIssueSimpleTitle(text string) template.HTML { return ret } -func (ut *RenderUtils) RenderLabelWithLink(label *issues_model.Label, link any) template.HTML { - var attrHref template.HTML - switch link.(type) { - case template.URL, string: - attrHref = htmlutil.HTMLFormat(`href="%s"`, link) - default: - panic(fmt.Sprintf("unexpected type %T for link", link)) - } - return ut.renderLabelWithTag(label, "a", attrHref) -} - func (ut *RenderUtils) RenderLabel(label *issues_model.Label) template.HTML { - return ut.renderLabelWithTag(label, "span", "") -} - -// RenderLabel renders a label -func (ut *RenderUtils) renderLabelWithTag(label *issues_model.Label, tagName, tagAttrs template.HTML) template.HTML { locale := ut.ctx.Value(translation.ContextKey).(translation.Locale) var extraCSSClasses string textColor := util.ContrastColor(label.Color) @@ -151,8 +135,8 @@ func (ut *RenderUtils) renderLabelWithTag(label *issues_model.Label, tagName, ta if labelScope == "" { // Regular label - return htmlutil.HTMLFormat(`<%s %s class="ui label %s" style="color: %s !important; background-color: %s !important;" data-tooltip-content title="%s">%s`, - tagName, tagAttrs, extraCSSClasses, textColor, label.Color, descriptionText, ut.RenderEmoji(label.Name), tagName) + return htmlutil.HTMLFormat(`%s`, + extraCSSClasses, textColor, label.Color, descriptionText, ut.RenderEmoji(label.Name)) } // Scoped label @@ -187,29 +171,25 @@ func (ut *RenderUtils) renderLabelWithTag(label *issues_model.Label, tagName, ta if label.ExclusiveOrder > 0 { // |