Repository navigation
Add human-readable risk-level UI instead of raw enum display - #30
Josue19-08 wants to merge 1 commit into
Conversation
Judges see the raw numeric RiskLevel enum and, when matches exist, would otherwise need the pattern's internal category slug to understand what was flagged. Map each level to a label/color/icon and render matched categories and evidence snippets in plain language instead. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe web app now uses a dedicated ChangesRisk assessment UI
Estimated code review effort: 2 (Simple) | ~10 minutes Severity of issue fixed: Low Merge Risk: ⚪ Minimal · up to The web app now presents assessment levels, scam categories, evidence, and critical hard-block messaging in readable UI. No concrete merge-blocking risk remains. Sequence Diagram(s)sequenceDiagram
participant App
participant RiskResult
participant riskPresentation
App->>RiskResult: render assessment
RiskResult->>riskPresentation: resolve risk and category presentation
riskPresentation-->>RiskResult: return labels, colors, icons, and category names
RiskResult-->>App: render assessment details and hard-block status
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Description
apps/webshowed the raw numericRiskLevelenum and, for matches, only the plain summary sentence — no readable breakdown of which scam pattern(s) were matched or why.Changes
riskPresentation.tsmapping eachRiskLevelto a human label, color, and icon (e.g.Critical→ "🛑 Critical — send blocked", red) and eachScamCategoryto a plain-language name (e.g.pig-butchering→ "Pig-butchering scam").RiskResultcomponent rendering the mapped label/color/icon, the assessment summary, and a bullet list of matched categories with their evidence snippets in plain language instead of raw JSON.App.tsxnow renders<RiskResult assessment={assessment} />instead of the raw{assessment.level}numeric display.Closes
Closes #9
Notes
Verified visually with a local dev server: an address + "guaranteed return" chat context renders "🔶 High — strong scam signals" with an orange border and the matched-pattern list "Pig-butchering scam — guaranteed return". Critical/Low levels weren't reachable in the current demo data without also flagging an address or lowering confidence, but the mapping was verified by reading
AnalyzeSendIntent's level derivation.🤖 Generated with Claude Code
Summary by CodeRabbit