From ef9c19691ddf00ed1db3caefe6ff5da471e71368 Mon Sep 17 00:00:00 2001 From: Tyrone Yeh Date: Fri, 6 Feb 2026 16:33:42 +0800 Subject: [PATCH] Fix issues filter dropdown showing empty label scope section (#36535) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The issues filter dropdown always rendered the label scope divider and header, even when .ExclusiveLabelScopes was empty. This PR wraps the label scope section with a conditional so the divider/header and scope entries are only displayed when scopes exist. Before The dropdown showed a divider and “Label” header even when there were no exclusive label scopes available. image After The label scope section is hidden entirely when .ExclusiveLabelScopes is empty, keeping the dropdown clean and consistent. image Notes UI-only change, no behavior change to filtering logic. --- templates/repo/issue/filter_list.tmpl | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/templates/repo/issue/filter_list.tmpl b/templates/repo/issue/filter_list.tmpl index bfdf94513e..957b8d10aa 100644 --- a/templates/repo/issue/filter_list.tmpl +++ b/templates/repo/issue/filter_list.tmpl @@ -133,11 +133,13 @@ {{ctx.Locale.Tr "repo.issues.filter_sort.leastcomment"}} {{ctx.Locale.Tr "repo.issues.filter_sort.nearduedate"}} {{ctx.Locale.Tr "repo.issues.filter_sort.farduedate"}} -
-
{{ctx.Locale.Tr "repo.issues.filter_label"}}
- {{range $scope := .ExclusiveLabelScopes}} - {{$sortType := (printf "scope-%s" $scope)}} - {{$scope}} + {{if .ExclusiveLabelScopes}} +
+
{{ctx.Locale.Tr "repo.issues.filter_label"}}
+ {{range $scope := .ExclusiveLabelScopes}} + {{$sortType := (printf "scope-%s" $scope)}} + {{$scope}} + {{end}} {{end}}