Blank Screen After Bot Debate Result (Scores Judged, UI Not Shown)#360
Blank Screen After Bot Debate Result (Scores Judged, UI Not Shown)#360Naman-kr404 wants to merge 6 commits intoAOSSIE-Org:mainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughModified the bot opening-statement prompt to request bullet-point arguments; hardened frontend judgment handling and rendering to tolerate malformed/partial judge responses; small package.json indentation change. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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 |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
frontend/src/components/JudgementPopup.tsx (1)
296-316: Simplify redundant null-safe patterns.Since
getScoreAndReason()now guaranteesreasonis always a string (viaasStringhelper), the complex fallback pattern calling the function twice is unnecessary. The current code callsgetScoreAndReasontwice for each reason value.♻️ Suggested simplification
const player1Reasons = { - opening: getScoreAndReason( - 'opening_statement', - 'player1' - ).reason?.toLowerCase?.() ?? String(getScoreAndReason('opening_statement', 'player1').reason || '').toLowerCase(), + opening: getScoreAndReason('opening_statement', 'player1').reason.toLowerCase(), cross_questions: isUserBotFormat - ? (getScoreAndReason('cross_examination', 'player1').reason?.toLowerCase?.() ?? - String(getScoreAndReason('cross_examination', 'player1').reason || '').toLowerCase()) - : getScoreAndReason( - 'cross_examination_questions', - 'player1' - ).reason?.toLowerCase?.() ?? - String(getScoreAndReason('cross_examination_questions', 'player1').reason || '').toLowerCase(), + ? getScoreAndReason('cross_examination', 'player1').reason.toLowerCase() + : getScoreAndReason('cross_examination_questions', 'player1').reason.toLowerCase(), cross_answers: isUserBotFormat - ? (getScoreAndReason('answers', 'player1').reason?.toLowerCase?.() ?? - String(getScoreAndReason('answers', 'player1').reason || '').toLowerCase()) - : getScoreAndReason( - 'cross_examination_answers', - 'player1' - ).reason?.toLowerCase?.() ?? - String(getScoreAndReason('cross_examination_answers', 'player1').reason || '').toLowerCase(), - closing: - getScoreAndReason('closing', 'player1').reason?.toLowerCase?.() ?? - String(getScoreAndReason('closing', 'player1').reason || '').toLowerCase(), + ? getScoreAndReason('answers', 'player1').reason.toLowerCase() + : getScoreAndReason('cross_examination_answers', 'player1').reason.toLowerCase(), + closing: getScoreAndReason('closing', 'player1').reason.toLowerCase(), };🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@frontend/src/components/JudgementPopup.tsx` around lines 296 - 316, The repeated null-safe fallback calls to getScoreAndReason(...) should be simplified because reason is guaranteed to be a string; replace each double-call pattern with a single call and reuse its .reason (e.g., call getScoreAndReason('opening_statement','player1') once and compute .reason.toLowerCase()), and do the same for keys cross_questions, cross_answers, closing while preserving the isUserBotFormat conditional branches and using the single-call result in each branch to avoid duplicate invocation.frontend/src/Pages/DebateRoom.tsx (1)
724-733: Remove commented-out dead code.The commented line
{/* {msg.text} */}should be removed as it's no longer needed.🧹 Suggested fix
- {/* {msg.text} */} - {msg.text.includes("- ") ? ( + {msg.text.includes("- ") ? (🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@frontend/src/Pages/DebateRoom.tsx` around lines 724 - 733, Remove the dead commented JSX line containing "{/* {msg.text} */}" inside the DebateRoom component's render block: open the JSX that conditionally renders msg.text (the ternary using msg.text.includes and the <ul> / <div className="whitespace-pre-line"> branches) and delete that commented-out line so only the active rendering logic remains; ensure no other comments or whitespace changes affect the surrounding JSX.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@frontend/src/components/JudgementPopup.tsx`:
- Around line 296-316: The repeated null-safe fallback calls to
getScoreAndReason(...) should be simplified because reason is guaranteed to be a
string; replace each double-call pattern with a single call and reuse its
.reason (e.g., call getScoreAndReason('opening_statement','player1') once and
compute .reason.toLowerCase()), and do the same for keys cross_questions,
cross_answers, closing while preserving the isUserBotFormat conditional branches
and using the single-call result in each branch to avoid duplicate invocation.
In `@frontend/src/Pages/DebateRoom.tsx`:
- Around line 724-733: Remove the dead commented JSX line containing "{/*
{msg.text} */}" inside the DebateRoom component's render block: open the JSX
that conditionally renders msg.text (the ternary using msg.text.includes and the
<ul> / <div className="whitespace-pre-line"> branches) and delete that
commented-out line so only the active rendering logic remains; ensure no other
comments or whitespace changes affect the surrounding JSX.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 658ce919-7dc9-48c6-aaac-137a78e75387
⛔ Files ignored due to path filters (1)
frontend/package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (4)
backend/services/debatevsbot.gofrontend/package.jsonfrontend/src/Pages/DebateRoom.tsxfrontend/src/components/JudgementPopup.tsx
Addressed Issues:
Fixes ##306, ##347
Screenshots/Recordings:
After

Summary by CodeRabbit
Bug Fixes
New Features
Chores