From ca445cf56628274ab5119816bf988f04204035a3 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 17 Feb 2023 08:13:35 +0100 Subject: [PATCH] Sort issues and pulls by recently updated in user and organization home (#22925) The main purpose of these home pages should be getting an overview of what's going on or needs attention. Recently updated is a better default than newest for that purpose, to avoid missing active issues and pulls that were not created recently. The default sorting order in repository issues and pulls remains newest. Repositories in an organization are already sorted by recently updated. --------- Co-authored-by: Jason Song Co-authored-by: Lunny Xiao --- routers/web/user/home.go | 5 +++++ templates/user/dashboard/issues.tmpl | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/routers/web/user/home.go b/routers/web/user/home.go index 36d9d4f019..4f45c1d5c3 100644 --- a/routers/web/user/home.go +++ b/routers/web/user/home.go @@ -338,6 +338,11 @@ func buildIssueOverview(ctx *context.Context, unitType unit.Type) { filterMode int ) + // Default to recently updated, unlike repository issues list + if sortType == "" { + sortType = "recentupdate" + } + // -------------------------------------------------------------------------------- // Distinguish User from Organization. // Org: diff --git a/templates/user/dashboard/issues.tmpl b/templates/user/dashboard/issues.tmpl index 5ecae3a7b9..049b6a1681 100644 --- a/templates/user/dashboard/issues.tmpl +++ b/templates/user/dashboard/issues.tmpl @@ -89,10 +89,10 @@ {{svg "octicon-triangle-down" 14 "dropdown icon"}}