diff --git a/frontend/src/Pages/Game.tsx b/frontend/src/Pages/Game.tsx index 0b7d1f31..16aa8135 100644 --- a/frontend/src/Pages/Game.tsx +++ b/frontend/src/Pages/Game.tsx @@ -14,7 +14,7 @@ const Game: React.FC = () => { gameResult: { isReady: false, isWinner: false, - points: false, + points: 0, totalPoints: 0, evaluationMessage: "no data", }, @@ -32,10 +32,12 @@ const Game: React.FC = () => { }); const websocketRef = useRef(null); - const lastTypingStateRef = useRef(false); - const lastSpeakingStateRef = useRef(false); + const _lastTypingStateRef = useRef(false); + const _lastSpeakingStateRef = useRef(false); + void _lastTypingStateRef; // Reserved for typing indicator feature + void _lastSpeakingStateRef; // Reserved for speaking indicator feature - const sendWebSocketMessage = useCallback((payload: Record) => { + const _sendWebSocketMessage = useCallback((payload: Record) => { const ws = websocketRef.current; if (ws?.readyState === WebSocket.OPEN) { ws.send(JSON.stringify(payload)); @@ -43,6 +45,7 @@ const Game: React.FC = () => { console.warn("Attempted to send message while WebSocket was not open.", payload); } }, []); + void _sendWebSocketMessage; // Reserved for future WebSocket messaging type GameWebSocketMessage = { type: string; diff --git a/frontend/src/Pages/OnlineDebateRoom.tsx b/frontend/src/Pages/OnlineDebateRoom.tsx index 613c5df6..f61fc8b6 100644 --- a/frontend/src/Pages/OnlineDebateRoom.tsx +++ b/frontend/src/Pages/OnlineDebateRoom.tsx @@ -140,7 +140,7 @@ const BASE_URL = import.meta.env.VITE_BASE_URL || window.location.origin; const WS_BASE_URL = BASE_URL.replace( /^https?/, - (match) => (match === "https" ? "wss" : "ws") + (match: string) => (match === "https" ? "wss" : "ws") ); diff --git a/frontend/src/Pages/TeamDebateRoom.tsx b/frontend/src/Pages/TeamDebateRoom.tsx index 048853aa..a77873de 100644 --- a/frontend/src/Pages/TeamDebateRoom.tsx +++ b/frontend/src/Pages/TeamDebateRoom.tsx @@ -653,7 +653,7 @@ const TeamDebateRoom: React.FC = () => { }, [timer, debatePhase, isMyTurn, speechTranscripts, localRole, debateId]); useEffect(() => { - currentUserIdRef.current = currentUser?.id; + currentUserIdRef.current = currentUser?.id ?? null; myTeamIdRef.current = myTeamId; isTeam1Ref.current = isTeam1; debatePhaseRef.current = debatePhase; @@ -738,7 +738,8 @@ const TeamDebateRoom: React.FC = () => { const amTeam1 = isTeam1Ref.current; const currentMyTeamId = myTeamIdRef.current; const currentUserId = currentUserIdRef.current; - const currentPhase = debatePhaseRef.current; + const _currentPhase = debatePhaseRef.current; + void _currentPhase; // Available for phase-aware message handling switch (data.type) { case "stateSync": { diff --git a/frontend/src/components/CommentTree.tsx b/frontend/src/components/CommentTree.tsx index 56c19ef4..9d7cfca5 100644 --- a/frontend/src/components/CommentTree.tsx +++ b/frontend/src/components/CommentTree.tsx @@ -4,7 +4,6 @@ import { useUser } from '../hooks/useUser'; import ProfileHover from './ProfileHover'; import UserProfileModal from './UserProfileModal'; import { - commentsByTranscriptAtom, getCommentsForTranscriptAtom, setCommentsForTranscriptAtom, addCommentToTranscriptAtom, @@ -229,8 +228,9 @@ const CommentTree: React.FC = ({ const { user } = useUser(); const [commentsAtom] = useAtom(getCommentsForTranscriptAtom(transcriptId)); const [, setCommentsAtom] = useAtom(setCommentsForTranscriptAtom(transcriptId)); - const [, addCommentAtom] = useAtom(addCommentToTranscriptAtom(transcriptId)); + const [, _addCommentAtom] = useAtom(addCommentToTranscriptAtom(transcriptId)); const [, removeCommentAtom] = useAtom(removeCommentFromTranscriptAtom(transcriptId)); + void _addCommentAtom; // Reserved for future use const [comments, setComments] = useState([]); const [loading, setLoading] = useState(true); @@ -392,7 +392,8 @@ const CommentTree: React.FC = ({ } const result = await response.json(); - const newComment: Comment = result.comment; + const _newComment: Comment = result.comment; + void _newComment; // Result used via fetchComments refresh // Fetch updated comments (including the new one) and update atom await fetchComments(); diff --git a/frontend/src/components/Header.tsx b/frontend/src/components/Header.tsx index 7a331488..7a195da2 100644 --- a/frontend/src/components/Header.tsx +++ b/frontend/src/components/Header.tsx @@ -1,6 +1,6 @@ import React, { useState, useContext, useEffect } from "react"; import { NavLink, useLocation, useNavigate } from "react-router-dom"; -import { Bell, Menu, X, Home, BarChart, User, Info, LogOut, Check } from "lucide-react"; +import { Bell, Menu, X, Home, BarChart, User, Info, LogOut } from "lucide-react"; import { useAtom } from "jotai"; import { userAtom } from "@/state/userAtom"; import { AuthContext } from "@/context/authContext"; diff --git a/frontend/src/components/JudgementPopup.tsx b/frontend/src/components/JudgementPopup.tsx index 1640dacb..92dd8575 100644 --- a/frontend/src/components/JudgementPopup.tsx +++ b/frontend/src/components/JudgementPopup.tsx @@ -113,6 +113,7 @@ const JudgmentPopup: React.FC = ({ botName, userStance, botStance, + botDesc, forRole, againstRole, localRole = null, diff --git a/frontend/src/components/SpeechTranscripts.tsx b/frontend/src/components/SpeechTranscripts.tsx index e2127db0..c0dc2202 100644 --- a/frontend/src/components/SpeechTranscripts.tsx +++ b/frontend/src/components/SpeechTranscripts.tsx @@ -3,11 +3,13 @@ import React from 'react'; interface SpeechTranscriptsProps { transcripts: { [key: string]: string }; currentPhase: string; + liveTranscript?: string; } const SpeechTranscripts: React.FC = ({ transcripts, currentPhase, + liveTranscript, }) => { const phases = [ 'openingFor', @@ -77,6 +79,11 @@ const SpeechTranscripts: React.FC = ({
{transcript}
+ ) : isCurrentPhase && liveTranscript ? ( +
+ {liveTranscript} + +
) : (
No transcript available yet diff --git a/frontend/src/services/teamDebateService.ts b/frontend/src/services/teamDebateService.ts index 997c97b9..ef43bdb5 100644 --- a/frontend/src/services/teamDebateService.ts +++ b/frontend/src/services/teamDebateService.ts @@ -169,7 +169,7 @@ export const getMatchmakingPool = async (): Promise throw new Error("Failed to get matchmaking pool"); } - const data: MatchmakingPoolResponse = await response.json(); + const data: TeamMatchmakingPoolResponse = await response.json(); return data; }; diff --git a/package.json b/package.json new file mode 100644 index 00000000..8f1bfd68 --- /dev/null +++ b/package.json @@ -0,0 +1,22 @@ +{ + "name": "debateai-monorepo", + "version": "1.0.0", + "private": true, + "description": "DebateAI Monorepo - Run frontend and backend together", + "scripts": { + "dev": "concurrently -n \"FE,BE\" -c \"cyan,yellow\" \"npm run dev:frontend\" \"npm run dev:backend\"", + "dev:frontend": "cd frontend && npm run dev", + "dev:backend": "cd backend && go run ./cmd/server/", + "build": "concurrently \"npm run build:frontend\" \"npm run build:backend\"", + "build:frontend": "cd frontend && npm run build", + "build:backend": "cd backend && go build ./cmd/server/", + "install:frontend": "cd frontend && npm install", + "install:all": "npm install && npm run install:frontend" + }, + "devDependencies": { + "concurrently": "^8.2.2" + }, + "engines": { + "node": ">=18.0.0" + } +}