File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
frontend/src/components/ChatHistory Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -682,7 +682,7 @@ async def rename_conversation():
682682
683683 ## update the title
684684 title = request_json .get ("title" , None )
685- if not title :
685+ if not title or title . strip () == "" :
686686 return jsonify ({"error" : "title is required" }), 400
687687 conversation ["title" ] = title
688688 updated_conversation = await cosmos_conversation_client .upsert_conversation (
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ import { AppStateContext } from '../../state/AppProvider'
2525import { GroupedChatHistory } from './ChatHistoryList'
2626
2727import styles from './ChatHistoryPanel.module.css'
28+ import _ from 'lodash'
2829
2930interface ChatHistoryListItemCellProps {
3031 item ?: Conversation
@@ -125,6 +126,17 @@ export const ChatHistoryListItemCell: React.FC<ChatHistoryListItemCellProps> = (
125126 if ( errorRename || renameLoading ) {
126127 return
127128 }
129+ if ( _ . trim ( editTitle ) === "" ) {
130+ setErrorRename ( 'Error: Title is required.' )
131+ setTimeout ( ( ) => {
132+ setErrorRename ( undefined )
133+ setTextFieldFocused ( true )
134+ if ( textFieldRef . current ) {
135+ textFieldRef . current . focus ( )
136+ }
137+ } , 5000 )
138+ return
139+ }
128140 if ( editTitle == item . title ) {
129141 setErrorRename ( 'Error: Enter a new title to proceed.' )
130142 setTimeout ( ( ) => {
You can’t perform that action at this time.
0 commit comments