Skip to content

feat: Complete chat history panel integration#44

Open
john-carroll-sw wants to merge 5 commits intoAzure-Samples:mainfrom
john-carroll-sw:main
Open

feat: Complete chat history panel integration#44
john-carroll-sw wants to merge 5 commits intoAzure-Samples:mainfrom
john-carroll-sw:main

Conversation

@john-carroll-sw
Copy link
Copy Markdown

  • Added chat history functionality to display transcriptions from both model responses and user inputs.
  • Modified App.tsx, types.ts, and history-panel.tsx to support the history panel logic.
  • Updated translation.json for localized strings related to the chat history.

This update enhances the user experience by providing a comprehensive view of the conversation history.

Screenshot 2024-10-30 140954

- Added chat history functionality to display transcriptions from both model responses and user inputs.
- Modified App.tsx, types.ts, and history-panel.tsx to support the history panel logic.
- Updated translation.json for localized strings related to the chat history.

This update enhances the user experience by providing a comprehensive view of the conversation history.
@john-carroll-sw
Copy link
Copy Markdown
Author

The screenshot is slightly misleading. The changes I am committing are only for the history panel pieces. I have not committed any UI changes that are for my demo around Starbucks AI Assistant. Apologies for the confusion in advance. I wanted to show the grounding files in the assistant's chat bubbles and this was my only working demo at the moment.

@john-carroll-sw
Copy link
Copy Markdown
Author

This is what the UI looks like. Open to suggestions on how the chat history can be shown. Right now it's the blue button in the middle.
image

@chuwik
Copy link
Copy Markdown
Collaborator

chuwik commented Nov 1, 2024

Thanks for the PR!

I'd render the 'Show Chat History' button in a smaller one, e.g.

<Button variant="outline" size="sm" className="rounded-full">
    <History className="mr-2 h-4 w-4" />
    Show history
</Button>

Comment thread app/frontend/src/types.ts Outdated
Comment thread app/frontend/src/types.ts Outdated
Comment thread app/frontend/src/locales/en/translation.json Outdated
Comment thread app/frontend/src/components/ui/history-panel.tsx Outdated
Comment thread app/frontend/src/components/ui/history-panel.tsx
Comment thread app/frontend/src/components/ui/history-panel.tsx Outdated
Comment thread app/frontend/src/components/ui/history-panel.tsx Outdated
Comment thread app/frontend/src/components/ui/history-panel.tsx
Comment thread app/frontend/src/components/ui/history-panel.tsx Outdated
Comment thread app/frontend/src/App.tsx Outdated
Comment thread app/frontend/src/App.tsx Outdated
Comment thread app/frontend/src/App.tsx Outdated
Comment thread app/frontend/src/App.tsx Outdated
Comment thread app/frontend/src/App.tsx Outdated
Comment thread app/frontend/src/types.ts Outdated
- Removed redundant comments in `App.tsx`, `history-panel.tsx`, and `types.ts`.
- Optimized date formatting for `history-panel.tsx` with global considerations.
- Corrected time duration in `history-panel.tsx` comment to match code.
- Improved timestamp handling in `history-panel.tsx` by reusing existing Date object.
- Updated `translation.json` to simplify phrases and avoid uppercase.
- Enhanced usage and optional parameters for `groundingFiles` in `types.ts`.
… rendering

- Use `Intl.DateTimeFormat` to format timestamps according to the user's locale.
- Utilize `navigator.language` to determine the user's preferred language.
- Ensure that timestamps are displayed in a format familiar to the user based on their language and regional settings.
  - For a user with the locale set to `en-US` (United States), the timestamp might be formatted as `2:30 PM`.
  - For a user with the locale set to `fr-FR` (France), the timestamp might be formatted as `14:30`.
- Update the current time every second to dynamically show the timestamp after 60 seconds have passed.
- Use `React.memo` to prevent unnecessary re-renders of child components and ensure efficient rendering logic.

This change improves the user experience by providing localized timestamp formatting and optimizing component rendering.
@john-carroll-sw
Copy link
Copy Markdown
Author

Current UI showing transcript history panel:

image

@pmuralikrishna111
Copy link
Copy Markdown

this is nice feature. i wanted to pull it upon merged.

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.

3 participants