From b5716ff340eb97931725265d7ec4f38cdea9edc8 Mon Sep 17 00:00:00 2001 From: Zichao Lin Date: Tue, 7 Jul 2026 13:23:39 +0800 Subject: [PATCH] fix(dashboard): sort recent activity by updated_at so delivered/received cards also appear --- app/routers/web.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/routers/web.py b/app/routers/web.py index f33e14a..55cea60 100644 --- a/app/routers/web.py +++ b/app/routers/web.py @@ -595,8 +595,8 @@ def dashboard(request: Request, user: User = Depends(get_current_user_web), db: received = sum(1 for c in all_cards if c.status == "received") countries = len({c.country for c in all_cards if c.country}) - # recent postcards across all profiles (last 8) - all_cards.sort(key=lambda c: c.created_at, reverse=True) + # recent postcards across all profiles (last 8), sorted by most recently updated + all_cards.sort(key=lambda c: c.updated_at or c.created_at, reverse=True) recent = all_cards[:8] # status distribution for progress bar