From a834ba875971b6afa4013cffa922aa78510a86b5 Mon Sep 17 00:00:00 2001 From: Joel Date: Wed, 30 Aug 2023 17:32:32 +0800 Subject: [PATCH] feat: support rename conversation (#1056) --- web/app/components/app/chat/index.tsx | 2 + .../assets/vender/line/general/pin-02.svg | 3 + web/app/components/base/icons/script.js | 2 + .../base/icons/src/public/common/Dify.tsx | 2 + .../base/icons/src/public/common/Github.tsx | 2 + .../src/public/common/MessageChatSquare.tsx | 2 + .../base/icons/src/public/files/Csv.tsx | 2 + .../base/icons/src/public/files/Md.tsx | 2 + .../base/icons/src/public/llm/Anthropic.tsx | 2 + .../icons/src/public/llm/AnthropicText.tsx | 2 + .../src/public/llm/AzureOpenaiService.tsx | 2 + .../src/public/llm/AzureOpenaiServiceText.tsx | 2 + .../base/icons/src/public/llm/Azureai.tsx | 2 + .../base/icons/src/public/llm/AzureaiText.tsx | 2 + .../base/icons/src/public/llm/Chatglm.tsx | 2 + .../base/icons/src/public/llm/ChatglmText.tsx | 2 + .../base/icons/src/public/llm/Gpt3.tsx | 2 + .../base/icons/src/public/llm/Gpt4.tsx | 2 + .../base/icons/src/public/llm/Huggingface.tsx | 2 + .../icons/src/public/llm/HuggingfaceText.tsx | 2 + .../src/public/llm/HuggingfaceTextHub.tsx | 2 + .../icons/src/public/llm/IflytekSpark.tsx | 2 + .../icons/src/public/llm/IflytekSparkText.tsx | 2 + .../src/public/llm/IflytekSparkTextCn.tsx | 2 + .../base/icons/src/public/llm/Microsoft.tsx | 2 + .../base/icons/src/public/llm/OpenaiBlack.tsx | 2 + .../base/icons/src/public/llm/OpenaiBlue.tsx | 2 + .../base/icons/src/public/llm/OpenaiGreen.tsx | 2 + .../base/icons/src/public/llm/OpenaiText.tsx | 2 + .../src/public/llm/OpenaiTransparent.tsx | 2 + .../icons/src/public/llm/OpenaiViolet.tsx | 2 + .../base/icons/src/public/llm/Openllm.tsx | 2 + .../base/icons/src/public/llm/OpenllmText.tsx | 2 + .../base/icons/src/public/llm/Replicate.tsx | 2 + .../icons/src/public/llm/ReplicateText.tsx | 2 + .../icons/src/public/llm/XorbitsInference.tsx | 2 + .../src/public/llm/XorbitsInferenceText.tsx | 2 + .../base/icons/src/public/model/Checked.tsx | 2 + .../base/icons/src/public/plugins/Google.tsx | 2 + .../icons/src/public/plugins/WebReader.tsx | 2 + .../icons/src/public/plugins/Wikipedia.tsx | 2 + .../base/icons/src/public/thought/DataSet.tsx | 2 + .../base/icons/src/public/thought/Loading.tsx | 2 + .../base/icons/src/public/thought/Search.tsx | 2 + .../icons/src/public/thought/ThoughtList.tsx | 2 + .../icons/src/public/thought/WebReader.tsx | 2 + .../line/alertsAndFeedback/AlertCircle.tsx | 2 + .../vender/line/arrows/ArrowNarrowLeft.tsx | 2 + .../src/vender/line/arrows/ArrowUpRight.tsx | 2 + .../src/vender/line/arrows/ChevronDown.tsx | 2 + .../vender/line/arrows/ChevronDownDouble.tsx | 2 + .../src/vender/line/arrows/ChevronRight.tsx | 2 + .../src/vender/line/arrows/RefreshCw05.tsx | 2 + .../src/vender/line/development/Container.tsx | 2 + .../vender/line/development/Database01.tsx | 2 + .../vender/line/development/Database03.tsx | 2 + .../vender/line/development/PuzzlePiece01.tsx | 2 + .../src/vender/line/files/FilePlus02.tsx | 2 + .../icons/src/vender/line/general/AtSign.tsx | 2 + .../icons/src/vender/line/general/Check.tsx | 2 + .../vender/line/general/DotsHorizontal.tsx | 2 + .../icons/src/vender/line/general/Edit03.tsx | 2 + .../icons/src/vender/line/general/Hash02.tsx | 2 + .../src/vender/line/general/HelpCircle.tsx | 2 + .../src/vender/line/general/InfoCircle.tsx | 2 + .../vender/line/general/LinkExternal01.tsx | 2 + .../vender/line/general/LinkExternal02.tsx | 2 + .../src/vender/line/general/Loading02.tsx | 2 + .../src/vender/line/general/LogOut01.tsx | 2 + .../icons/src/vender/line/general/Pin02.json | 29 ++++++++ .../icons/src/vender/line/general/Pin02.tsx | 16 +++++ .../icons/src/vender/line/general/Plus.tsx | 2 + .../src/vender/line/general/SearchLg.tsx | 2 + .../icons/src/vender/line/general/Trash03.tsx | 2 + .../base/icons/src/vender/line/general/X.tsx | 2 + .../icons/src/vender/line/general/XClose.tsx | 2 + .../icons/src/vender/line/general/index.ts | 1 + .../icons/src/vender/line/layout/Grid01.tsx | 2 + .../src/vender/line/mapsAndTravel/Globe01.tsx | 2 + .../line/mediaAndDevices/Microphone01.tsx | 2 + .../src/vender/line/shapes/CubeOutline.tsx | 2 + .../icons/src/vender/line/users/User01.tsx | 2 + .../icons/src/vender/line/users/Users01.tsx | 2 + .../solid/FinanceAndECommerce/Scales02.tsx | 2 + .../solid/alertsAndFeedback/AlertCircle.tsx | 2 + .../solid/alertsAndFeedback/AlertTriangle.tsx | 2 + .../vender/solid/development/Container.tsx | 2 + .../vender/solid/development/Database02.tsx | 2 + .../vender/solid/development/Database03.tsx | 2 + .../solid/development/PuzzlePiece01.tsx | 2 + .../solid/development/TerminalSquare.tsx | 2 + .../icons/src/vender/solid/editor/Brush01.tsx | 2 + .../src/vender/solid/education/Beaker02.tsx | 2 + .../src/vender/solid/general/CheckCircle.tsx | 2 + .../src/vender/solid/general/Download02.tsx | 2 + .../src/vender/solid/general/Target04.tsx | 2 + .../src/vender/solid/general/XCircle.tsx | 2 + .../icons/src/vender/solid/layout/Grid01.tsx | 2 + .../solid/mediaAndDevices/Microphone01.tsx | 2 + .../solid/mediaAndDevices/Sliders02.tsx | 2 + .../solid/mediaAndDevices/StopCircle.tsx | 2 + .../src/vender/solid/security/Lock01.tsx | 2 + .../icons/src/vender/solid/users/User01.tsx | 2 + .../icons/src/vender/solid/users/Users01.tsx | 2 + .../explore/item-operation/index.tsx | 28 ++++---- .../universal-chat/hooks/use-conversation.ts | 1 + .../explore/universal-chat/index.tsx | 25 +++++++ .../share/chat/hooks/use-conversation.ts | 1 + web/app/components/share/chat/index.tsx | 26 +++++++ .../components/share/chat/sidebar/index.tsx | 6 ++ .../share/chat/sidebar/list/index.tsx | 70 +++++++++++++++++-- .../share/chat/sidebar/rename-modal/index.tsx | 47 +++++++++++++ web/i18n/lang/common.en.ts | 6 ++ web/i18n/lang/common.zh.ts | 6 ++ web/i18n/lang/explore.en.ts | 1 + web/i18n/lang/explore.zh.ts | 1 + web/service/share.ts | 4 ++ web/service/universal-chat.ts | 4 ++ 118 files changed, 459 insertions(+), 16 deletions(-) create mode 100644 web/app/components/base/icons/assets/vender/line/general/pin-02.svg create mode 100644 web/app/components/base/icons/src/vender/line/general/Pin02.json create mode 100644 web/app/components/base/icons/src/vender/line/general/Pin02.tsx create mode 100644 web/app/components/share/chat/sidebar/rename-modal/index.tsx diff --git a/web/app/components/app/chat/index.tsx b/web/app/components/app/chat/index.tsx index 5f67001d98c..c97ec9da1cb 100644 --- a/web/app/components/app/chat/index.tsx +++ b/web/app/components/app/chat/index.tsx @@ -24,6 +24,7 @@ import type { DataSet } from '@/models/datasets' export type IChatProps = { configElem?: React.ReactNode chatList: IChatItem[] + controlChatUpdateAllConversation?: number /** * Whether to display the editing area and rating status */ @@ -55,6 +56,7 @@ export type IChatProps = { const Chat: FC = ({ configElem, chatList, + controlChatUpdateAllConversation, feedbackDisabled = false, isHideFeedbackEdit = false, isHideSendInput = false, diff --git a/web/app/components/base/icons/assets/vender/line/general/pin-02.svg b/web/app/components/base/icons/assets/vender/line/general/pin-02.svg new file mode 100644 index 00000000000..023e6e4fb52 --- /dev/null +++ b/web/app/components/base/icons/assets/vender/line/general/pin-02.svg @@ -0,0 +1,3 @@ + + + diff --git a/web/app/components/base/icons/script.js b/web/app/components/base/icons/script.js index f81b45bfd98..93ceb0a1840 100644 --- a/web/app/components/base/icons/script.js +++ b/web/app/components/base/icons/script.js @@ -64,6 +64,8 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = '<%= svgName %>' + export default Icon `.trim()) diff --git a/web/app/components/base/icons/src/public/common/Dify.tsx b/web/app/components/base/icons/src/public/common/Dify.tsx index 59e8a6356b6..7b5e68f7467 100644 --- a/web/app/components/base/icons/src/public/common/Dify.tsx +++ b/web/app/components/base/icons/src/public/common/Dify.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'Dify' + export default Icon diff --git a/web/app/components/base/icons/src/public/common/Github.tsx b/web/app/components/base/icons/src/public/common/Github.tsx index b04b470409c..416743fc71a 100644 --- a/web/app/components/base/icons/src/public/common/Github.tsx +++ b/web/app/components/base/icons/src/public/common/Github.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'Github' + export default Icon diff --git a/web/app/components/base/icons/src/public/common/MessageChatSquare.tsx b/web/app/components/base/icons/src/public/common/MessageChatSquare.tsx index 4448dbb9fda..0c54640395e 100644 --- a/web/app/components/base/icons/src/public/common/MessageChatSquare.tsx +++ b/web/app/components/base/icons/src/public/common/MessageChatSquare.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'MessageChatSquare' + export default Icon diff --git a/web/app/components/base/icons/src/public/files/Csv.tsx b/web/app/components/base/icons/src/public/files/Csv.tsx index c47340cccbf..179d0e4a5f0 100644 --- a/web/app/components/base/icons/src/public/files/Csv.tsx +++ b/web/app/components/base/icons/src/public/files/Csv.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'Csv' + export default Icon diff --git a/web/app/components/base/icons/src/public/files/Md.tsx b/web/app/components/base/icons/src/public/files/Md.tsx index b976e99d9bc..d9c1bc69e9d 100644 --- a/web/app/components/base/icons/src/public/files/Md.tsx +++ b/web/app/components/base/icons/src/public/files/Md.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'Md' + export default Icon diff --git a/web/app/components/base/icons/src/public/llm/Anthropic.tsx b/web/app/components/base/icons/src/public/llm/Anthropic.tsx index 89c5f2804e4..f1307e55d30 100644 --- a/web/app/components/base/icons/src/public/llm/Anthropic.tsx +++ b/web/app/components/base/icons/src/public/llm/Anthropic.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'Anthropic' + export default Icon diff --git a/web/app/components/base/icons/src/public/llm/AnthropicText.tsx b/web/app/components/base/icons/src/public/llm/AnthropicText.tsx index bd4124efee8..868cfe5f279 100644 --- a/web/app/components/base/icons/src/public/llm/AnthropicText.tsx +++ b/web/app/components/base/icons/src/public/llm/AnthropicText.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'AnthropicText' + export default Icon diff --git a/web/app/components/base/icons/src/public/llm/AzureOpenaiService.tsx b/web/app/components/base/icons/src/public/llm/AzureOpenaiService.tsx index 9d705283c39..01db4fadeed 100644 --- a/web/app/components/base/icons/src/public/llm/AzureOpenaiService.tsx +++ b/web/app/components/base/icons/src/public/llm/AzureOpenaiService.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'AzureOpenaiService' + export default Icon diff --git a/web/app/components/base/icons/src/public/llm/AzureOpenaiServiceText.tsx b/web/app/components/base/icons/src/public/llm/AzureOpenaiServiceText.tsx index 2da50f8300c..ae29a4ff6a8 100644 --- a/web/app/components/base/icons/src/public/llm/AzureOpenaiServiceText.tsx +++ b/web/app/components/base/icons/src/public/llm/AzureOpenaiServiceText.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'AzureOpenaiServiceText' + export default Icon diff --git a/web/app/components/base/icons/src/public/llm/Azureai.tsx b/web/app/components/base/icons/src/public/llm/Azureai.tsx index 53bcfeb9a18..7a6769fd288 100644 --- a/web/app/components/base/icons/src/public/llm/Azureai.tsx +++ b/web/app/components/base/icons/src/public/llm/Azureai.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'Azureai' + export default Icon diff --git a/web/app/components/base/icons/src/public/llm/AzureaiText.tsx b/web/app/components/base/icons/src/public/llm/AzureaiText.tsx index b80acbcd84b..26881a8f5d5 100644 --- a/web/app/components/base/icons/src/public/llm/AzureaiText.tsx +++ b/web/app/components/base/icons/src/public/llm/AzureaiText.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'AzureaiText' + export default Icon diff --git a/web/app/components/base/icons/src/public/llm/Chatglm.tsx b/web/app/components/base/icons/src/public/llm/Chatglm.tsx index 7a159f19595..d26b9047fa5 100644 --- a/web/app/components/base/icons/src/public/llm/Chatglm.tsx +++ b/web/app/components/base/icons/src/public/llm/Chatglm.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'Chatglm' + export default Icon diff --git a/web/app/components/base/icons/src/public/llm/ChatglmText.tsx b/web/app/components/base/icons/src/public/llm/ChatglmText.tsx index 0b51fb3380d..c74c12c3dda 100644 --- a/web/app/components/base/icons/src/public/llm/ChatglmText.tsx +++ b/web/app/components/base/icons/src/public/llm/ChatglmText.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'ChatglmText' + export default Icon diff --git a/web/app/components/base/icons/src/public/llm/Gpt3.tsx b/web/app/components/base/icons/src/public/llm/Gpt3.tsx index 6d7eb224d05..f365ef3ccab 100644 --- a/web/app/components/base/icons/src/public/llm/Gpt3.tsx +++ b/web/app/components/base/icons/src/public/llm/Gpt3.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'Gpt3' + export default Icon diff --git a/web/app/components/base/icons/src/public/llm/Gpt4.tsx b/web/app/components/base/icons/src/public/llm/Gpt4.tsx index ae57fd707ff..702bf9cbeb6 100644 --- a/web/app/components/base/icons/src/public/llm/Gpt4.tsx +++ b/web/app/components/base/icons/src/public/llm/Gpt4.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'Gpt4' + export default Icon diff --git a/web/app/components/base/icons/src/public/llm/Huggingface.tsx b/web/app/components/base/icons/src/public/llm/Huggingface.tsx index 8d107bcb16d..ebf6a17abe6 100644 --- a/web/app/components/base/icons/src/public/llm/Huggingface.tsx +++ b/web/app/components/base/icons/src/public/llm/Huggingface.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'Huggingface' + export default Icon diff --git a/web/app/components/base/icons/src/public/llm/HuggingfaceText.tsx b/web/app/components/base/icons/src/public/llm/HuggingfaceText.tsx index 7bea6aa28c7..89cceec8a24 100644 --- a/web/app/components/base/icons/src/public/llm/HuggingfaceText.tsx +++ b/web/app/components/base/icons/src/public/llm/HuggingfaceText.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'HuggingfaceText' + export default Icon diff --git a/web/app/components/base/icons/src/public/llm/HuggingfaceTextHub.tsx b/web/app/components/base/icons/src/public/llm/HuggingfaceTextHub.tsx index be5ed8637a6..cf44edde4d4 100644 --- a/web/app/components/base/icons/src/public/llm/HuggingfaceTextHub.tsx +++ b/web/app/components/base/icons/src/public/llm/HuggingfaceTextHub.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'HuggingfaceTextHub' + export default Icon diff --git a/web/app/components/base/icons/src/public/llm/IflytekSpark.tsx b/web/app/components/base/icons/src/public/llm/IflytekSpark.tsx index 8a1e6ec3bb1..f910c3e8312 100644 --- a/web/app/components/base/icons/src/public/llm/IflytekSpark.tsx +++ b/web/app/components/base/icons/src/public/llm/IflytekSpark.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'IflytekSpark' + export default Icon diff --git a/web/app/components/base/icons/src/public/llm/IflytekSparkText.tsx b/web/app/components/base/icons/src/public/llm/IflytekSparkText.tsx index 60fb50b5b7d..a807f04c4d0 100644 --- a/web/app/components/base/icons/src/public/llm/IflytekSparkText.tsx +++ b/web/app/components/base/icons/src/public/llm/IflytekSparkText.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'IflytekSparkText' + export default Icon diff --git a/web/app/components/base/icons/src/public/llm/IflytekSparkTextCn.tsx b/web/app/components/base/icons/src/public/llm/IflytekSparkTextCn.tsx index 20a1ee7e14c..706487df807 100644 --- a/web/app/components/base/icons/src/public/llm/IflytekSparkTextCn.tsx +++ b/web/app/components/base/icons/src/public/llm/IflytekSparkTextCn.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'IflytekSparkTextCn' + export default Icon diff --git a/web/app/components/base/icons/src/public/llm/Microsoft.tsx b/web/app/components/base/icons/src/public/llm/Microsoft.tsx index 670711af0a8..adc55356453 100644 --- a/web/app/components/base/icons/src/public/llm/Microsoft.tsx +++ b/web/app/components/base/icons/src/public/llm/Microsoft.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'Microsoft' + export default Icon diff --git a/web/app/components/base/icons/src/public/llm/OpenaiBlack.tsx b/web/app/components/base/icons/src/public/llm/OpenaiBlack.tsx index 28359ed51fb..7a22c973917 100644 --- a/web/app/components/base/icons/src/public/llm/OpenaiBlack.tsx +++ b/web/app/components/base/icons/src/public/llm/OpenaiBlack.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'OpenaiBlack' + export default Icon diff --git a/web/app/components/base/icons/src/public/llm/OpenaiBlue.tsx b/web/app/components/base/icons/src/public/llm/OpenaiBlue.tsx index 83546a8f6ca..971941c37c7 100644 --- a/web/app/components/base/icons/src/public/llm/OpenaiBlue.tsx +++ b/web/app/components/base/icons/src/public/llm/OpenaiBlue.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'OpenaiBlue' + export default Icon diff --git a/web/app/components/base/icons/src/public/llm/OpenaiGreen.tsx b/web/app/components/base/icons/src/public/llm/OpenaiGreen.tsx index 81bb1f78a79..faa62e66593 100644 --- a/web/app/components/base/icons/src/public/llm/OpenaiGreen.tsx +++ b/web/app/components/base/icons/src/public/llm/OpenaiGreen.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'OpenaiGreen' + export default Icon diff --git a/web/app/components/base/icons/src/public/llm/OpenaiText.tsx b/web/app/components/base/icons/src/public/llm/OpenaiText.tsx index 0b22a05be5a..cd2f626e278 100644 --- a/web/app/components/base/icons/src/public/llm/OpenaiText.tsx +++ b/web/app/components/base/icons/src/public/llm/OpenaiText.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'OpenaiText' + export default Icon diff --git a/web/app/components/base/icons/src/public/llm/OpenaiTransparent.tsx b/web/app/components/base/icons/src/public/llm/OpenaiTransparent.tsx index 70398432c05..51b965fdc1b 100644 --- a/web/app/components/base/icons/src/public/llm/OpenaiTransparent.tsx +++ b/web/app/components/base/icons/src/public/llm/OpenaiTransparent.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'OpenaiTransparent' + export default Icon diff --git a/web/app/components/base/icons/src/public/llm/OpenaiViolet.tsx b/web/app/components/base/icons/src/public/llm/OpenaiViolet.tsx index bb15532e13a..cc2261928f9 100644 --- a/web/app/components/base/icons/src/public/llm/OpenaiViolet.tsx +++ b/web/app/components/base/icons/src/public/llm/OpenaiViolet.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'OpenaiViolet' + export default Icon diff --git a/web/app/components/base/icons/src/public/llm/Openllm.tsx b/web/app/components/base/icons/src/public/llm/Openllm.tsx index e1503aea304..99e9dba9f70 100644 --- a/web/app/components/base/icons/src/public/llm/Openllm.tsx +++ b/web/app/components/base/icons/src/public/llm/Openllm.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'Openllm' + export default Icon diff --git a/web/app/components/base/icons/src/public/llm/OpenllmText.tsx b/web/app/components/base/icons/src/public/llm/OpenllmText.tsx index 2a754fb0fd4..5c3a50ff415 100644 --- a/web/app/components/base/icons/src/public/llm/OpenllmText.tsx +++ b/web/app/components/base/icons/src/public/llm/OpenllmText.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'OpenllmText' + export default Icon diff --git a/web/app/components/base/icons/src/public/llm/Replicate.tsx b/web/app/components/base/icons/src/public/llm/Replicate.tsx index c844c2df342..4c580d7b8a3 100644 --- a/web/app/components/base/icons/src/public/llm/Replicate.tsx +++ b/web/app/components/base/icons/src/public/llm/Replicate.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'Replicate' + export default Icon diff --git a/web/app/components/base/icons/src/public/llm/ReplicateText.tsx b/web/app/components/base/icons/src/public/llm/ReplicateText.tsx index a10e7daf250..a9a595fc52e 100644 --- a/web/app/components/base/icons/src/public/llm/ReplicateText.tsx +++ b/web/app/components/base/icons/src/public/llm/ReplicateText.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'ReplicateText' + export default Icon diff --git a/web/app/components/base/icons/src/public/llm/XorbitsInference.tsx b/web/app/components/base/icons/src/public/llm/XorbitsInference.tsx index f7122b8c611..45259b03685 100644 --- a/web/app/components/base/icons/src/public/llm/XorbitsInference.tsx +++ b/web/app/components/base/icons/src/public/llm/XorbitsInference.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'XorbitsInference' + export default Icon diff --git a/web/app/components/base/icons/src/public/llm/XorbitsInferenceText.tsx b/web/app/components/base/icons/src/public/llm/XorbitsInferenceText.tsx index 5bbd4671b01..8df458786d9 100644 --- a/web/app/components/base/icons/src/public/llm/XorbitsInferenceText.tsx +++ b/web/app/components/base/icons/src/public/llm/XorbitsInferenceText.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'XorbitsInferenceText' + export default Icon diff --git a/web/app/components/base/icons/src/public/model/Checked.tsx b/web/app/components/base/icons/src/public/model/Checked.tsx index a2f700d3753..c673c02cae8 100644 --- a/web/app/components/base/icons/src/public/model/Checked.tsx +++ b/web/app/components/base/icons/src/public/model/Checked.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'Checked' + export default Icon diff --git a/web/app/components/base/icons/src/public/plugins/Google.tsx b/web/app/components/base/icons/src/public/plugins/Google.tsx index 4cfe64c4757..6d2a0b8538b 100644 --- a/web/app/components/base/icons/src/public/plugins/Google.tsx +++ b/web/app/components/base/icons/src/public/plugins/Google.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'Google' + export default Icon diff --git a/web/app/components/base/icons/src/public/plugins/WebReader.tsx b/web/app/components/base/icons/src/public/plugins/WebReader.tsx index b7c9a83007c..ee7281e6cfb 100644 --- a/web/app/components/base/icons/src/public/plugins/WebReader.tsx +++ b/web/app/components/base/icons/src/public/plugins/WebReader.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'WebReader' + export default Icon diff --git a/web/app/components/base/icons/src/public/plugins/Wikipedia.tsx b/web/app/components/base/icons/src/public/plugins/Wikipedia.tsx index 7b5de1c0362..36f18f1a6a7 100644 --- a/web/app/components/base/icons/src/public/plugins/Wikipedia.tsx +++ b/web/app/components/base/icons/src/public/plugins/Wikipedia.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'Wikipedia' + export default Icon diff --git a/web/app/components/base/icons/src/public/thought/DataSet.tsx b/web/app/components/base/icons/src/public/thought/DataSet.tsx index 3d3046af823..cadbbdcf351 100644 --- a/web/app/components/base/icons/src/public/thought/DataSet.tsx +++ b/web/app/components/base/icons/src/public/thought/DataSet.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'DataSet' + export default Icon diff --git a/web/app/components/base/icons/src/public/thought/Loading.tsx b/web/app/components/base/icons/src/public/thought/Loading.tsx index 0dd6f18805a..389f575e634 100644 --- a/web/app/components/base/icons/src/public/thought/Loading.tsx +++ b/web/app/components/base/icons/src/public/thought/Loading.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'Loading' + export default Icon diff --git a/web/app/components/base/icons/src/public/thought/Search.tsx b/web/app/components/base/icons/src/public/thought/Search.tsx index 120aaf8d36d..0d9e9ba567d 100644 --- a/web/app/components/base/icons/src/public/thought/Search.tsx +++ b/web/app/components/base/icons/src/public/thought/Search.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'Search' + export default Icon diff --git a/web/app/components/base/icons/src/public/thought/ThoughtList.tsx b/web/app/components/base/icons/src/public/thought/ThoughtList.tsx index 8dfa9c5c800..3f4eb0aaf73 100644 --- a/web/app/components/base/icons/src/public/thought/ThoughtList.tsx +++ b/web/app/components/base/icons/src/public/thought/ThoughtList.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'ThoughtList' + export default Icon diff --git a/web/app/components/base/icons/src/public/thought/WebReader.tsx b/web/app/components/base/icons/src/public/thought/WebReader.tsx index b7c9a83007c..ee7281e6cfb 100644 --- a/web/app/components/base/icons/src/public/thought/WebReader.tsx +++ b/web/app/components/base/icons/src/public/thought/WebReader.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'WebReader' + export default Icon diff --git a/web/app/components/base/icons/src/vender/line/alertsAndFeedback/AlertCircle.tsx b/web/app/components/base/icons/src/vender/line/alertsAndFeedback/AlertCircle.tsx index 0f6fb2c925a..76eb8b41e4f 100644 --- a/web/app/components/base/icons/src/vender/line/alertsAndFeedback/AlertCircle.tsx +++ b/web/app/components/base/icons/src/vender/line/alertsAndFeedback/AlertCircle.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'AlertCircle' + export default Icon diff --git a/web/app/components/base/icons/src/vender/line/arrows/ArrowNarrowLeft.tsx b/web/app/components/base/icons/src/vender/line/arrows/ArrowNarrowLeft.tsx index d864dc49a86..f2ab0c78210 100644 --- a/web/app/components/base/icons/src/vender/line/arrows/ArrowNarrowLeft.tsx +++ b/web/app/components/base/icons/src/vender/line/arrows/ArrowNarrowLeft.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'ArrowNarrowLeft' + export default Icon diff --git a/web/app/components/base/icons/src/vender/line/arrows/ArrowUpRight.tsx b/web/app/components/base/icons/src/vender/line/arrows/ArrowUpRight.tsx index 89babdf3387..188b86efe62 100644 --- a/web/app/components/base/icons/src/vender/line/arrows/ArrowUpRight.tsx +++ b/web/app/components/base/icons/src/vender/line/arrows/ArrowUpRight.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'ArrowUpRight' + export default Icon diff --git a/web/app/components/base/icons/src/vender/line/arrows/ChevronDown.tsx b/web/app/components/base/icons/src/vender/line/arrows/ChevronDown.tsx index fc8befe6d8c..9419fe1ab0c 100644 --- a/web/app/components/base/icons/src/vender/line/arrows/ChevronDown.tsx +++ b/web/app/components/base/icons/src/vender/line/arrows/ChevronDown.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'ChevronDown' + export default Icon diff --git a/web/app/components/base/icons/src/vender/line/arrows/ChevronDownDouble.tsx b/web/app/components/base/icons/src/vender/line/arrows/ChevronDownDouble.tsx index 19418813c62..edf1213f391 100644 --- a/web/app/components/base/icons/src/vender/line/arrows/ChevronDownDouble.tsx +++ b/web/app/components/base/icons/src/vender/line/arrows/ChevronDownDouble.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'ChevronDownDouble' + export default Icon diff --git a/web/app/components/base/icons/src/vender/line/arrows/ChevronRight.tsx b/web/app/components/base/icons/src/vender/line/arrows/ChevronRight.tsx index 48c515cd847..aa9e3f7df6e 100644 --- a/web/app/components/base/icons/src/vender/line/arrows/ChevronRight.tsx +++ b/web/app/components/base/icons/src/vender/line/arrows/ChevronRight.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'ChevronRight' + export default Icon diff --git a/web/app/components/base/icons/src/vender/line/arrows/RefreshCw05.tsx b/web/app/components/base/icons/src/vender/line/arrows/RefreshCw05.tsx index 503c0e0d8a5..125ad22e12e 100644 --- a/web/app/components/base/icons/src/vender/line/arrows/RefreshCw05.tsx +++ b/web/app/components/base/icons/src/vender/line/arrows/RefreshCw05.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'RefreshCw05' + export default Icon diff --git a/web/app/components/base/icons/src/vender/line/development/Container.tsx b/web/app/components/base/icons/src/vender/line/development/Container.tsx index 28e744bb62e..25b2732060b 100644 --- a/web/app/components/base/icons/src/vender/line/development/Container.tsx +++ b/web/app/components/base/icons/src/vender/line/development/Container.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'Container' + export default Icon diff --git a/web/app/components/base/icons/src/vender/line/development/Database01.tsx b/web/app/components/base/icons/src/vender/line/development/Database01.tsx index 2046aea706b..245cb309b4e 100644 --- a/web/app/components/base/icons/src/vender/line/development/Database01.tsx +++ b/web/app/components/base/icons/src/vender/line/development/Database01.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'Database01' + export default Icon diff --git a/web/app/components/base/icons/src/vender/line/development/Database03.tsx b/web/app/components/base/icons/src/vender/line/development/Database03.tsx index 415cdbaa51d..0e574ac7137 100644 --- a/web/app/components/base/icons/src/vender/line/development/Database03.tsx +++ b/web/app/components/base/icons/src/vender/line/development/Database03.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'Database03' + export default Icon diff --git a/web/app/components/base/icons/src/vender/line/development/PuzzlePiece01.tsx b/web/app/components/base/icons/src/vender/line/development/PuzzlePiece01.tsx index 452afb25059..c48dee64da1 100644 --- a/web/app/components/base/icons/src/vender/line/development/PuzzlePiece01.tsx +++ b/web/app/components/base/icons/src/vender/line/development/PuzzlePiece01.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'PuzzlePiece01' + export default Icon diff --git a/web/app/components/base/icons/src/vender/line/files/FilePlus02.tsx b/web/app/components/base/icons/src/vender/line/files/FilePlus02.tsx index 38b32cbf38a..6ca14b05393 100644 --- a/web/app/components/base/icons/src/vender/line/files/FilePlus02.tsx +++ b/web/app/components/base/icons/src/vender/line/files/FilePlus02.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'FilePlus02' + export default Icon diff --git a/web/app/components/base/icons/src/vender/line/general/AtSign.tsx b/web/app/components/base/icons/src/vender/line/general/AtSign.tsx index aa2559f04e1..18693d59849 100644 --- a/web/app/components/base/icons/src/vender/line/general/AtSign.tsx +++ b/web/app/components/base/icons/src/vender/line/general/AtSign.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'AtSign' + export default Icon diff --git a/web/app/components/base/icons/src/vender/line/general/Check.tsx b/web/app/components/base/icons/src/vender/line/general/Check.tsx index 425ab8bbe5d..e10a3e287e1 100644 --- a/web/app/components/base/icons/src/vender/line/general/Check.tsx +++ b/web/app/components/base/icons/src/vender/line/general/Check.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'Check' + export default Icon diff --git a/web/app/components/base/icons/src/vender/line/general/DotsHorizontal.tsx b/web/app/components/base/icons/src/vender/line/general/DotsHorizontal.tsx index 8bdaba10593..de6bc0e731b 100644 --- a/web/app/components/base/icons/src/vender/line/general/DotsHorizontal.tsx +++ b/web/app/components/base/icons/src/vender/line/general/DotsHorizontal.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'DotsHorizontal' + export default Icon diff --git a/web/app/components/base/icons/src/vender/line/general/Edit03.tsx b/web/app/components/base/icons/src/vender/line/general/Edit03.tsx index 4f0e88b7584..23c97160188 100644 --- a/web/app/components/base/icons/src/vender/line/general/Edit03.tsx +++ b/web/app/components/base/icons/src/vender/line/general/Edit03.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'Edit03' + export default Icon diff --git a/web/app/components/base/icons/src/vender/line/general/Hash02.tsx b/web/app/components/base/icons/src/vender/line/general/Hash02.tsx index acace47b41f..5588169737e 100644 --- a/web/app/components/base/icons/src/vender/line/general/Hash02.tsx +++ b/web/app/components/base/icons/src/vender/line/general/Hash02.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'Hash02' + export default Icon diff --git a/web/app/components/base/icons/src/vender/line/general/HelpCircle.tsx b/web/app/components/base/icons/src/vender/line/general/HelpCircle.tsx index bd5e16bb827..95b9928257b 100644 --- a/web/app/components/base/icons/src/vender/line/general/HelpCircle.tsx +++ b/web/app/components/base/icons/src/vender/line/general/HelpCircle.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'HelpCircle' + export default Icon diff --git a/web/app/components/base/icons/src/vender/line/general/InfoCircle.tsx b/web/app/components/base/icons/src/vender/line/general/InfoCircle.tsx index da84a1862ef..957c5faa19d 100644 --- a/web/app/components/base/icons/src/vender/line/general/InfoCircle.tsx +++ b/web/app/components/base/icons/src/vender/line/general/InfoCircle.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'InfoCircle' + export default Icon diff --git a/web/app/components/base/icons/src/vender/line/general/LinkExternal01.tsx b/web/app/components/base/icons/src/vender/line/general/LinkExternal01.tsx index cd53dfbb490..e13a341ce3e 100644 --- a/web/app/components/base/icons/src/vender/line/general/LinkExternal01.tsx +++ b/web/app/components/base/icons/src/vender/line/general/LinkExternal01.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'LinkExternal01' + export default Icon diff --git a/web/app/components/base/icons/src/vender/line/general/LinkExternal02.tsx b/web/app/components/base/icons/src/vender/line/general/LinkExternal02.tsx index 895faefb5ac..e18e892e4e0 100644 --- a/web/app/components/base/icons/src/vender/line/general/LinkExternal02.tsx +++ b/web/app/components/base/icons/src/vender/line/general/LinkExternal02.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'LinkExternal02' + export default Icon diff --git a/web/app/components/base/icons/src/vender/line/general/Loading02.tsx b/web/app/components/base/icons/src/vender/line/general/Loading02.tsx index 4441f7f47bc..3f17a2a892d 100644 --- a/web/app/components/base/icons/src/vender/line/general/Loading02.tsx +++ b/web/app/components/base/icons/src/vender/line/general/Loading02.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'Loading02' + export default Icon diff --git a/web/app/components/base/icons/src/vender/line/general/LogOut01.tsx b/web/app/components/base/icons/src/vender/line/general/LogOut01.tsx index 28b46529ee2..816d933aef4 100644 --- a/web/app/components/base/icons/src/vender/line/general/LogOut01.tsx +++ b/web/app/components/base/icons/src/vender/line/general/LogOut01.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'LogOut01' + export default Icon diff --git a/web/app/components/base/icons/src/vender/line/general/Pin02.json b/web/app/components/base/icons/src/vender/line/general/Pin02.json new file mode 100644 index 00000000000..c5b51a5f334 --- /dev/null +++ b/web/app/components/base/icons/src/vender/line/general/Pin02.json @@ -0,0 +1,29 @@ +{ + "icon": { + "type": "element", + "isRootNode": true, + "name": "svg", + "attributes": { + "width": "24", + "height": "24", + "viewBox": "0 0 24 24", + "fill": "none", + "xmlns": "http://www.w3.org/2000/svg" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "d": "M8.3767 15.6163L2.71985 21.2732M11.6944 6.64181L10.1335 8.2027C10.0062 8.33003 9.94252 8.39369 9.86999 8.44427C9.80561 8.48917 9.73616 8.52634 9.66309 8.555C9.58077 8.58729 9.49249 8.60495 9.31592 8.64026L5.65145 9.37315C4.69915 9.56361 4.223 9.65884 4.00024 9.9099C3.80617 10.1286 3.71755 10.4213 3.75771 10.7109C3.8038 11.0434 4.14715 11.3867 4.83387 12.0735L11.9196 19.1592C12.6063 19.8459 12.9497 20.1893 13.2821 20.2354C13.5718 20.2755 13.8645 20.1869 14.0832 19.9928C14.3342 19.7701 14.4294 19.2939 14.6199 18.3416L15.3528 14.6771C15.3881 14.5006 15.4058 14.4123 15.4381 14.33C15.4667 14.2569 15.5039 14.1875 15.5488 14.1231C15.5994 14.0505 15.663 13.9869 15.7904 13.8596L17.3512 12.2987C17.4326 12.2173 17.4734 12.1766 17.5181 12.141C17.5578 12.1095 17.5999 12.081 17.644 12.0558C17.6936 12.0274 17.7465 12.0048 17.8523 11.9594L20.3467 10.8904C21.0744 10.5785 21.4383 10.4226 21.6035 10.1706C21.7481 9.95025 21.7998 9.68175 21.7474 9.42348C21.6875 9.12813 21.4076 8.84822 20.8478 8.28839L15.7047 3.14526C15.1448 2.58543 14.8649 2.30552 14.5696 2.24565C14.3113 2.19329 14.0428 2.245 13.8225 2.38953C13.5705 2.55481 13.4145 2.91866 13.1027 3.64636L12.0337 6.14071C11.9883 6.24653 11.9656 6.29944 11.9373 6.34905C11.9121 6.39313 11.8836 6.43522 11.852 6.47496C11.8165 6.51971 11.7758 6.56041 11.6944 6.64181Z", + "stroke": "currentColor", + "stroke-width": "2", + "stroke-linecap": "round", + "stroke-linejoin": "round" + }, + "children": [] + } + ] + }, + "name": "Pin02" +} \ No newline at end of file diff --git a/web/app/components/base/icons/src/vender/line/general/Pin02.tsx b/web/app/components/base/icons/src/vender/line/general/Pin02.tsx new file mode 100644 index 00000000000..e5c4b7cfc13 --- /dev/null +++ b/web/app/components/base/icons/src/vender/line/general/Pin02.tsx @@ -0,0 +1,16 @@ +// GENERATE BY script +// DON NOT EDIT IT MANUALLY + +import * as React from 'react' +import data from './Pin02.json' +import IconBase from '@/app/components/base/icons/IconBase' +import type { IconBaseProps, IconData } from '@/app/components/base/icons/IconBase' + +const Icon = React.forwardRef, Omit>(( + props, + ref, +) => ) + +Icon.displayName = 'Pin02' + +export default Icon diff --git a/web/app/components/base/icons/src/vender/line/general/Plus.tsx b/web/app/components/base/icons/src/vender/line/general/Plus.tsx index d2be667c5fe..249afa7f407 100644 --- a/web/app/components/base/icons/src/vender/line/general/Plus.tsx +++ b/web/app/components/base/icons/src/vender/line/general/Plus.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'Plus' + export default Icon diff --git a/web/app/components/base/icons/src/vender/line/general/SearchLg.tsx b/web/app/components/base/icons/src/vender/line/general/SearchLg.tsx index 17900bf4296..0dd38fd8418 100644 --- a/web/app/components/base/icons/src/vender/line/general/SearchLg.tsx +++ b/web/app/components/base/icons/src/vender/line/general/SearchLg.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'SearchLg' + export default Icon diff --git a/web/app/components/base/icons/src/vender/line/general/Trash03.tsx b/web/app/components/base/icons/src/vender/line/general/Trash03.tsx index 33442f45029..c98b0da829f 100644 --- a/web/app/components/base/icons/src/vender/line/general/Trash03.tsx +++ b/web/app/components/base/icons/src/vender/line/general/Trash03.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'Trash03' + export default Icon diff --git a/web/app/components/base/icons/src/vender/line/general/X.tsx b/web/app/components/base/icons/src/vender/line/general/X.tsx index 982b8e12411..654dfe2ac44 100644 --- a/web/app/components/base/icons/src/vender/line/general/X.tsx +++ b/web/app/components/base/icons/src/vender/line/general/X.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'X' + export default Icon diff --git a/web/app/components/base/icons/src/vender/line/general/XClose.tsx b/web/app/components/base/icons/src/vender/line/general/XClose.tsx index 72ac3105df2..aadfa1afd29 100644 --- a/web/app/components/base/icons/src/vender/line/general/XClose.tsx +++ b/web/app/components/base/icons/src/vender/line/general/XClose.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'XClose' + export default Icon diff --git a/web/app/components/base/icons/src/vender/line/general/index.ts b/web/app/components/base/icons/src/vender/line/general/index.ts index 53669ec55a2..0ee6c6028e5 100644 --- a/web/app/components/base/icons/src/vender/line/general/index.ts +++ b/web/app/components/base/icons/src/vender/line/general/index.ts @@ -9,6 +9,7 @@ export { default as LinkExternal01 } from './LinkExternal01' export { default as LinkExternal02 } from './LinkExternal02' export { default as Loading02 } from './Loading02' export { default as LogOut01 } from './LogOut01' +export { default as Pin02 } from './Pin02' export { default as Plus } from './Plus' export { default as SearchLg } from './SearchLg' export { default as Trash03 } from './Trash03' diff --git a/web/app/components/base/icons/src/vender/line/layout/Grid01.tsx b/web/app/components/base/icons/src/vender/line/layout/Grid01.tsx index 61587982775..c823ec61ca8 100644 --- a/web/app/components/base/icons/src/vender/line/layout/Grid01.tsx +++ b/web/app/components/base/icons/src/vender/line/layout/Grid01.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'Grid01' + export default Icon diff --git a/web/app/components/base/icons/src/vender/line/mapsAndTravel/Globe01.tsx b/web/app/components/base/icons/src/vender/line/mapsAndTravel/Globe01.tsx index aebe4391cb3..2c3f5b57954 100644 --- a/web/app/components/base/icons/src/vender/line/mapsAndTravel/Globe01.tsx +++ b/web/app/components/base/icons/src/vender/line/mapsAndTravel/Globe01.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'Globe01' + export default Icon diff --git a/web/app/components/base/icons/src/vender/line/mediaAndDevices/Microphone01.tsx b/web/app/components/base/icons/src/vender/line/mediaAndDevices/Microphone01.tsx index f7722df0920..e8125ca93af 100644 --- a/web/app/components/base/icons/src/vender/line/mediaAndDevices/Microphone01.tsx +++ b/web/app/components/base/icons/src/vender/line/mediaAndDevices/Microphone01.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'Microphone01' + export default Icon diff --git a/web/app/components/base/icons/src/vender/line/shapes/CubeOutline.tsx b/web/app/components/base/icons/src/vender/line/shapes/CubeOutline.tsx index d44683f0886..647b545dd1b 100644 --- a/web/app/components/base/icons/src/vender/line/shapes/CubeOutline.tsx +++ b/web/app/components/base/icons/src/vender/line/shapes/CubeOutline.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'CubeOutline' + export default Icon diff --git a/web/app/components/base/icons/src/vender/line/users/User01.tsx b/web/app/components/base/icons/src/vender/line/users/User01.tsx index f6440e5c289..1bb3c6aead9 100644 --- a/web/app/components/base/icons/src/vender/line/users/User01.tsx +++ b/web/app/components/base/icons/src/vender/line/users/User01.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'User01' + export default Icon diff --git a/web/app/components/base/icons/src/vender/line/users/Users01.tsx b/web/app/components/base/icons/src/vender/line/users/Users01.tsx index eb7ead50a93..29300a9849f 100644 --- a/web/app/components/base/icons/src/vender/line/users/Users01.tsx +++ b/web/app/components/base/icons/src/vender/line/users/Users01.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'Users01' + export default Icon diff --git a/web/app/components/base/icons/src/vender/solid/FinanceAndECommerce/Scales02.tsx b/web/app/components/base/icons/src/vender/solid/FinanceAndECommerce/Scales02.tsx index aa34a2beca4..1df91e747ac 100644 --- a/web/app/components/base/icons/src/vender/solid/FinanceAndECommerce/Scales02.tsx +++ b/web/app/components/base/icons/src/vender/solid/FinanceAndECommerce/Scales02.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'Scales02' + export default Icon diff --git a/web/app/components/base/icons/src/vender/solid/alertsAndFeedback/AlertCircle.tsx b/web/app/components/base/icons/src/vender/solid/alertsAndFeedback/AlertCircle.tsx index 0f6fb2c925a..76eb8b41e4f 100644 --- a/web/app/components/base/icons/src/vender/solid/alertsAndFeedback/AlertCircle.tsx +++ b/web/app/components/base/icons/src/vender/solid/alertsAndFeedback/AlertCircle.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'AlertCircle' + export default Icon diff --git a/web/app/components/base/icons/src/vender/solid/alertsAndFeedback/AlertTriangle.tsx b/web/app/components/base/icons/src/vender/solid/alertsAndFeedback/AlertTriangle.tsx index 1ddb34f39a3..780f859bd8b 100644 --- a/web/app/components/base/icons/src/vender/solid/alertsAndFeedback/AlertTriangle.tsx +++ b/web/app/components/base/icons/src/vender/solid/alertsAndFeedback/AlertTriangle.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'AlertTriangle' + export default Icon diff --git a/web/app/components/base/icons/src/vender/solid/development/Container.tsx b/web/app/components/base/icons/src/vender/solid/development/Container.tsx index 28e744bb62e..25b2732060b 100644 --- a/web/app/components/base/icons/src/vender/solid/development/Container.tsx +++ b/web/app/components/base/icons/src/vender/solid/development/Container.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'Container' + export default Icon diff --git a/web/app/components/base/icons/src/vender/solid/development/Database02.tsx b/web/app/components/base/icons/src/vender/solid/development/Database02.tsx index 1a9ae8aca33..2e3f3f458aa 100644 --- a/web/app/components/base/icons/src/vender/solid/development/Database02.tsx +++ b/web/app/components/base/icons/src/vender/solid/development/Database02.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'Database02' + export default Icon diff --git a/web/app/components/base/icons/src/vender/solid/development/Database03.tsx b/web/app/components/base/icons/src/vender/solid/development/Database03.tsx index 415cdbaa51d..0e574ac7137 100644 --- a/web/app/components/base/icons/src/vender/solid/development/Database03.tsx +++ b/web/app/components/base/icons/src/vender/solid/development/Database03.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'Database03' + export default Icon diff --git a/web/app/components/base/icons/src/vender/solid/development/PuzzlePiece01.tsx b/web/app/components/base/icons/src/vender/solid/development/PuzzlePiece01.tsx index 452afb25059..c48dee64da1 100644 --- a/web/app/components/base/icons/src/vender/solid/development/PuzzlePiece01.tsx +++ b/web/app/components/base/icons/src/vender/solid/development/PuzzlePiece01.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'PuzzlePiece01' + export default Icon diff --git a/web/app/components/base/icons/src/vender/solid/development/TerminalSquare.tsx b/web/app/components/base/icons/src/vender/solid/development/TerminalSquare.tsx index c1dbd7f284c..add92012b02 100644 --- a/web/app/components/base/icons/src/vender/solid/development/TerminalSquare.tsx +++ b/web/app/components/base/icons/src/vender/solid/development/TerminalSquare.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'TerminalSquare' + export default Icon diff --git a/web/app/components/base/icons/src/vender/solid/editor/Brush01.tsx b/web/app/components/base/icons/src/vender/solid/editor/Brush01.tsx index bfcfefe1aed..00bb1437d54 100644 --- a/web/app/components/base/icons/src/vender/solid/editor/Brush01.tsx +++ b/web/app/components/base/icons/src/vender/solid/editor/Brush01.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'Brush01' + export default Icon diff --git a/web/app/components/base/icons/src/vender/solid/education/Beaker02.tsx b/web/app/components/base/icons/src/vender/solid/education/Beaker02.tsx index 16f3a9effd2..55e6825ddd5 100644 --- a/web/app/components/base/icons/src/vender/solid/education/Beaker02.tsx +++ b/web/app/components/base/icons/src/vender/solid/education/Beaker02.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'Beaker02' + export default Icon diff --git a/web/app/components/base/icons/src/vender/solid/general/CheckCircle.tsx b/web/app/components/base/icons/src/vender/solid/general/CheckCircle.tsx index 9664fd47856..fe2cbfcb547 100644 --- a/web/app/components/base/icons/src/vender/solid/general/CheckCircle.tsx +++ b/web/app/components/base/icons/src/vender/solid/general/CheckCircle.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'CheckCircle' + export default Icon diff --git a/web/app/components/base/icons/src/vender/solid/general/Download02.tsx b/web/app/components/base/icons/src/vender/solid/general/Download02.tsx index c51ff96de96..17b55dc21b0 100644 --- a/web/app/components/base/icons/src/vender/solid/general/Download02.tsx +++ b/web/app/components/base/icons/src/vender/solid/general/Download02.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'Download02' + export default Icon diff --git a/web/app/components/base/icons/src/vender/solid/general/Target04.tsx b/web/app/components/base/icons/src/vender/solid/general/Target04.tsx index 4fb47caea86..17901f52815 100644 --- a/web/app/components/base/icons/src/vender/solid/general/Target04.tsx +++ b/web/app/components/base/icons/src/vender/solid/general/Target04.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'Target04' + export default Icon diff --git a/web/app/components/base/icons/src/vender/solid/general/XCircle.tsx b/web/app/components/base/icons/src/vender/solid/general/XCircle.tsx index bd9ab27be1d..bd9bb3628e7 100644 --- a/web/app/components/base/icons/src/vender/solid/general/XCircle.tsx +++ b/web/app/components/base/icons/src/vender/solid/general/XCircle.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'XCircle' + export default Icon diff --git a/web/app/components/base/icons/src/vender/solid/layout/Grid01.tsx b/web/app/components/base/icons/src/vender/solid/layout/Grid01.tsx index 61587982775..c823ec61ca8 100644 --- a/web/app/components/base/icons/src/vender/solid/layout/Grid01.tsx +++ b/web/app/components/base/icons/src/vender/solid/layout/Grid01.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'Grid01' + export default Icon diff --git a/web/app/components/base/icons/src/vender/solid/mediaAndDevices/Microphone01.tsx b/web/app/components/base/icons/src/vender/solid/mediaAndDevices/Microphone01.tsx index f7722df0920..e8125ca93af 100644 --- a/web/app/components/base/icons/src/vender/solid/mediaAndDevices/Microphone01.tsx +++ b/web/app/components/base/icons/src/vender/solid/mediaAndDevices/Microphone01.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'Microphone01' + export default Icon diff --git a/web/app/components/base/icons/src/vender/solid/mediaAndDevices/Sliders02.tsx b/web/app/components/base/icons/src/vender/solid/mediaAndDevices/Sliders02.tsx index ad1b05f6421..829ed5a0a1c 100644 --- a/web/app/components/base/icons/src/vender/solid/mediaAndDevices/Sliders02.tsx +++ b/web/app/components/base/icons/src/vender/solid/mediaAndDevices/Sliders02.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'Sliders02' + export default Icon diff --git a/web/app/components/base/icons/src/vender/solid/mediaAndDevices/StopCircle.tsx b/web/app/components/base/icons/src/vender/solid/mediaAndDevices/StopCircle.tsx index 488ae5c5f26..6022e6bbfb6 100644 --- a/web/app/components/base/icons/src/vender/solid/mediaAndDevices/StopCircle.tsx +++ b/web/app/components/base/icons/src/vender/solid/mediaAndDevices/StopCircle.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'StopCircle' + export default Icon diff --git a/web/app/components/base/icons/src/vender/solid/security/Lock01.tsx b/web/app/components/base/icons/src/vender/solid/security/Lock01.tsx index 3a42aef59a2..f66473a5a43 100644 --- a/web/app/components/base/icons/src/vender/solid/security/Lock01.tsx +++ b/web/app/components/base/icons/src/vender/solid/security/Lock01.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'Lock01' + export default Icon diff --git a/web/app/components/base/icons/src/vender/solid/users/User01.tsx b/web/app/components/base/icons/src/vender/solid/users/User01.tsx index f6440e5c289..1bb3c6aead9 100644 --- a/web/app/components/base/icons/src/vender/solid/users/User01.tsx +++ b/web/app/components/base/icons/src/vender/solid/users/User01.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'User01' + export default Icon diff --git a/web/app/components/base/icons/src/vender/solid/users/Users01.tsx b/web/app/components/base/icons/src/vender/solid/users/Users01.tsx index eb7ead50a93..29300a9849f 100644 --- a/web/app/components/base/icons/src/vender/solid/users/Users01.tsx +++ b/web/app/components/base/icons/src/vender/solid/users/Users01.tsx @@ -11,4 +11,6 @@ const Icon = React.forwardRef, Omit ) +Icon.displayName = 'Users01' + export default Icon diff --git a/web/app/components/explore/item-operation/index.tsx b/web/app/components/explore/item-operation/index.tsx index cc9a6cfe857..8ab237266bb 100644 --- a/web/app/components/explore/item-operation/index.tsx +++ b/web/app/components/explore/item-operation/index.tsx @@ -3,20 +3,16 @@ import type { FC } from 'react' import React from 'react' import cn from 'classnames' import { useTranslation } from 'react-i18next' -import { TrashIcon } from '@heroicons/react/24/outline' +import { Edit03, Pin02, Trash03 } from '../../base/icons/src/vender/line/general' import s from './style.module.css' import Popover from '@/app/components/base/popover' -const PinIcon = ( - - - -) - export type IItemOperationProps = { className?: string isPinned: boolean + isShowRenameConversation?: boolean + onRenameConversation?: () => void isShowDelete: boolean togglePin: () => void onDelete: () => void @@ -25,8 +21,10 @@ export type IItemOperationProps = { const ItemOperation: FC = ({ className, isPinned, - isShowDelete, togglePin, + isShowRenameConversation, + onRenameConversation, + isShowDelete, onDelete, }) => { const { t } = useTranslation() @@ -38,12 +36,18 @@ const ItemOperation: FC = ({ e.stopPropagation() }}>
- {PinIcon} + {isPinned ? t('explore.sidebar.action.unpin') : t('explore.sidebar.action.pin')}
+ {isShowRenameConversation && ( +
+ + {t('explore.sidebar.action.rename')} +
+ )} {isShowDelete && (
- + {t('explore.sidebar.action.delete')}
)} @@ -53,8 +57,8 @@ const ItemOperation: FC = ({ trigger='click' position='br' btnElement={
} - btnClassName={open => cn(className, s.btn, 'h-6 w-6 rounded-md border-none p-1', open && '!bg-gray-100 !shadow-none')} - className={'!w-[120px] h-fit !z-20'} + btnClassName={open => cn(className, s.btn, 'h-6 w-6 rounded-md border-none py-1', open && '!bg-gray-100 !shadow-none')} + className={'!w-[120px] !px-0 h-fit !z-20'} /> ) } diff --git a/web/app/components/explore/universal-chat/hooks/use-conversation.ts b/web/app/components/explore/universal-chat/hooks/use-conversation.ts index 4e7f27cf501..9b797a24748 100644 --- a/web/app/components/explore/universal-chat/hooks/use-conversation.ts +++ b/web/app/components/explore/universal-chat/hooks/use-conversation.ts @@ -65,6 +65,7 @@ function useConversation() { setCurrInputs, currConversationInfo, setNewConversationInfo, + existConversationInfo, setExistConversationInfo, } } diff --git a/web/app/components/explore/universal-chat/index.tsx b/web/app/components/explore/universal-chat/index.tsx index c7d42aafa7d..c9c1368649d 100644 --- a/web/app/components/explore/universal-chat/index.tsx +++ b/web/app/components/explore/universal-chat/index.tsx @@ -130,6 +130,7 @@ const Main: FC = () => { resetNewConversationInputs, setCurrInputs, setNewConversationInfo, + existConversationInfo, setExistConversationInfo, } = useConversation() const [hasMore, setHasMore] = useState(true) @@ -618,14 +619,38 @@ const Main: FC = () => { notify({ type: 'success', message: t('common.api.success') }) } + const [controlChatUpdateAllConversation, setControlChatUpdateAllConversation] = useState(0) + useEffect(() => { + (async () => { + if (controlChatUpdateAllConversation && !isNewConversation) { + const { data: allConversations } = await fetchAllConversations() as { data: ConversationItem[]; has_more: boolean } + const item = allConversations.find(item => item.id === currConversationId) + setAllConversationList(allConversations) + if (item) { + setExistConversationInfo({ + ...existConversationInfo, + name: item?.name || '', + } as any) + } + } + })() + }, [controlChatUpdateAllConversation]) const renderSidebar = () => { if (!APP_ID || !promptConfig) return null return ( { + setConversationList(list) + setControlChatUpdateAllConversation(Date.now()) + }} isClearConversationList={isClearConversationList} pinnedList={pinnedConversationList} + onPinnedListChanged={(list) => { + setPinnedConversationList(list) + setControlChatUpdateAllConversation(Date.now()) + }} isClearPinnedConversationList={isClearPinnedConversationList} onMoreLoaded={onMoreLoaded} onPinnedMoreLoaded={onPinnedMoreLoaded} diff --git a/web/app/components/share/chat/hooks/use-conversation.ts b/web/app/components/share/chat/hooks/use-conversation.ts index 4e7f27cf501..9b797a24748 100644 --- a/web/app/components/share/chat/hooks/use-conversation.ts +++ b/web/app/components/share/chat/hooks/use-conversation.ts @@ -65,6 +65,7 @@ function useConversation() { setCurrInputs, currConversationInfo, setNewConversationInfo, + existConversationInfo, setExistConversationInfo, } } diff --git a/web/app/components/share/chat/index.tsx b/web/app/components/share/chat/index.tsx index 23fc19936d3..b08d8b0a159 100644 --- a/web/app/components/share/chat/index.tsx +++ b/web/app/components/share/chat/index.tsx @@ -101,6 +101,7 @@ const Main: FC = ({ resetNewConversationInputs, setCurrInputs, setNewConversationInfo, + existConversationInfo, setExistConversationInfo, } = useConversation() const [hasMore, setHasMore] = useState(true) @@ -186,6 +187,23 @@ const Main: FC = ({ const conversationName = currConversationInfo?.name || t('share.chat.newChatDefaultName') as string const conversationIntroduction = currConversationInfo?.introduction || '' + const [controlChatUpdateAllConversation, setControlChatUpdateAllConversation] = useState(0) + + useEffect(() => { + (async () => { + if (controlChatUpdateAllConversation && !isNewConversation) { + const { data: allConversations } = await fetchAllConversations() as { data: ConversationItem[]; has_more: boolean } + const item = allConversations.find(item => item.id === currConversationId) + setAllConversationList(allConversations) + if (item) { + setExistConversationInfo({ + ...existConversationInfo, + name: item?.name || '', + } as any) + } + } + })() + }, [controlChatUpdateAllConversation]) const handleConversationSwitch = () => { if (!inited) @@ -546,8 +564,16 @@ const Main: FC = ({ return ( { + setConversationList(list) + setControlChatUpdateAllConversation(Date.now()) + }} isClearConversationList={isClearConversationList} pinnedList={pinnedConversationList} + onPinnedListChanged={(list) => { + setPinnedConversationList(list) + setControlChatUpdateAllConversation(Date.now()) + }} isClearPinnedConversationList={isClearPinnedConversationList} onMoreLoaded={onMoreLoaded} onPinnedMoreLoaded={onPinnedMoreLoaded} diff --git a/web/app/components/share/chat/sidebar/index.tsx b/web/app/components/share/chat/sidebar/index.tsx index 937ec3e65c9..d1f69272fbe 100644 --- a/web/app/components/share/chat/sidebar/index.tsx +++ b/web/app/components/share/chat/sidebar/index.tsx @@ -18,8 +18,10 @@ export type ISidebarProps = { currentId: string onCurrentIdChange: (id: string) => void list: ConversationItem[] + onListChanged: (newList: ConversationItem[]) => void isClearConversationList: boolean pinnedList: ConversationItem[] + onPinnedListChanged: (newList: ConversationItem[]) => void isClearPinnedConversationList: boolean isInstalledApp: boolean installedAppId?: string @@ -40,8 +42,10 @@ const Sidebar: FC = ({ currentId, onCurrentIdChange, list, + onListChanged, isClearConversationList, pinnedList, + onPinnedListChanged, isClearPinnedConversationList, isInstalledApp, installedAppId, @@ -115,6 +119,7 @@ const Sidebar: FC = ({ currentId={currentId} onCurrentIdChange={onCurrentIdChange} list={pinnedList} + onListChanged={onPinnedListChanged} isClearConversationList={isClearPinnedConversationList} isInstalledApp={isInstalledApp} installedAppId={installedAppId} @@ -138,6 +143,7 @@ const Sidebar: FC = ({ currentId={currentId} onCurrentIdChange={onCurrentIdChange} list={list} + onListChanged={onListChanged} isClearConversationList={isClearConversationList} isInstalledApp={isInstalledApp} installedAppId={installedAppId} diff --git a/web/app/components/share/chat/sidebar/list/index.tsx b/web/app/components/share/chat/sidebar/list/index.tsx index 3d470874d41..ac2046a4110 100644 --- a/web/app/components/share/chat/sidebar/list/index.tsx +++ b/web/app/components/share/chat/sidebar/list/index.tsx @@ -1,23 +1,27 @@ 'use client' import type { FC } from 'react' -import React, { useRef } from 'react' +import React, { useRef, useState } from 'react' import { ChatBubbleOvalLeftEllipsisIcon, } from '@heroicons/react/24/outline' -import { useInfiniteScroll } from 'ahooks' +import { useBoolean, useInfiniteScroll } from 'ahooks' import { ChatBubbleOvalLeftEllipsisIcon as ChatBubbleOvalLeftEllipsisSolidIcon } from '@heroicons/react/24/solid' import cn from 'classnames' +import { useTranslation } from 'react-i18next' +import RenameModal from '../rename-modal' import s from './style.module.css' import type { ConversationItem } from '@/models/share' -import { fetchConversations } from '@/service/share' -import { fetchConversations as fetchUniversalConversations } from '@/service/universal-chat' +import { fetchConversations, renameConversation } from '@/service/share' +import { fetchConversations as fetchUniversalConversations, renameConversation as renameUniversalConversation } from '@/service/universal-chat' import ItemOperation from '@/app/components/explore/item-operation' +import Toast from '@/app/components/base/toast' export type IListProps = { className: string currentId: string onCurrentIdChange: (id: string) => void list: ConversationItem[] + onListChanged?: (newList: ConversationItem[]) => void isClearConversationList: boolean isInstalledApp: boolean isUniversalChat?: boolean @@ -35,6 +39,7 @@ const List: FC = ({ currentId, onCurrentIdChange, list, + onListChanged, isClearConversationList, isInstalledApp, isUniversalChat, @@ -46,6 +51,8 @@ const List: FC = ({ controlUpdate, onDelete, }) => { + const { t } = useTranslation() + const listRef = useRef(null) useInfiniteScroll( @@ -72,6 +79,50 @@ const List: FC = ({ reloadDeps: [isNoMore, controlUpdate], }, ) + const [isShowRename, { setTrue: setShowRename, setFalse: setHideRename }] = useBoolean(false) + const [isSaving, { setTrue: setIsSaving, setFalse: setNotSaving }] = useBoolean(false) + const [currentConversation, setCurrentConversation] = useState(null) + const showRename = (item: ConversationItem) => { + setCurrentConversation(item) + setShowRename() + } + const handleRename = async (newName: string) => { + if (!newName.trim() || !currentConversation) { + Toast.notify({ + type: 'error', + message: t('common.chat.conversationNameCanNotEmpty'), + }) + return + } + + setIsSaving() + const currId = currentConversation.id + try { + if (isUniversalChat) + await renameUniversalConversation(currId, newName) + + else + await renameConversation(isInstalledApp, installedAppId, currId, newName) + + Toast.notify({ + type: 'success', + message: t('common.actionMsg.modifiedSuccessfully'), + }) + onListChanged?.(list.map((item) => { + if (item.id === currId) { + return { + ...item, + name: newName, + } + } + return item + })) + setHideRename() + } + finally { + setNotSaving() + } + } return (
) })} + {isShowRename && ( + + )} ) } diff --git a/web/app/components/share/chat/sidebar/rename-modal/index.tsx b/web/app/components/share/chat/sidebar/rename-modal/index.tsx new file mode 100644 index 00000000000..346bf74d3e7 --- /dev/null +++ b/web/app/components/share/chat/sidebar/rename-modal/index.tsx @@ -0,0 +1,47 @@ +'use client' +import type { FC } from 'react' +import React, { useState } from 'react' +import { useTranslation } from 'react-i18next' +import Modal from '@/app/components/base/modal' +import Button from '@/app/components/base/button' + +export type IRenameModalProps = { + isShow: boolean + saveLoading: boolean + name: string + onClose: () => void + onSave: (name: string) => void +} + +const RenameModal: FC = ({ + isShow, + saveLoading, + name, + onClose, + onSave, +}) => { + const { t } = useTranslation() + const [tempName, setTempName] = useState(name) + + return ( + +
{t('common.chat.conversationName')}
+ setTempName(e.target.value)} + placeholder={t('common.chat.conversationNamePlaceholder') || ''} + /> + +
+ + +
+
+ ) +} +export default React.memo(RenameModal) diff --git a/web/i18n/lang/common.en.ts b/web/i18n/lang/common.en.ts index e3f91d843e1..dec71f20e97 100644 --- a/web/i18n/lang/common.en.ts +++ b/web/i18n/lang/common.en.ts @@ -334,6 +334,12 @@ const translation = { 'claude-instant-1': 'Claude-Instant', 'claude-2': 'Claude-2', }, + chat: { + renameConversation: 'Rename Conversation', + conversationName: 'Conversation name', + conversationNamePlaceholder: 'Please input conversation name', + conversationNameCanNotEmpty: 'Conversation name required', + }, } export default translation diff --git a/web/i18n/lang/common.zh.ts b/web/i18n/lang/common.zh.ts index 70287db8ab3..e2082e10c7f 100644 --- a/web/i18n/lang/common.zh.ts +++ b/web/i18n/lang/common.zh.ts @@ -334,6 +334,12 @@ const translation = { 'claude-instant-1': 'Claude-Instant', 'claude-2': 'Claude-2', }, + chat: { + renameConversation: '重命名会话', + conversationName: '会话名称', + conversationNamePlaceholder: '请输入会话名称', + conversationNameCanNotEmpty: '会话名称必填', + }, } export default translation diff --git a/web/i18n/lang/explore.en.ts b/web/i18n/lang/explore.en.ts index 9e044485858..817b72a5f5c 100644 --- a/web/i18n/lang/explore.en.ts +++ b/web/i18n/lang/explore.en.ts @@ -7,6 +7,7 @@ const translation = { action: { pin: 'Pin', unpin: 'Unpin', + rename: 'Rename', delete: 'Delete', }, delete: { diff --git a/web/i18n/lang/explore.zh.ts b/web/i18n/lang/explore.zh.ts index 45dc4443d90..f3dffa371a8 100644 --- a/web/i18n/lang/explore.zh.ts +++ b/web/i18n/lang/explore.zh.ts @@ -7,6 +7,7 @@ const translation = { action: { pin: '置顶', unpin: '取消置顶', + rename: '重命名', delete: '删除', }, delete: { diff --git a/web/service/share.ts b/web/service/share.ts index abea46ddfe2..eb9677b75d4 100644 --- a/web/service/share.ts +++ b/web/service/share.ts @@ -73,6 +73,10 @@ export const delConversation = async (isInstalledApp: boolean, installedAppId = return getAction('del', isInstalledApp)(getUrl(`conversations/${id}`, isInstalledApp, installedAppId)) } +export const renameConversation = async (isInstalledApp: boolean, installedAppId = '', id: string, name: string) => { + return getAction('post', isInstalledApp)(getUrl(`conversations/${id}/name`, isInstalledApp, installedAppId), { body: { name } }) +} + export const fetchChatList = async (conversationId: string, isInstalledApp: boolean, installedAppId = '') => { return getAction('get', isInstalledApp)(getUrl('messages', isInstalledApp, installedAppId), { params: { conversation_id: conversationId, limit: 20, last_id: '' } }) } diff --git a/web/service/universal-chat.ts b/web/service/universal-chat.ts index 629da73e803..10bf9a39fe7 100644 --- a/web/service/universal-chat.ts +++ b/web/service/universal-chat.ts @@ -45,6 +45,10 @@ export const delConversation = async (id: string) => { return del(getUrl(`conversations/${id}`)) } +export const renameConversation = async (id: string, name: string) => { + return post(getUrl(`conversations/${id}/name`), { body: { name } }) +} + export const fetchChatList = async (conversationId: string) => { return get(getUrl('messages'), { params: { conversation_id: conversationId, limit: 20, last_id: '' } }) }