Skip to content

Commit 8bf3ea0

Browse files
committed
style: format code with prettier
- Format ChatPanel.tsx and WelcomePage.tsx - Consistent code style across modified files
1 parent 9506ad8 commit 8bf3ea0

2 files changed

Lines changed: 26 additions & 11 deletions

File tree

multimodal/tarko/agent-web-ui/src/standalone/chat/ChatPanel.tsx

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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}

multimodal/tarko/agent-web-ui/src/standalone/home/WelcomePage.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,16 @@ const WelcomePage: React.FC = () => {
2828

2929
// Navigate immediately to special "creating" state
3030
navigate('/creating');
31-
31+
3232
try {
3333
// Create session in background
3434
const sessionId = await createSession();
35-
35+
3636
// Replace with real session ID
3737
navigate(`/${sessionId}`, { replace: true });
38-
38+
3939
// Send message
4040
sendMessage(content).catch(console.error);
41-
4241
} catch (error) {
4342
console.error('Failed to create session:', error);
4443
// Navigate back to home on error

0 commit comments

Comments
 (0)