Feat: NewChat now have different ConversationID. Retains user's Memory #4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces significant improvements to how new conversations (chats) and drafts are managed in the chat application. The changes streamline the process of starting, creating, and updating conversations, especially around draft handling, and ensure consistent state management across components. The most important changes are grouped below by theme.
Conversation and Draft Management Enhancements:
startNewConversationcallback, which handles draft cleanup, initializes conversation state, and updates local storage and navigation. This replaces previous scattered logic and ensures only one draft conversation exists at a time. [1] [2] [3] [4]draftConversationId,removeDraftConversation,handleCreateConversation,handleUpdateRecipients) to robustly manage draft conversations, recipient updates, and creation of new chats from both the main app and child components. [1] [2] [3] [4] [5] [6] [7]Component Interface and Prop Updates:
ChatAreaand related components to accept new props for starting new conversations, creating conversations, and updating recipients, enabling better coordination between parent and child components regarding conversation state. [1] [2] [3] [4] [5]UI Consistency and Navigation:
startNewConversationlogic, ensuring consistent behavior whether starting a chat from the sidebar, chat area, or chat header. [1] [2] [3] [4]ChatHeader, replaced the "New Chat" link with a button that uses the new conversation creation logic, clearing the UI state and navigating to the new chat. [1] [2]Code Quality and Minor Improvements:
resolvedConversationIdvariable to simplify prop passing and draft handling in the main app component. [1] [2]These changes collectively make the conversation experience more robust, intuitive, and maintainable.

[Image]