Skip to content

Conversation

@knajjars
Copy link
Collaborator

@knajjars knajjars commented Jun 25, 2024

AI Description

This pull request makes changes to the SettingsDrawer and Conversation components in the coral_web interface, and also updates the chat.ts file.

Summary

  • The SettingsDrawer component in SettingsDrawer.tsx has been modified to include a key prop for each tab's div element, ensuring a unique identifier for efficient React rendering and reconciliation.
  • The Conversation component in index.tsx now includes the resetConversation property from the useConversationStore hook. It also updates the useRouteChange hook to invoke resetConversation when the route changes.
  • The chat.ts file has removed the useRouter import from 'next/router' and the associated usage of useRouter in the useChat function.

Details

SettingsDrawer.tsx and SettingsDrawer.tsx

  • The tabs.map function now returns a div element with a unique key prop set to t.name. This ensures that each tab's content is wrapped in a distinct HTML element with a unique identifier, facilitating efficient rendering and updates in React.

index.tsx

  • The resetConversation property is now destructured from the useConversationStore hook.
  • The useRouteChange hook now takes an options object as an argument, with an onRouteChangeStart property that resets the conversation when the route changes.

chat.ts

  • The useRouter import from 'next/router' has been removed, along with the usage of useRouter in the useChat function.

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (main@5213e11). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #275   +/-   ##
=======================================
  Coverage        ?   85.66%           
=======================================
  Files           ?      153           
  Lines           ?     5720           
  Branches        ?        0           
=======================================
  Hits            ?     4900           
  Misses          ?      820           
  Partials        ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@wujessica wujessica changed the title fix(toolkit): reset conversation on route change coral-web: reset conversation on route change Jun 25, 2024
@knajjars knajjars merged commit 2dd1cb1 into main Jun 25, 2024
@knajjars knajjars deleted the TLK-729 branch June 25, 2024 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants