From fe88acb5a0459a6e2ff6ae65cbfdda6110e6d528 Mon Sep 17 00:00:00 2001 From: k Date: Sat, 30 May 2026 03:16:35 +0800 Subject: [PATCH] fix(ui): don't show misleading 0% AI bar on off-topic Trump posts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Most Trump posts aren't crypto-related, so the entry filter / AI marks them relevant=false with ai_confidence=0 and no reasoning (never AI-scored). The post card still rendered 'AI confidence 0%' with an empty progress bar, which reads as 'AI looked and was 0% confident' rather than the truth: 'skipped as not crypto-relevant'. Added an aiScored guard (ai_confidence > 0 || ai_reasoning present): - collapsed row: shows AI '—' instead of '0%' for unscored posts - expanded detail: shows 'Not crypto-relevant — skipped AI scoring' instead of an empty 0% confidence bar Scored posts (the ~80 with confidence>0 in test data, and all real signals once live) are unchanged — full bar + reasoning shown. tsc + build clean. Co-Authored-By: Claude Sonnet 4.6 --- components/dashboard/PostCards.tsx | 37 ++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/components/dashboard/PostCards.tsx b/components/dashboard/PostCards.tsx index a1794be..17ee5b3 100644 --- a/components/dashboard/PostCards.tsx +++ b/components/dashboard/PostCards.tsx @@ -102,6 +102,15 @@ const PostRow = memo(function PostRow({ post, selected, onClick }: PostRowProps) onClick?.() } + // Did this post actually get an AI score, or was it filtered as off-topic + // noise before any AI call? Trump posts mostly aren't crypto-related, so the + // entry filter / AI marks them relevant=false with confidence 0 and no + // reasoning. Showing "AI confidence 0%" + an empty bar for those is + // misleading — it reads as "AI looked and had zero confidence" when really + // "this was skipped as not crypto-relevant". Treat a post as AI-scored only + // when it has a real confidence or reasoning. + const aiScored = post.ai_confidence > 0 || !!post.ai_reasoning + return (
AI - {post.ai_confidence}% + + {aiScored ? `${post.ai_confidence}%` : '—'} +
@@ -168,16 +179,24 @@ const PostRow = memo(function PostRow({ post, selected, onClick }: PostRowProps) className="post-row-detail" onClick={e => e.stopPropagation()} > - {/* AI confidence bar */} -
-
- AI confidence - {post.ai_confidence}% + {/* AI confidence bar — only when the post was actually AI-scored. + Off-topic/noise posts (relevant=false, conf 0, no reasoning) show + a neutral note instead of a misleading empty 0% bar. */} + {aiScored ? ( +
+
+ AI confidence + {post.ai_confidence}% +
+
+
+
-
-
+ ) : ( +
+ Not crypto-relevant — skipped AI scoring.
-
+ )} {/* Trade routing — target asset + expected move */} {post.target_asset && (post.signal === 'buy' || post.signal === 'short') && (