diff --git a/app/components/header/Header.tsx b/app/components/header/Header.tsx index 15cf4bfbd..8b2e81f76 100644 --- a/app/components/header/Header.tsx +++ b/app/components/header/Header.tsx @@ -24,17 +24,19 @@ export function Header() { - - {() => } - - {chat.started && ( - - {() => ( -
- -
- )} -
+ {chat.started && ( // Display ChatDescription and HeaderActionButtons only when the chat has started. + <> + + {() => } + + + {() => ( +
+ +
+ )} +
+ )} ); diff --git a/app/components/sidebar/HistoryItem.tsx b/app/components/sidebar/HistoryItem.tsx index 4c284359d..b228edbb7 100644 --- a/app/components/sidebar/HistoryItem.tsx +++ b/app/components/sidebar/HistoryItem.tsx @@ -1,6 +1,9 @@ +import { useParams } from '@remix-run/react'; +import { classNames } from '~/utils/classNames'; import * as Dialog from '@radix-ui/react-dialog'; import { type ChatHistoryItem } from '~/lib/persistence'; import WithTooltip from '~/components/ui/Tooltip'; +import { useEditChatDescription } from '~/lib/hooks'; interface HistoryItemProps { item: ChatHistoryItem; @@ -10,48 +13,115 @@ interface HistoryItemProps { } export function HistoryItem({ item, onDelete, onDuplicate, exportChat }: HistoryItemProps) { + const { id: urlId } = useParams(); + const isActiveChat = urlId === item.urlId; + + const { editing, handleChange, handleBlur, handleSubmit, handleKeyDown, currentDescription, toggleEditMode } = + useEditChatDescription({ + initialDescription: item.description, + customChatId: item.id, + syncWithGlobalStore: isActiveChat, + }); + + const renderDescriptionForm = ( +
+ +