File tree Expand file tree Collapse file tree 4 files changed +19
-3
lines changed Expand file tree Collapse file tree 4 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ interface ChatHistoryListProps {
9
9
activeConversationId : string | null ;
10
10
onSelectConversation : ( conversationId : string ) => void ;
11
11
onCreateNewChat : ( ) => void ;
12
+ onCreateNewFolder : ( ) => void ;
12
13
onRenameConversation : ( conversationId : string , newTitle : string ) => void ;
13
14
onDeleteConversation : ( conversationId : string ) => void ;
14
15
}
@@ -18,6 +19,7 @@ export const ChatHistoryList: React.FC<ChatHistoryListProps> = ({
18
19
activeConversationId,
19
20
onSelectConversation,
20
21
onCreateNewChat,
22
+ onCreateNewFolder,
21
23
onRenameConversation,
22
24
onDeleteConversation,
23
25
} ) => {
@@ -253,7 +255,7 @@ export const ChatHistoryList: React.FC<ChatHistoryListProps> = ({
253
255
254
256
< div className = { `p-2 border-b border-gray-200 ${ isCollapsed ? 'opacity-0 pointer-events-none' : 'flex justify-between items-center' } ` } >
255
257
< button
256
- onClick = { onCreateNewChat }
258
+ onClick = { onCreateNewFolder }
257
259
className = "flex items-center justify-center p-2 text-sm font-medium text-gray-700 transition-colors bg-white border border-gray-300 rounded-md aspect-square hover:bg-gray-50 checked:outline-none checked:ring-2 checked:ring-blue-500"
258
260
>
259
261
< FolderPlus size = { 16 } />
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ const ConfirmDialog: React.FC<ConfirmDialogProps> = ({
71
71
} ;
72
72
73
73
return (
74
- < div className = "fixed inset-0 z-50 flex items-center justify-center bg-black bg-opacity-50" >
74
+ < div className = "fixed inset-0 z-50 flex items-center justify-center bg-black bg-opacity-50 mt-[29px] " >
75
75
< div
76
76
className = "relative w-full max-w-md p-6 mx-4 bg-white rounded-lg shadow-xl focus:outline-none"
77
77
onClick = { handleDialogClick }
Original file line number Diff line number Diff line change @@ -128,6 +128,20 @@ export const ChatPage: React.FC<ChatPageProps> = ({
128
128
}
129
129
} , [ SettingsService . getInstance ( ) . getSelectedModel ( ) , isServiceInitialized ] ) ;
130
130
131
+ // Create a new folder
132
+ const createNewFolder = useCallback ( async ( ) => {
133
+ if ( ! isServiceInitialized || ! chatServiceRef . current ) return ;
134
+
135
+ try {
136
+ const chatService = chatServiceRef . current ;
137
+
138
+ // Update the state with the new list of conversations
139
+
140
+ } catch ( error ) {
141
+ console . error ( 'Failed to create new folder:' , error ) ;
142
+ }
143
+ } , [ isServiceInitialized ] ) ;
144
+
131
145
// Handle sending a message with streaming
132
146
const handleSendMessage = async ( content : string ) => {
133
147
if ( ! activeConversationId || ! isServiceInitialized || ! chatServiceRef . current ) return ;
@@ -290,6 +304,7 @@ export const ChatPage: React.FC<ChatPageProps> = ({
290
304
activeConversationId = { activeConversationId }
291
305
onSelectConversation = { handleSelectConversation }
292
306
onCreateNewChat = { createNewChat }
307
+ onCreateNewFolder = { createNewFolder }
293
308
onRenameConversation = { handleRenameConversation }
294
309
onDeleteConversation = { handleDeleteConversation }
295
310
/>
Original file line number Diff line number Diff line change @@ -27,7 +27,6 @@ export interface Conversation {
27
27
export interface ConversationFolder {
28
28
folderId : string ;
29
29
folderName : string ;
30
- conversations : Conversation [ ] ;
31
30
createdAt : Date ;
32
31
updatedAt : Date ;
33
32
colorFlag : string ;
You can’t perform that action at this time.
0 commit comments