From b900666eb8d6430753c8c52afffd0c4942caebfd Mon Sep 17 00:00:00 2001 From: Gigi Date: Sun, 19 Oct 2025 23:11:38 +0200 Subject: [PATCH] feat: add category breakdown to reading progress debug output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Shows counts of articles in each reading progress category: - Unopened (0%) - Started (0% < progress ≤ 10%) - Reading (10% < progress ≤ 94%) - highlighted in green - Completed (≥ 95%) This helps understand why /me/reads/reading shows fewer articles than the total reading progress events - most articles fall into other categories. --- src/components/Debug.tsx | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/src/components/Debug.tsx b/src/components/Debug.tsx index 17ba051b..8c683ce8 100644 --- a/src/components/Debug.tsx +++ b/src/components/Debug.tsx @@ -1573,6 +1573,43 @@ const Debug: React.FC = ({ {deduplicatedProgressMap.size > 0 && (
Deduplicated Reading Progress ({deduplicatedProgressMap.size} articles):
+ + {/* Category breakdown */} +
+
Breakdown by Category:
+
+ {(() => { + let unopened = 0, started = 0, reading = 0, completed = 0 + for (const progress of deduplicatedProgressMap.values()) { + if (progress === 0) unopened++ + else if (progress > 0 && progress <= 0.10) started++ + else if (progress > 0.10 && progress <= 0.94) reading++ + else if (progress >= 0.95) completed++ + } + return ( + <> +
+ Unopened (0%): + {unopened} +
+
+ Started (0% < progress ≤ 10%): + {started} +
+
+ Reading (10% < progress ≤ 94%) ✓: + {reading} +
+
+ Completed (≥ 95%): + {completed} +
+ + ) + })()} +
+
+
{Array.from(deduplicatedProgressMap.entries()).map(([articleId, progress], idx) => { return (