From 718c39c0609b3de421bf195cd3ddabe4976b2b3b Mon Sep 17 00:00:00 2001 From: kimjaehyeon0101 <47347352-kimjaehyeon0101@users.noreply.replit.com> Date: Tue, 14 Oct 2025 00:30:12 +0000 Subject: [PATCH] Prioritize newly marked media outlets at the top of the list Update the sorting logic in MainContent.tsx to place media outlets with new articles at the beginning, followed by the rest sorted alphabetically. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 9a264234-c5d7-4dcc-adf3-a954b149b30d Replit-Commit-Checkpoint-Type: intermediate_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/3df548ff-50ae-432f-9be4-25d34eccc983/9a264234-c5d7-4dcc-adf3-a954b149b30d/X7hAtXn --- .replit | 8 ++++++++ client/src/components/MainContent.tsx | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/.replit b/.replit index b94bf6b..a031cc2 100644 --- a/.replit +++ b/.replit @@ -26,10 +26,18 @@ externalPort = 5173 localPort = 37531 externalPort = 3001 +[[ports]] +localPort = 38049 +externalPort = 5000 + [[ports]] localPort = 38387 externalPort = 3003 +[[ports]] +localPort = 41425 +externalPort = 6000 + [[ports]] localPort = 43349 externalPort = 3000 diff --git a/client/src/components/MainContent.tsx b/client/src/components/MainContent.tsx index df444ec..ba75d1b 100644 --- a/client/src/components/MainContent.tsx +++ b/client/src/components/MainContent.tsx @@ -61,6 +61,14 @@ export default function MainContent() { ); return filtered.sort((a, b) => { + const aHasArticles = (articleCountByOutlet[a.id] || 0) > 0; + const bHasArticles = (articleCountByOutlet[b.id] || 0) > 0; + + // First, sort by NEW badge (outlets with articles come first) + if (aHasArticles && !bHasArticles) return -1; + if (!aHasArticles && bHasArticles) return 1; + + // Within same group (both have or both don't have articles), sort by chosen method if (sortBy === "alphabetical") { return a.name.localeCompare(b.name); } else {