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

chore: add local storage for image toggle #486

Merged
merged 4 commits into from
Dec 11, 2024
Merged

chore: add local storage for image toggle #486

merged 4 commits into from
Dec 11, 2024

Conversation

NingLu
Copy link
Collaborator

@NingLu NingLu commented Dec 11, 2024

Fixes #

🤖 AI-Generated PR Description (Powered by Amazon Bedrock)

Description

This pull request includes updates to the localization files (en.json and zh.json) to add new strings and modify existing ones for the chatbot feature. Additionally, it modifies the ChatBot.tsx component to incorporate the new localized strings and updates the types in index.ts to support the new chatbot functionality.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

File Stats Summary

File number involved in this PR: 4, unfold to see the details:

The file changes summary is as follows:

Files
Changes
Change Summary
source/portal/src/types/index.ts 1 added, 0 removed The code change adds a new property 'chatbotId' of type string to the SessionMessage interface and maintains the existing properties.
source/portal/src/locale/zh.json 1 added, 0 removed 这个代码更改在界面上添加了一个"显示图片"的选项,可能用于控制是否显示聊天机器人响应中的图像。
source/portal/src/locale/en.json 1 added, 0 removed The code change adds a new string key "showFigures" to the existing object, likely for displaying figures or images in the user interface.
source/portal/src/pages/chatbot/ChatBot.tsx 62 added, 23 removed The code changes introduce the following functionality:
  1. Load the previously used chatbot ID from local storage history on component mount.
  2. Store the chatbot ID from the first message in local storage history for future use.
  3. Add a toggle to show/hide figures (images) in the chat messages.
  4. Persist the "Show Figures" toggle state in local storage. |

@NingLu NingLu merged commit 71d9046 into dev Dec 11, 2024
6 checks passed
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.

1 participant