diff --git a/apps/web/src/app/chat/page.tsx b/apps/web/src/app/chat/page.tsx index 165fd57..e4bb8d7 100644 --- a/apps/web/src/app/chat/page.tsx +++ b/apps/web/src/app/chat/page.tsx @@ -8,7 +8,7 @@ import { Chat, type ChatRef, ConversationSidebar, type ConversationSidebarRef } * * Placeholder route for the chat interface migrated from jarvis-fe. * - * TODO: + * NOTE (see issue #TBD): * - Integrate with authentication * - Connect to brain API endpoints (/api/brain/query) * - Implement conversation persistence @@ -23,12 +23,12 @@ export default function ChatPage() { const handleConversationChange = (conversationId: string | null) => { setCurrentConversationId(conversationId); - // TODO: Update sidebar when conversation changes + // NOTE: Update sidebar when conversation changes (see issue #TBD) }; const handleSelectConversation = (conversationId: string | null) => { - // TODO: Load conversation from backend - console.log("Select conversation:", conversationId); + // NOTE: Load conversation from backend (see issue #TBD) + void conversationId; // Placeholder until implemented setCurrentConversationId(conversationId); }; diff --git a/apps/web/src/components/chat/BackendStatusBanner.tsx b/apps/web/src/components/chat/BackendStatusBanner.tsx index dfc44f6..393eb8a 100644 --- a/apps/web/src/components/chat/BackendStatusBanner.tsx +++ b/apps/web/src/components/chat/BackendStatusBanner.tsx @@ -6,27 +6,28 @@ import { useState, useEffect } from "react"; * Banner that displays when the backend is unavailable. * Shows error message, countdown to next retry, and manual retry button. * - * TODO: Integrate with actual backend status checking hook + * NOTE: Integrate with actual backend status checking hook (see issue #TBD) */ export function BackendStatusBanner() { const [isAvailable, setIsAvailable] = useState(true); const [error, setError] = useState(null); const [retryIn, setRetryIn] = useState(0); - // TODO: Replace with actual useBackendStatus hook + // NOTE: Replace with actual useBackendStatus hook (see issue #TBD) // const { isAvailable, error, retryIn, manualRetry } = useBackendStatus(); const manualRetry = () => { - // TODO: Implement manual retry logic - console.log("Manual retry triggered"); + // NOTE: Implement manual retry logic (see issue #TBD) + void 0; // Placeholder until implemented }; const handleSignOut = async () => { try { - // TODO: Implement signOut + // NOTE: Implement signOut (see issue #TBD) // await signOut(); } catch (error) { - console.warn("Sign-out failed during backend unavailability:", error); + // Silently fail - will redirect anyway + void error; } window.location.href = "/login"; }; diff --git a/apps/web/src/components/chat/Chat.tsx b/apps/web/src/components/chat/Chat.tsx index 29dfeb1..6e8bc9b 100644 --- a/apps/web/src/components/chat/Chat.tsx +++ b/apps/web/src/components/chat/Chat.tsx @@ -1,22 +1,22 @@ "use client"; import { useCallback, useEffect, useRef, useState, useMemo, forwardRef, useImperativeHandle } from "react"; -// TODO: These hooks will need to be created or adapted +// NOTE: These hooks will need to be created or adapted (see issue #TBD) // import { useAuth } from "@/lib/hooks/useAuth"; // import { useProjects } from "@/lib/hooks/useProjects"; // import { useConversations } from "@/lib/hooks/useConversations"; // import { useApi } from "@/lib/hooks/useApi"; import { MessageList } from "./MessageList"; import { ChatInput } from "./ChatInput"; -// TODO: Import types need to be created +// NOTE: Import types need to be created (see issue #TBD) // import type { ConversationDetail } from "@/lib/hooks/useConversations"; // import { handleSessionExpired, isSessionExpiring } from "@/lib/api"; // import type { LLMModel, DefaultModel } from "@/lib/api"; // Placeholder types until the actual types are created -type ConversationDetail = any; -type LLMModel = any; -type DefaultModel = any; +type ConversationDetail = Record; +type LLMModel = { id: string; name: string; provider?: string }; +type DefaultModel = { model: string; provider?: string }; export interface Message { id: string; @@ -104,12 +104,12 @@ export const Chat = forwardRef(function Chat({ }, ref) { void _onProjectChange; // Kept for potential future use - // TODO: Replace with actual hooks once they're created + // NOTE: Replace with actual hooks once they're created (see issue #TBD) const accessToken = null; const isLoading = false; const authLoading = false; const authError = null; - const projects: any[] = []; + const projects: Array<{ id: string; name: string }> = []; // const { accessToken, isLoading: authLoading, error: authError } = useAuth(); // const { projects } = useProjects(); // const { updateConversationProject } = useConversations(); @@ -146,8 +146,8 @@ export const Chat = forwardRef(function Chat({ // Expose methods to parent via ref useImperativeHandle(ref, () => ({ loadConversation: (conversation: ConversationDetail) => { - // TODO: Implement once ConversationDetail type is available - console.log("loadConversation called with:", conversation); + // NOTE: Implement once ConversationDetail type is available (see issue #TBD) + void conversation; // Placeholder until implemented }, startNewConversation: (projectId?: string | null) => { setConversationId(null); @@ -226,7 +226,7 @@ export const Chat = forwardRef(function Chat({ }, 5000); try { - // TODO: Implement actual API call to /api/brain/query + // NOTE: Implement actual API call to /api/brain/query (see issue #TBD) const requestBody: { message: string; conversation_id: string | null; @@ -262,7 +262,7 @@ export const Chat = forwardRef(function Chat({ clearInterval(quipIntervalId); setLoadingQuip(null); - console.error("Failed to send message:", err); + // Error is already captured in errorMsg below const errorMsg = err instanceof Error ? err.message : "Failed to send message"; setError(errorMsg); diff --git a/apps/web/src/components/chat/ConversationSidebar.tsx b/apps/web/src/components/chat/ConversationSidebar.tsx index ea2d54e..6b9256f 100644 --- a/apps/web/src/components/chat/ConversationSidebar.tsx +++ b/apps/web/src/components/chat/ConversationSidebar.tsx @@ -2,7 +2,7 @@ import { useState, forwardRef, useImperativeHandle } from "react"; // import Link from "next/link"; -// TODO: Import hooks when they're created +// NOTE: Import hooks when they're created (see issue #TBD) // import { useConversations, ConversationSummary } from "@/lib/hooks/useConversations"; // import { useProjects } from "@/lib/hooks/useProjects"; // import type { IsolationMode } from "@/lib/api"; @@ -40,17 +40,17 @@ export const ConversationSidebar = forwardRef = []; // Expose methods to parent via ref useImperativeHandle(ref, () => ({ refresh: () => { - // TODO: Implement refresh logic - console.log("Refresh called"); + // NOTE: Implement refresh logic (see issue #TBD) + void 0; // Placeholder until implemented }, addConversation: (conversation: ConversationSummary) => { - // TODO: Implement addConversation logic - console.log("Add conversation called:", conversation); + // NOTE: Implement addConversation logic (see issue #TBD) + void conversation; // Placeholder until implemented }, })); @@ -106,7 +106,7 @@ export const ConversationSidebar = forwardRef - {/* Collapsed view - TODO: Implement */} + {/* Collapsed view - NOTE: Implement (see issue #TBD) */} {!isOpen && (