@@ -76,7 +76,7 @@ export const ChatPanel: React.FC = () => {
7676 const { sessionId : urlSessionId } = useParams < { sessionId : string } > ( ) ;
7777 const { activeSessionId, isProcessing, connectionStatus, checkServerStatus, sendMessage } =
7878 useSession ( ) ;
79-
79+
8080 // Use URL sessionId if available, fallback to activeSessionId
8181 const currentSessionId = urlSessionId || activeSessionId ;
8282 const groupedMessages = useAtomValue ( groupedMessagesAtom ) ;
@@ -85,7 +85,10 @@ export const ChatPanel: React.FC = () => {
8585 const { isReplayMode, cancelAutoPlay } = useReplayMode ( ) ;
8686
8787 // Use messages from current session
88- const activeMessages = currentSessionId && currentSessionId !== 'creating' ? groupedMessages [ currentSessionId ] || [ ] : [ ] ;
88+ const activeMessages =
89+ currentSessionId && currentSessionId !== 'creating'
90+ ? groupedMessages [ currentSessionId ] || [ ]
91+ : [ ] ;
8992
9093 // Auto-scroll functionality
9194 const {
@@ -123,7 +126,13 @@ export const ChatPanel: React.FC = () => {
123126 } ;
124127
125128 const renderOfflineBanner = ( ) => {
126- if ( connectionStatus . connected || ! currentSessionId || currentSessionId === 'creating' || isReplayMode ) return null ;
129+ if (
130+ connectionStatus . connected ||
131+ ! currentSessionId ||
132+ currentSessionId === 'creating' ||
133+ isReplayMode
134+ )
135+ return null ;
127136
128137 return (
129138 < motion . div
@@ -160,7 +169,8 @@ export const ChatPanel: React.FC = () => {
160169
161170 // Find research report in session
162171 const findResearchReport = ( ) => {
163- if ( ! currentSessionId || currentSessionId === 'creating' || ! allMessages [ currentSessionId ] ) return null ;
172+ if ( ! currentSessionId || currentSessionId === 'creating' || ! allMessages [ currentSessionId ] )
173+ return null ;
164174
165175 const sessionMessages = allMessages [ currentSessionId ] ;
166176 const reportMessage = [ ...sessionMessages ]
@@ -225,13 +235,15 @@ export const ChatPanel: React.FC = () => {
225235 variants = { itemVariants }
226236 className = "text-xl font-display font-bold mb-3 text-gray-800 dark:text-gray-200"
227237 >
228- { currentSessionId === 'creating' ? 'Creating session...' : `Welcome to ${ getAgentTitle ( ) } ` }
238+ { currentSessionId === 'creating'
239+ ? 'Creating session...'
240+ : `Welcome to ${ getAgentTitle ( ) } ` }
229241 </ motion . h2 >
230242 < motion . p
231243 variants = { itemVariants }
232244 className = "text-gray-600 dark:text-gray-400 mb-5 text-sm leading-relaxed"
233245 >
234- { currentSessionId === 'creating'
246+ { currentSessionId === 'creating'
235247 ? 'Please wait while we set up your chat session.'
236248 : 'Create a new chat session to get started with the AI assistant.' }
237249 </ motion . p >
@@ -380,7 +392,11 @@ export const ChatPanel: React.FC = () => {
380392 < ChatInput
381393 onSubmit = { sendMessage }
382394 isDisabled = {
383- ! currentSessionId || currentSessionId === 'creating' || isProcessing || ! connectionStatus . connected || isReplayMode
395+ ! currentSessionId ||
396+ currentSessionId === 'creating' ||
397+ isProcessing ||
398+ ! connectionStatus . connected ||
399+ isReplayMode
384400 }
385401 isProcessing = { isProcessing }
386402 connectionStatus = { connectionStatus }
0 commit comments