From 4ba23ea04a2fbc400c373dcb5c799ab88a2046d3 Mon Sep 17 00:00:00 2001 From: Rubu Jam Date: Sun, 12 May 2024 17:40:33 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=84=20style=20:=20Add=20an=20"Assistan?= =?UTF-8?q?t=20and=20Conversation"=20icon=20(#2410)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * style:Add an "Assistant and Conversation" icon * 💄 style : Add an "Assistant and Conversation" icon * 💄 style: Add an "Assistant and Conversation" icon * 💄 style : Add an `Assistant and Conversation` icon * 💄 style : Add an `Assistant and Conversation` icon --- locales/ar/chat.json | 1 + locales/bg-BG/chat.json | 1 + locales/de-DE/chat.json | 1 + locales/en-US/chat.json | 1 + locales/es-ES/chat.json | 1 + locales/fr-FR/chat.json | 1 + locales/it-IT/chat.json | 1 + locales/ja-JP/chat.json | 1 + locales/ko-KR/chat.json | 1 + locales/nl-NL/chat.json | 1 + locales/pl-PL/chat.json | 1 + locales/pt-BR/chat.json | 1 + locales/ru-RU/chat.json | 1 + locales/tr-TR/chat.json | 1 + locales/vi-VN/chat.json | 1 + locales/zh-CN/chat.json | 1 + locales/zh-TW/chat.json | 1 + .../_layout/Desktop/ChatHeader/Main.tsx | 22 ++++++++++++++++++- src/locales/default/chat.ts | 1 + 19 files changed, 39 insertions(+), 1 deletion(-) diff --git a/locales/ar/chat.json b/locales/ar/chat.json index 30dd7e61d26c..2b97e2e878e0 100644 --- a/locales/ar/chat.json +++ b/locales/ar/chat.json @@ -4,6 +4,7 @@ }, "agentDefaultMessage": "مرحبًا، أنا **{{name}}**، يمكنك البدء في الدردشة معي على الفور، أو يمكنك الانتقال إلى [إعدادات المساعد](/chat/settings#session={{id}}) لتحسين معلوماتي.", "agentDefaultMessageWithSystemRole": "مرحبًا، أنا **{{name}}**، {{systemRole}}، دعنا نبدأ الدردشة!", + "agentsAndConversations": "الوكلاء والمحادثات", "backToBottom": "العودة إلى الأسفل", "clearCurrentMessages": "مسح رسائل الجلسة الحالية", "confirmClearCurrentMessages": "سيتم مسح رسائل الجلسة الحالية قريبًا، وبمجرد المسح لن يمكن استعادتها، يرجى تأكيد الإجراء الخاص بك", diff --git a/locales/bg-BG/chat.json b/locales/bg-BG/chat.json index e6327c8b4da9..f5adf866453c 100644 --- a/locales/bg-BG/chat.json +++ b/locales/bg-BG/chat.json @@ -4,6 +4,7 @@ }, "agentDefaultMessage": "Здравей, аз съм **{{name}}**. Можеш да започнеш да чатиш с мен веднага, или да отидеш в [Настройки на агента](/chat/settings#session={{id}}) за да попълниш информацията ми.", "agentDefaultMessageWithSystemRole": "Здравей, аз съм **{{name}}**, {{systemRole}}. Нека започнем да чатим!", + "agentsAndConversations": "агенти и разговори", "backToBottom": "Върни се в началото", "clearCurrentMessages": "Изчисти съобщенията от текущата сесия", "confirmClearCurrentMessages": "На път си да изчистиш съобщенията от текущата сесия. След като бъдат изчистени, те не могат да бъдат възстановени. Моля, потвърди действието си.", diff --git a/locales/de-DE/chat.json b/locales/de-DE/chat.json index c2ee10dc5391..afb64db6f6e2 100644 --- a/locales/de-DE/chat.json +++ b/locales/de-DE/chat.json @@ -4,6 +4,7 @@ }, "agentDefaultMessage": "Hallo, ich bin **{{name}}**. Du kannst sofort mit mir chatten oder gehe zu [Assistenteneinstellungen](/chat/settings#session={{id}}), um meine Informationen zu vervollständigen.", "agentDefaultMessageWithSystemRole": "Hallo, ich bin **{{name}}**, {{systemRole}}. Lass uns chatten!", + "agentsAndConversations": "Agenten und Unterhaltungen", "backToBottom": "Zurück zum Ende", "clearCurrentMessages": "Aktuelle Nachrichten löschen", "confirmClearCurrentMessages": "Möchtest du wirklich die aktuellen Nachrichten löschen? Diese Aktion kann nicht rückgängig gemacht werden.", diff --git a/locales/en-US/chat.json b/locales/en-US/chat.json index 1a653f5be6a7..7b55ecf7d48b 100644 --- a/locales/en-US/chat.json +++ b/locales/en-US/chat.json @@ -4,6 +4,7 @@ }, "agentDefaultMessage": "Hello, I'm **{{name}}**. You can start chatting with me right away, or go to [Agent Settings](/chat/settings#session={{id}}) to complete my information.", "agentDefaultMessageWithSystemRole": "Hello, I'm **{{name}}**, {{systemRole}}. Let's start chatting!", + "agentsAndConversations": "Agents and Conversations", "backToBottom": "Back to bottom", "clearCurrentMessages": "Clear current session messages", "confirmClearCurrentMessages": "You are about to clear the current session messages. Once cleared, they cannot be retrieved. Please confirm your action.", diff --git a/locales/es-ES/chat.json b/locales/es-ES/chat.json index 39c5677df522..eb26ac16a145 100644 --- a/locales/es-ES/chat.json +++ b/locales/es-ES/chat.json @@ -4,6 +4,7 @@ }, "agentDefaultMessage": "Hola, soy **{{name}}**, puedes comenzar a chatear conmigo de inmediato o ir a [Configuración del asistente](/chat/settings#session={{id}}) para completar mi información.", "agentDefaultMessageWithSystemRole": "Hola, soy **{{name}}**, {{systemRole}}, ¡comencemos a chatear!", + "agentsAndConversations": "agentesYConversaciones", "backToBottom": "Volver al fondo", "clearCurrentMessages": "Borrar mensajes actuales", "confirmClearCurrentMessages": "Estás a punto de borrar los mensajes de esta sesión. Una vez borrados, no se podrán recuperar. Por favor, confirma tu acción.", diff --git a/locales/fr-FR/chat.json b/locales/fr-FR/chat.json index fb6fdeeee8ff..2bd211d418bc 100644 --- a/locales/fr-FR/chat.json +++ b/locales/fr-FR/chat.json @@ -4,6 +4,7 @@ }, "agentDefaultMessage": "Bonjour, je suis **{{name}}**. Vous pouvez commencer à discuter avec moi dès maintenant ou aller dans [Paramètres de l'agent](/chat/settings#session={{id}}) pour compléter mes informations.", "agentDefaultMessageWithSystemRole": "Bonjour, je suis **{{name}}**, {{systemRole}}. Commençons la conversation !", + "agentsAndConversations": "Agents et conversations", "backToBottom": "Retour en bas", "clearCurrentMessages": "Effacer les messages actuels", "confirmClearCurrentMessages": "Vous êtes sur le point d'effacer les messages de cette session. Cette action est irréversible. Veuillez confirmer.", diff --git a/locales/it-IT/chat.json b/locales/it-IT/chat.json index 84c4a0a06f6f..02f6e813ea60 100644 --- a/locales/it-IT/chat.json +++ b/locales/it-IT/chat.json @@ -4,6 +4,7 @@ }, "agentDefaultMessage": "Ciao, sono **{{name}}**, puoi iniziare a chattare con me subito o andare a [impostazioni assistente](/chat/settings#session={{id}}) per completare le mie informazioni.", "agentDefaultMessageWithSystemRole": "Ciao, sono **{{name}}**, {{systemRole}}, iniziamo a chattare!", + "agentsAndConversations": "Assistenti e Conversazioni", "backToBottom": "Torna in fondo", "clearCurrentMessages": "Cancella messaggi attuali", "confirmClearCurrentMessages": "Stai per cancellare i messaggi attuali, questa operazione non potrà essere annullata. Confermi?", diff --git a/locales/ja-JP/chat.json b/locales/ja-JP/chat.json index e3c26d7b0a19..b355ade3ac5b 100644 --- a/locales/ja-JP/chat.json +++ b/locales/ja-JP/chat.json @@ -4,6 +4,7 @@ }, "agentDefaultMessage": "こんにちは、私は **{{name}}** です。すぐにチャットを開始するか、[エージェント設定](/chat/settings#session={{id}}) に移動して私の情報を完全にすることができます。", "agentDefaultMessageWithSystemRole": "こんにちは、私は **{{name}}** です、{{systemRole}}、さあ、チャットを始めましょう!", + "agentsAndConversations": "エージェントと会話", "backToBottom": "現在に戻る", "clearCurrentMessages": "現在の会話をクリア", "confirmClearCurrentMessages": "現在の会話をクリアします。クリアした後は元に戻すことはできません。操作を確認してください。", diff --git a/locales/ko-KR/chat.json b/locales/ko-KR/chat.json index d66da5160fc4..d041fe9abe80 100644 --- a/locales/ko-KR/chat.json +++ b/locales/ko-KR/chat.json @@ -4,6 +4,7 @@ }, "agentDefaultMessage": "안녕하세요, 저는 **{{name}}**입니다. 지금 즉시 대화를 시작하거나 [도우미 설정](/chat/settings#session={{id}})으로 이동하여 내 정보를 완성할 수 있습니다.", "agentDefaultMessageWithSystemRole": "안녕하세요, 저는 **{{name}}**입니다. {{systemRole}}입니다. 대화를 시작해 봅시다!", + "agentsAndConversations": "에이전트 및 대화", "backToBottom": "하단으로 이동", "clearCurrentMessages": "현재 대화 지우기", "confirmClearCurrentMessages": "현재 대화를 지우시면 되돌릴 수 없습니다. 작업을 확인하시겠습니까?", diff --git a/locales/nl-NL/chat.json b/locales/nl-NL/chat.json index 77e9c4f08bae..a497c34dec51 100644 --- a/locales/nl-NL/chat.json +++ b/locales/nl-NL/chat.json @@ -4,6 +4,7 @@ }, "agentDefaultMessage": "Hallo, ik ben **{{name}}**. Je kunt meteen met me praten of naar [Assistentinstellingen](/chat/settings#session={{id}}) gaan om mijn informatie aan te vullen.", "agentDefaultMessageWithSystemRole": "Hallo, ik ben **{{name}}**, {{systemRole}}, laten we beginnen met praten!", + "agentsAndConversations": "agenten en gesprekken", "backToBottom": "Terug naar onderen", "clearCurrentMessages": "Huidige berichten wissen", "confirmClearCurrentMessages": "Huidige berichten worden gewist en kunnen niet worden hersteld. Bevestig je actie.", diff --git a/locales/pl-PL/chat.json b/locales/pl-PL/chat.json index d62490ccc01b..ac58833d19c7 100644 --- a/locales/pl-PL/chat.json +++ b/locales/pl-PL/chat.json @@ -4,6 +4,7 @@ }, "agentDefaultMessage": "Cześć, jestem **{{name}}**, możesz od razu zacząć ze mną rozmawiać, lub udoskonalić moje informacje, przechodząc do [Ustawień asystenta](/chat/settings#session={{id}}).", "agentDefaultMessageWithSystemRole": "Cześć, jestem **{{name}}**, {{systemRole}}, zacznijmy rozmowę!", + "agentsAndConversations": "Agenci i rozmowy", "backToBottom": "Przewiń na dół", "clearCurrentMessages": "Wyczyść bieżącą rozmowę", "confirmClearCurrentMessages": "Czy na pewno chcesz wyczyścić bieżącą rozmowę? Tej operacji nie można cofnąć.", diff --git a/locales/pt-BR/chat.json b/locales/pt-BR/chat.json index 1e53f367f0ec..3d2da42cf1c1 100644 --- a/locales/pt-BR/chat.json +++ b/locales/pt-BR/chat.json @@ -4,6 +4,7 @@ }, "agentDefaultMessage": "Olá, eu sou **{{name}}**, você pode começar a conversar comigo agora ou ir para [Configurações do Assistente](/chat/settings#session={{id}}) para completar minhas informações.", "agentDefaultMessageWithSystemRole": "Olá, eu sou **{{name}}**, {{systemRole}}, vamos conversar!", + "agentsAndConversations": "Agentes e Conversas", "backToBottom": "Voltar para o início", "clearCurrentMessages": "Limpar mensagens atuais", "confirmClearCurrentMessages": "Você está prestes a limpar as mensagens desta sessão. Depois de limpar, não será possível recuperá-las. Por favor, confirme sua ação.", diff --git a/locales/ru-RU/chat.json b/locales/ru-RU/chat.json index 1de1b7b05ea8..69ef59df9fef 100644 --- a/locales/ru-RU/chat.json +++ b/locales/ru-RU/chat.json @@ -4,6 +4,7 @@ }, "agentDefaultMessage": "Привет, я **{{name}}**. Ты можешь начать общение со мной прямо сейчас или перейти к [настройкам помощника](/chat/settings#session={{id}}), чтобы улучшить мою информацию.", "agentDefaultMessageWithSystemRole": "Привет, я **{{name}}**, {{systemRole}}. Давай начнем разговор!", + "agentsAndConversations": "Агенты и беседы", "backToBottom": "Вернуться вниз", "clearCurrentMessages": "Очистить текущий разговор", "confirmClearCurrentMessages": "Вы уверены, что хотите очистить текущий разговор? После этого его нельзя будет восстановить.", diff --git a/locales/tr-TR/chat.json b/locales/tr-TR/chat.json index d220cf4ce99e..b817a8e69d0b 100644 --- a/locales/tr-TR/chat.json +++ b/locales/tr-TR/chat.json @@ -4,6 +4,7 @@ }, "agentDefaultMessage": "Merhaba, Ben **{{name}}**. Hemen benimle sohbet etmeye başlayabilirsiniz veya [Asistan Ayarları](/chat/settings#session={{id}}) sayfasına giderek bilgilerimi tamamlayabilirsiniz.", "agentDefaultMessageWithSystemRole": "Merhaba, Ben **{{name}}**, {{systemRole}}. Hemen sohbet etmeye başlayalım!", + "agentsAndConversations": "Ajanlar ve Konuşmalar", "backToBottom": "En alta git", "clearCurrentMessages": "Mevcut oturum mesajlarını temizle", "confirmClearCurrentMessages": "Mevcut oturum mesajlarını temizlemek üzeresiniz. Temizlendikten sonra geri alınamazlar. Lütfen eyleminizi onaylayın.", diff --git a/locales/vi-VN/chat.json b/locales/vi-VN/chat.json index 34e7a94076fe..b9f2ac55228d 100644 --- a/locales/vi-VN/chat.json +++ b/locales/vi-VN/chat.json @@ -4,6 +4,7 @@ }, "agentDefaultMessage": "Xin chào, tôi là **{{name}}**, bạn có thể bắt đầu trò chuyện với tôi ngay lập tức, hoặc đến [Cài đặt trợ lý](/chat/settings#session={{id}}) để hoàn thiện thông tin của tôi.", "agentDefaultMessageWithSystemRole": "Xin chào, tôi là **{{name}}**, {{systemRole}}. Hãy bắt đầu trò chuyện ngay!", + "agentsAndConversations": "Người hỗ trợ và cuộc trò chuyện", "backToBottom": "Quay về dưới cùng", "clearCurrentMessages": "Xóa tin nhắn hiện tại", "confirmClearCurrentMessages": "Bạn sắp xóa tin nhắn hiện tại. Hành động này không thể hoàn tác, vui lòng xác nhận.", diff --git a/locales/zh-CN/chat.json b/locales/zh-CN/chat.json index f75ba9095af2..c07b9f01f3c9 100644 --- a/locales/zh-CN/chat.json +++ b/locales/zh-CN/chat.json @@ -4,6 +4,7 @@ }, "agentDefaultMessage": "你好,我是 **{{name}}**,你可以立即与我开始对话,也可以前往 [助手设置](/chat/settings#session={{id}}) 完善我的信息。", "agentDefaultMessageWithSystemRole": "你好,我是 **{{name}}**,{{systemRole}},让我们开始对话吧!", + "agentsAndConversations": "助手与会话", "backToBottom": "跳转至当前", "clearCurrentMessages": "清空当前会话消息", "confirmClearCurrentMessages": "即将清空当前会话消息,清空后将无法找回,请确认你的操作", diff --git a/locales/zh-TW/chat.json b/locales/zh-TW/chat.json index c00f3bbaffbd..5fc9bfc2915e 100644 --- a/locales/zh-TW/chat.json +++ b/locales/zh-TW/chat.json @@ -4,6 +4,7 @@ }, "agentDefaultMessage": "你好,我是 **{{name}}**,你可以立即與我開始對話,也可以前往 [助手設置](/chat/settings#session={{id}}) 完善我的信息。", "agentDefaultMessageWithSystemRole": "你好,我是 **{{name}}**,{{systemRole}},讓我們開始對話吧!", + "agentsAndConversations": "助理與對話", "backToBottom": "返回底部", "clearCurrentMessages": "清空當前對話", "confirmClearCurrentMessages": "即將清空當前對話,清空後將無法找回,請確認你的操作", diff --git a/src/app/(main)/chat/(workspace)/_layout/Desktop/ChatHeader/Main.tsx b/src/app/(main)/chat/(workspace)/_layout/Desktop/ChatHeader/Main.tsx index 8eb250a93be8..106334b6bfe9 100644 --- a/src/app/(main)/chat/(workspace)/_layout/Desktop/ChatHeader/Main.tsx +++ b/src/app/(main)/chat/(workspace)/_layout/Desktop/ChatHeader/Main.tsx @@ -1,12 +1,15 @@ 'use client'; -import { Avatar, ChatHeaderTitle } from '@lobehub/ui'; +import { ActionIcon, Avatar, ChatHeaderTitle } from '@lobehub/ui'; import { Skeleton } from 'antd'; +import { PanelLeftClose, PanelLeftOpen } from 'lucide-react'; +import Link from 'next/link'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; import { Flexbox } from 'react-layout-kit'; import { useOpenChatSettings } from '@/hooks/useInterceptingRoutes'; +import { useGlobalStore } from '@/store/global'; import { useSessionStore } from '@/store/session'; import { sessionMetaSelectors, sessionSelectors } from '@/store/session/selectors'; @@ -28,6 +31,7 @@ const Main = memo(() => { const displayTitle = isInbox ? t('inbox.title') : title; const displayDesc = isInbox ? t('inbox.desc') : description; + const showSessionPanel = useGlobalStore((s) => s.preference.showSessionPanel); return !init ? ( @@ -40,6 +44,22 @@ const Main = memo(() => { ) : ( + { + + { + const currentShowSessionPanel = useGlobalStore.getState().preference.showSessionPanel; + useGlobalStore.getState().updatePreference({ + sessionsWidth: currentShowSessionPanel ? 0 : 320, + showSessionPanel: !currentShowSessionPanel, + }); + }} + size="large" + title={t('agentsAndConversations')} + /> + + }