@@ -60,6 +60,7 @@ export function ChatWindow() {
6060 } ;
6161 } , [ accessToken , memoizedConnect , isConnected ] ) ;
6262
63+ // Show thread list even when no active thread
6364 if ( ! accessToken ) {
6465 return (
6566 < div className = "flex items-center justify-center h-full" >
@@ -70,21 +71,9 @@ export function ChatWindow() {
7071 ) ;
7172 }
7273
73- if ( ! activeThreadId ) {
74- return (
75- < div className = "flex items-center justify-center h-[calc(100vh-4rem)] backdrop-blur-sm" >
76- < div className = "text-center space-y-4 p-4 sm:p-6 lg:p-8 -mt-20" >
77- < div className = "flex justify-center gap-3" >
78- < CreateThreadButton />
79- </ div >
80- </ div >
81- </ div >
82- ) ;
83- }
84-
8574 return (
8675 < div className = "relative flex h-[94dvh] md:h-[100dvh] w-full" >
87- { /* Fixed Sidebar */ }
76+ { /* Fixed Sidebar - Always visible regardless of active thread */ }
8877 < div
8978 className = { `
9079 hidden md:block fixed left-0 top-15 h-full
@@ -126,11 +115,13 @@ export function ChatWindow() {
126115
127116 < div className = "flex items-center gap-2 min-w-0 flex-1" >
128117 < div >
129- < AgentWalletSelector
130- selectedAgentId = { selectedAgentId }
131- onSelect = { setSelectedAgent }
132- disabled = { isChatLoading || ! isConnected }
133- />
118+ { activeThreadId && (
119+ < AgentWalletSelector
120+ selectedAgentId = { selectedAgentId }
121+ onSelect = { setSelectedAgent }
122+ disabled = { isChatLoading || ! isConnected }
123+ />
124+ ) }
134125 </ div >
135126 </ div >
136127 </ div >
@@ -140,35 +131,51 @@ export function ChatWindow() {
140131 </ div >
141132 </ div >
142133
143- { /* Message list */ }
144- < div className = "flex-1 overflow-hidden w-full min-w-0 max-w-full" >
145- < ScrollArea className = "h-full w-full pb-4" >
146- < div className = "flex flex-col justify-end min-h-full w-full max-w-full" >
147- { chatError && (
148- < Alert
149- variant = "destructive"
150- className = "mx-2 md:mx-4 my-2 md:my-4"
151- >
152- < AlertDescription > { chatError } </ AlertDescription >
153- </ Alert >
154- ) }
155- < MessageList messages = { threadMessages } />
134+ { ! activeThreadId ? (
135+ < div className = "flex items-center justify-center h-full backdrop-blur-sm" >
136+ < div className = "text-center space-y-4 p-4 sm:p-6 lg:p-8 -mt-20" >
137+ < div className = "flex justify-center gap-3" >
138+ < p className = "text-muted-foreground mb-4" >
139+ Select a thread or create a new one
140+ </ p >
141+ </ div >
142+ </ div >
143+ </ div >
144+ ) : (
145+ < >
146+ { /* Message list with increased bottom padding */ }
147+ < div className = "flex-1 overflow-hidden w-full min-w-0 max-w-full" >
148+ < ScrollArea className = "h-full w-full" >
149+ < div className = "flex flex-col justify-end min-h-full w-full max-w-full" >
150+ { chatError && (
151+ < Alert
152+ variant = "destructive"
153+ className = "mx-2 md:mx-4 my-2 md:my-4"
154+ >
155+ < AlertDescription > { chatError } </ AlertDescription >
156+ </ Alert >
157+ ) }
158+ < MessageList messages = { threadMessages } />
159+ { /* Add extra padding div at the bottom to ensure content isn't hidden */ }
160+ < div className = "h-32" > </ div >
161+ </ div >
162+ </ ScrollArea >
156163 </ div >
157- </ ScrollArea >
158- </ div >
159164
160- { /* Input with shadow */ }
161- < div className = "sticky bottom-0 w-full min-w-0 pb-safe shadow-lg z-20" >
162- < div className = "px-2 md:px-4" >
163- < div className = "relative" >
164- < ChatInput
165- selectedAgentId = { selectedAgentId }
166- onAgentSelect = { setSelectedAgent }
167- disabled = { isChatLoading || ! isConnected }
168- />
165+ { /* Input with shadow */ }
166+ < div className = "sticky bottom-0 w-full min-w-0 pb-safe shadow-lg z-20 bg-background" >
167+ < div className = "px-2 md:px-4 pt-2" >
168+ < div className = "relative" >
169+ < ChatInput
170+ selectedAgentId = { selectedAgentId }
171+ onAgentSelect = { setSelectedAgent }
172+ disabled = { isChatLoading || ! isConnected }
173+ />
174+ </ div >
175+ </ div >
169176 </ div >
170- </ div >
171- </ div >
177+ </ >
178+ ) }
172179 </ div >
173180 </ div >
174181 ) ;
0 commit comments