Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Complete chat history panel integration #44

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

john-carroll-sw
Copy link

  • 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
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
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
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>

app/frontend/src/types.ts Outdated Show resolved Hide resolved
app/frontend/src/types.ts Outdated Show resolved Hide resolved
app/frontend/src/App.tsx Outdated Show resolved Hide resolved
app/frontend/src/App.tsx Outdated Show resolved Hide resolved
app/frontend/src/App.tsx Outdated Show resolved Hide resolved
app/frontend/src/App.tsx Outdated Show resolved Hide resolved
app/frontend/src/App.tsx Outdated Show resolved Hide resolved
app/frontend/src/types.ts Outdated Show resolved Hide resolved
- 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
Author

Current UI showing transcript history panel:

image

@pmuralikrishna111
Copy link

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