From 2d6dca9abb4615377e51d680fd9ffaedd22835ed Mon Sep 17 00:00:00 2001 From: Shudhanshu Singh Date: Mon, 9 Nov 2026 21:34:43 +0000 Subject: [PATCH] fix(ui): improve user filter dropdown when no remote search is configured (#40296) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On the dashboard issue and pull request pages, author and assignee filters only accept direct username input since candidate lists across all accessible repositories cannot be pre-fetched. However, the dropdown inherited several confusing artifacts from the repository-level user search: - Displayed a misleading "Shows a maximum of 30 users" tooltip even though no remote user list was fetched. - Used "Search users" as placeholder rather than indicating direct username input. - Pressing Enter in the input had no effect, requiring mouse selection. - Any active username filter was not reflected in the dropdown menu on open. This change: - Only renders the 30-user tooltip when a remote search URL is provided. - Uses "Filter by username…" as placeholder when no remote search URL exists. - Applies the filter on Enter keypress. - Ensures the active username is displayed and selected when opening the menu. Fixes: https://github.com/go-gitea/gitea/issues/40275 Fixes: https://github.com/go-gitea/gitea/issues/33426 --------- Co-authored-by: wxiaoguang --- options/locale/locale_en-US.json | 1 + templates/repo/issue/filter_item_user_fetch.tmpl | 6 +++--- web_src/js/features/repo-issue-list.ts | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/options/locale/locale_en-US.json b/options/locale/locale_en-US.json index 1cea2ce1960..83fe61f1aae 100644 --- a/options/locale/locale_en-US.json +++ b/options/locale/locale_en-US.json @@ -1464,6 +1464,7 @@ "repo.issues.filter_assignee_any_assignee": "Assigned to anybody", "repo.issues.filter_poster": "Author", "repo.issues.filter_user_placeholder": "Search users", + "repo.issues.filter_by_username_placeholder": "Filter by username…", "repo.issues.filter_user_no_select": "All users", "repo.issues.filter_type": "Type", "repo.issues.filter_type.all_issues": "All issues", diff --git a/templates/repo/issue/filter_item_user_fetch.tmpl b/templates/repo/issue/filter_item_user_fetch.tmpl index 9cac1d12560..b080b1d419b 100644 --- a/templates/repo/issue/filter_item_user_fetch.tmpl +++ b/templates/repo/issue/filter_item_user_fetch.tmpl @@ -1,12 +1,12 @@ {{/* This is a user list for filter, the data is provided by a remote "fetch" request * QueryParamKey: eg: "poster", "assignee" * QueryLink -* UserSearchUrl +* UserSearchUrl: if not set, no remote search, the inputed username will be used as navigation link's query param value * SelectedUsername * TextFilterTitle */}} {{$queryLink := .QueryLink}} -