@lobehub/chat 0.120.4 → 0.120.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,56 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 0.120.6](https://github.com/lobehub/lobe-chat/compare/v0.120.5...v0.120.6)
6
+
7
+ <sup>Released on **2024-01-22**</sup>
8
+
9
+ #### 💄 Styles
10
+
11
+ - **misc**: Fix share image tags not align.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### Styles
19
+
20
+ - **misc**: Fix share image tags not align, closes [#1047](https://github.com/lobehub/lobe-chat/issues/1047) ([28206b6](https://github.com/lobehub/lobe-chat/commit/28206b6))
21
+
22
+ </details>
23
+
24
+ <div align="right">
25
+
26
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
27
+
28
+ </div>
29
+
30
+ ### [Version 0.120.5](https://github.com/lobehub/lobe-chat/compare/v0.120.4...v0.120.5)
31
+
32
+ <sup>Released on **2024-01-21**</sup>
33
+
34
+ #### 💄 Styles
35
+
36
+ - **misc**: Update locale and add test for globalStore.
37
+
38
+ <br/>
39
+
40
+ <details>
41
+ <summary><kbd>Improvements and Fixes</kbd></summary>
42
+
43
+ #### Styles
44
+
45
+ - **misc**: Update locale and add test for globalStore, closes [#1119](https://github.com/lobehub/lobe-chat/issues/1119) ([4545cf0](https://github.com/lobehub/lobe-chat/commit/4545cf0))
46
+
47
+ </details>
48
+
49
+ <div align="right">
50
+
51
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
52
+
53
+ </div>
54
+
5
55
  ### [Version 0.120.4](https://github.com/lobehub/lobe-chat/compare/v0.120.3...v0.120.4)
6
56
 
7
57
  <sup>Released on **2024-01-21**</sup>
package/README.md CHANGED
@@ -223,14 +223,14 @@ Our marketplace is not just a showcase platform but also a collaborative space.
223
223
 
224
224
  <!-- AGENT LIST -->
225
225
 
226
- | Recent Submits | Description |
227
- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
228
- | [PromptGPT](https://chat-preview.lobehub.com/market?agent=prompt-gpt)<br/><sup>By **[110rever](https://github.com/110rever)** on **2024-01-19**</sup> | A customized GPT model named PromptGPT. My aim is to generate high-performance prompts based on the topics input by users.<br/>`generation` `artificial-intelligence` `interaction` `customized-experience` `feedback-mechanism` `best-practices` `step-by-step-guidance` `language-flexibility` `boundaries` |
229
- | [Tech Explorer AI](https://chat-preview.lobehub.com/market?agent=tech-explorer-ai)<br/><sup>By **[110rever](https://github.com/110rever)** on **2024-01-19**</sup> | Technology exploration AI capability: - Conduct comprehensive technical research - Provide predictive insights based on statistical data and trend analysis - Optimize research methodology - Maintain data accuracy and completeness - Infer limitations in the absence of complete data: - Only answer questions related to technology - Do not provide general purchasing advice - Provide product technology discussion through step-by-step guidance User interaction: - Provide clear and concise dialogue - Provide multilingual options Support objective: To provide accurate information and analyze predictions to deepen the understanding of technology among users.<br/>`technical-research` `data-analysis` `research-methods` `data-accuracy` `inference` `user-interaction` |
230
- | [AE Script Development Expert](https://chat-preview.lobehub.com/market?agent=ae-script-development)<br/><sup>By **[Wutpeach](https://github.com/Wutpeach)** on **2024-01-18**</sup> | An expert in AE script development, proficient in JavaScript programming, understanding of AE software principles, capable of debugging and optimizing scripts.<br/>`script-development` `programmer` `adobe-after-effects` `java-script` `algorithm-design` `debugging` `optimization` `coding-standards` `user-communication` `script-usage-instructions` |
231
- | [Code Companion](https://chat-preview.lobehub.com/market?agent=code-companion)<br/><sup>By **[110rever](https://github.com/110rever)** on **2024-01-18**</sup> | The best companion for programmers<br/>`code` `dev` `program` |
232
-
233
- > 📊 Total agents: [<kbd>**103**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
226
+ | Recent Submits | Description |
227
+ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
228
+ | [Accounting Expert Assistant](https://chat-preview.lobehub.com/market?agent=accounting)<br/><sup>By **[MYSeaIT](https://github.com/MYSeaIT)** on **2024-01-21**</sup> | Accountant Agent: Comprehensive accounting support and expertise for individuals and businesses worldwide.<br/>`accounting` `financial-management` `tax-planning` `budgeting` |
229
+ | [Business Guru](https://chat-preview.lobehub.com/market?agent=business-guru)<br/><sup>By **[MYSeaIT](https://github.com/MYSeaIT)** on **2024-01-21**</sup> | Business Consultant: Providing comprehensive business support and expertise worldwide.Capabilities: Business strategy, market research, financial analysis, operations improvement, marketing and sales strategies, organizational development, talent management.Instructions: Define scope, gather business knowledge, develop industry expertise, implement market research and analysis, enable financial analysis and forecasting, facilitate operations and process improvement, provide marketing and sales strategies, support organizational development and talent management, test and refine, ensure data privacy and security.<br/>`business-consultant` |
230
+ | [DIY Guide Assistant](https://chat-preview.lobehub.com/market?agent=diy)<br/><sup>By **[guluahljj](https://github.com/guluahljj)** on **2024-01-21**</sup> | DIY project assistant, providing detailed guidance, programming support, and personalized customization<br/>`diy` `guide` `project` `programming` `assembly` |
231
+ | [Financial Expert](https://chat-preview.lobehub.com/market?agent=finnance)<br/><sup>By **[MYSeaIT](https://github.com/MYSeaIT)** on **2024-01-21**</sup> | Finance Expert with Global Financial Expertise, Multilingual Communication, Financial Analysis and Reporting, Investment Planning and Portfolio Management, Financial Planning and Retirement Strategies, and Risk Management and Insurance capabilities.<br/>`inancial-management` |
232
+
233
+ > 📊 Total agents: [<kbd>**111**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
234
234
 
235
235
  <!-- AGENT LIST -->
236
236
 
package/README.zh-CN.md CHANGED
@@ -203,14 +203,14 @@ LobeChat 的插件生态系统是其核心功能的重要扩展,它极大地
203
203
 
204
204
  <!-- AGENT LIST -->
205
205
 
206
- | 最近新增 | 助手说明 |
207
- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
208
- | [PromptGPT](https://chat-preview.lobehub.com/market?agent=prompt-gpt)<br/><sup>By **[110rever](https://github.com/110rever)** on **2024-01-19**</sup> | 一个名为 PromptGPT 的定制 GPT 模型。我的目标是基于用户输入的主题生成高性能提示。<br/>`生成` `人工智能` `交互` `定制体验` `反馈机制` `最佳实践` `逐步指导` `语言灵活性` `边界` |
209
- | [Tech Explorer AI](https://chat-preview.lobehub.com/market?agent=tech-explorer-ai)<br/><sup>By **[110rever](https://github.com/110rever)** on **2024-01-19**</sup> | 技术探索人工智能能力:- 进行全面的技术研究 - 基于统计数据和趋势分析提供预测性见解 - 优化研究方法论 - 保持数据准确性和完整性 - 推断在没有完整数据的情况下的局限性:- 仅回答与技术相关的问题 - 不提供一般性的购买建议 - 通过逐步指导提供产品技术讨论用户交互:- 提供清晰简洁的对话 - 提供多语言选项支持目标:为用户提供准确的信息并分析预测,以加深他们对技术的理解。<br/>`技术研究` `数据分析` `研究方法` `数据准确性` `推断` `用户交互` |
210
- | [AE 脚本开发专家](https://chat-preview.lobehub.com/market?agent=ae-script-development)<br/><sup>By **[Wutpeach](https://github.com/Wutpeach)** on **2024-01-18**</sup> | AE 脚本开发专家,精通 JavaScript 编程,理解 AE 软件工作原理,能够调试和优化脚本。<br/>`脚本开发` `程序员` `adobe-after-effects` `java-script` `算法设计` `调试` `优化` `编程规范` `用户沟通` `脚本使用说明` |
211
- | [Code Companion](https://chat-preview.lobehub.com/market?agent=code-companion)<br/><sup>By **[110rever](https://github.com/110rever)** on **2024-01-18**</sup> | 程序员的最佳伴侣<br/>`code` `dev` `program` |
212
-
213
- > 📊 Total agents: [<kbd>**103**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
206
+ | 最近新增 | 助手说明 |
207
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
208
+ | [会计专家助手](https://chat-preview.lobehub.com/market?agent=accounting)<br/><sup>By **[MYSeaIT](https://github.com/MYSeaIT)** on **2024-01-21**</sup> | 会计代理:为全球个人和企业提供全面的会计支持和专业知识。<br/>`会计` `财务管理` `税务规划` `预算编制` |
209
+ | [商业顾问](https://chat-preview.lobehub.com/market?agent=business-guru)<br/><sup>By **[MYSeaIT](https://github.com/MYSeaIT)** on **2024-01-21**</sup> | 商业顾问:为全球提供全面的商业支持和专业知识。能力:商业战略、市场研究、财务分析、运营改善、营销和销售策略、组织发展、人才管理。说明:定义范围,收集商业知识,发展行业专长,实施市场研究和分析,启用财务分析和预测,促进运营和流程改善,提供营销和销售策略,支持组织发展和人才管理,测试和完善,确保数据隐私和安全。<br/>`business-consultant` |
210
+ | [DIY 指导助手](https://chat-preview.lobehub.com/market?agent=diy)<br/><sup>By **[guluahljj](https://github.com/guluahljj)** on **2024-01-21**</sup> | DIY 项目助手,提供详细指导、编程支持和个性化定制<br/>`diy` `指导` `项目` `编程` `组装` |
211
+ | [金融专家](https://chat-preview.lobehub.com/market?agent=finnance)<br/><sup>By **[MYSeaIT](https://github.com/MYSeaIT)** on **2024-01-21**</sup> | 具有全球金融专业知识、多语沟通能力、财务分析和报告、投资规划和投资组合管理、财务规划和退休策略、以及风险管理和保险能力的金融专家。<br/>`金融管理` |
212
+
213
+ > 📊 Total agents: [<kbd>**111**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
214
214
 
215
215
  <!-- AGENT LIST -->
216
216
 
@@ -13,6 +13,7 @@
13
13
  "close": "إغلاق",
14
14
  "confirmRemoveSessionItemAlert": "سيتم حذف هذا المساعد قريبًا، وبمجرد الحذف لن يمكن استعادته، يرجى تأكيد الإجراء",
15
15
  "copy": "نسخ",
16
+ "copyFail": "فشل في النسخ",
16
17
  "copySuccess": "تم النسخ بنجاح",
17
18
  "defaultAgent": "مساعد افتراضي",
18
19
  "defaultSession": "جلسة افتراضية",
@@ -13,6 +13,7 @@
13
13
  "close": "Schließen",
14
14
  "confirmRemoveSessionItemAlert": "Möchten Sie diesen Assistenten wirklich löschen? Nach dem Löschen kann er nicht wiederhergestellt werden. Bitte bestätigen Sie Ihre Aktion.",
15
15
  "copy": "Kopieren",
16
+ "copyFail": "Kopieren fehlgeschlagen",
16
17
  "copySuccess": "Kopieren erfolgreich",
17
18
  "defaultAgent": "Standardassistent",
18
19
  "defaultSession": "Standardassistent",
@@ -13,6 +13,7 @@
13
13
  "close": "Close",
14
14
  "confirmRemoveSessionItemAlert": "You are about to delete this agent. Once deleted, it cannot be recovered. Please confirm your action.",
15
15
  "copy": "Copy",
16
+ "copyFail": "Copy failed",
16
17
  "copySuccess": "Copied successfully",
17
18
  "defaultAgent": "Default Agent",
18
19
  "defaultSession": "Default Agent",
@@ -13,6 +13,7 @@
13
13
  "close": "Cerrar",
14
14
  "confirmRemoveSessionItemAlert": "Estás a punto de eliminar este asistente. Una vez eliminado, no se podrá recuperar. Por favor, confirma tu acción",
15
15
  "copy": "Copiar",
16
+ "copyFail": "Fallo al copiar",
16
17
  "copySuccess": "¡Copia exitosa!",
17
18
  "defaultAgent": "Asistente predeterminado",
18
19
  "defaultSession": "Sesión predeterminada",
@@ -13,6 +13,7 @@
13
13
  "close": "Fermer",
14
14
  "confirmRemoveSessionItemAlert": "Vous êtes sur le point de supprimer cet agent. Une fois supprimé, il ne pourra pas être récupéré. Veuillez confirmer votre action.",
15
15
  "copy": "Copier",
16
+ "copyFail": "Échec de la copie",
16
17
  "copySuccess": "Copie réussie",
17
18
  "defaultAgent": "Agent par défaut",
18
19
  "defaultSession": "Session par défaut",
@@ -13,6 +13,7 @@
13
13
  "close": "Chiudi",
14
14
  "confirmRemoveSessionItemAlert": "Stai per eliminare questo assistente. Una volta eliminato, non sarà possibile recuperarlo. Confermi l'operazione?",
15
15
  "copy": "Copia",
16
+ "copyFail": "Copia non riuscita",
16
17
  "copySuccess": "Copia riuscita",
17
18
  "defaultAgent": "Assistente predefinito",
18
19
  "defaultSession": "Sessione predefinita",
@@ -13,6 +13,7 @@
13
13
  "close": "閉じる",
14
14
  "confirmRemoveSessionItemAlert": "このエージェントを削除します。削除後は元に戻すことはできません。操作を確認してください。",
15
15
  "copy": "コピー",
16
+ "copyFail": "コピーに失敗しました",
16
17
  "copySuccess": "コピーが成功しました",
17
18
  "defaultAgent": "デフォルトエージェント",
18
19
  "defaultSession": "デフォルトセッション",
@@ -13,6 +13,7 @@
13
13
  "close": "닫기",
14
14
  "confirmRemoveSessionItemAlert": "이 에이전트를 삭제하려고 합니다. 삭제 후에는 복구할 수 없습니다. 작업을 확인하십시오.",
15
15
  "copy": "복사",
16
+ "copyFail": "복사 실패",
16
17
  "copySuccess": "복사 성공",
17
18
  "defaultAgent": "기본 에이전트",
18
19
  "defaultSession": "기본 세션",
@@ -13,6 +13,7 @@
13
13
  "close": "Sluiten",
14
14
  "confirmRemoveSessionItemAlert": "U staat op het punt deze assistent te verwijderen. Na verwijdering kan deze niet worden hersteld. Weet u zeker dat u door wilt gaan?",
15
15
  "copy": "Kopiëren",
16
+ "copyFail": "Kopiëren mislukt",
16
17
  "copySuccess": "Kopiëren gelukt",
17
18
  "defaultAgent": "Standaard assistent",
18
19
  "defaultSession": "Standaard assistent",
@@ -13,6 +13,7 @@
13
13
  "close": "Zamknij",
14
14
  "confirmRemoveSessionItemAlert": "Czy na pewno chcesz usunąć tego asystenta? Po usunięciu nie będzie możliwe jego odzyskanie.",
15
15
  "copy": "Kopiuj",
16
+ "copyFail": "Nie udało się skopiować",
16
17
  "copySuccess": "Skopiowano pomyślnie",
17
18
  "defaultAgent": "Domyślny asystent",
18
19
  "defaultSession": "Domyślna sesja",
@@ -13,6 +13,7 @@
13
13
  "close": "Fechar",
14
14
  "confirmRemoveSessionItemAlert": "Você está prestes a excluir este assistente. Após a exclusão, não será possível recuperá-lo. Por favor, confirme sua ação.",
15
15
  "copy": "Copiar",
16
+ "copyFail": "Falha ao copiar",
16
17
  "copySuccess": "Cópia bem-sucedida",
17
18
  "defaultAgent": "Assistente padrão",
18
19
  "defaultSession": "Sessão padrão",
@@ -13,6 +13,7 @@
13
13
  "close": "Закрыть",
14
14
  "confirmRemoveSessionItemAlert": "Вы собираетесь удалить этого агента. После удаления его будет невозможно восстановить. Подтвердите ваше действие",
15
15
  "copy": "Копировать",
16
+ "copyFail": "Не удалось скопировать",
16
17
  "copySuccess": "Успешно скопировано",
17
18
  "defaultAgent": "Пользовательский агент",
18
19
  "defaultSession": "Пользовательский агент",
@@ -13,6 +13,7 @@
13
13
  "close": "Kapat",
14
14
  "confirmRemoveSessionItemAlert": "Bu asistanı silmek üzeresiniz. Silindikten sonra geri alınamaz. Lütfen eyleminizi onaylayın.",
15
15
  "copy": "Kopyala",
16
+ "copyFail": "Kopyalama başarısız oldu",
16
17
  "copySuccess": "Kopyalama Başarılı",
17
18
  "defaultAgent": "Varsayılan Asistan",
18
19
  "defaultSession": "Varsayılan Asistan",
@@ -13,6 +13,7 @@
13
13
  "close": "Đóng",
14
14
  "confirmRemoveSessionItemAlert": "Bạn sắp xóa trợ lý này. Sau khi xóa, bạn sẽ không thể khôi phục. Vui lòng xác nhận hành động của bạn",
15
15
  "copy": "Sao chép",
16
+ "copyFail": "Sao chép thất bại",
16
17
  "copySuccess": "Sao chép thành công",
17
18
  "defaultAgent": "Trợ lý mặc định",
18
19
  "defaultSession": "Phiên mặc định",
@@ -13,6 +13,7 @@
13
13
  "close": "关闭",
14
14
  "confirmRemoveSessionItemAlert": "即将删除该助手,删除后该将无法找回,请确认你的操作",
15
15
  "copy": "复制",
16
+ "copyFail": "复制失败",
16
17
  "copySuccess": "复制成功",
17
18
  "defaultAgent": "自定义助手",
18
19
  "defaultSession": "自定义助手",
@@ -13,6 +13,7 @@
13
13
  "close": "關閉",
14
14
  "confirmRemoveSessionItemAlert": "即將刪除此助手,刪除後將無法復原,請確認您的操作",
15
15
  "copy": "複製",
16
+ "copyFail": "複製失敗",
16
17
  "copySuccess": "複製成功",
17
18
  "defaultAgent": "預設助手",
18
19
  "defaultSession": "預設助手",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "0.120.4",
3
+ "version": "0.120.6",
4
4
  "description": "Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
5
5
  "keywords": [
6
6
  "framework",
@@ -84,10 +84,10 @@
84
84
  "@lobehub/ui": "latest",
85
85
  "@vercel/analytics": "^1",
86
86
  "ahooks": "^3",
87
- "ai": "^2.2.22",
88
- "antd": "^5.12.7",
87
+ "ai": "^2",
88
+ "antd": "^5",
89
89
  "antd-style": "^3",
90
- "brotli-wasm": "^2.0.0",
90
+ "brotli-wasm": "^2",
91
91
  "chroma-js": "^2",
92
92
  "copy-to-clipboard": "^3",
93
93
  "dayjs": "^1",
@@ -104,16 +104,16 @@
104
104
  "lucide-react": "latest",
105
105
  "modern-screenshot": "^4",
106
106
  "nanoid": "^5",
107
- "next": "^14.0.2",
107
+ "next": "^14.1",
108
108
  "nuqs": "^1.15.4",
109
- "openai": "^4.17.3",
109
+ "openai": "^4.22",
110
110
  "polished": "^4",
111
111
  "posthog-js": "^1",
112
112
  "query-string": "^8",
113
113
  "react": "^18",
114
114
  "react-dom": "^18",
115
- "react-hotkeys-hook": "^4.4.3",
116
- "react-i18next": "^14.0.0",
115
+ "react-hotkeys-hook": "^4",
116
+ "react-i18next": "^14",
117
117
  "react-intersection-observer": "^9",
118
118
  "react-layout-kit": "^1",
119
119
  "react-lazy-load": "^4",
@@ -122,9 +122,9 @@
122
122
  "remark": "^14",
123
123
  "remark-gfm": "^3",
124
124
  "remark-html": "^15",
125
- "rtl-detect": "^1.1.2",
125
+ "rtl-detect": "^1",
126
126
  "semver": "^7",
127
- "sharp": "0.33.1",
127
+ "sharp": "^0.33.2",
128
128
  "swr": "^2",
129
129
  "systemjs": "^6",
130
130
  "ts-md5": "^1",
@@ -148,19 +148,19 @@
148
148
  "@testing-library/jest-dom": "^6",
149
149
  "@testing-library/react": "^14",
150
150
  "@types/chroma-js": "^2",
151
- "@types/json-schema": "^7.0.15",
151
+ "@types/json-schema": "^7",
152
152
  "@types/lodash": "^4",
153
153
  "@types/lodash-es": "^4",
154
154
  "@types/node": "^20",
155
155
  "@types/react": "^18",
156
156
  "@types/react-dom": "^18",
157
- "@types/rtl-detect": "^1.0.3",
157
+ "@types/rtl-detect": "^1",
158
158
  "@types/semver": "^7",
159
159
  "@types/systemjs": "^6",
160
160
  "@types/ua-parser-js": "^0.7",
161
161
  "@types/uuid": "^9",
162
162
  "@umijs/lint": "^4",
163
- "@vitest/coverage-v8": "^1.1.3",
163
+ "@vitest/coverage-v8": "^1",
164
164
  "commitlint": "^18",
165
165
  "consola": "^3",
166
166
  "dpdm": "^3",
@@ -168,7 +168,7 @@
168
168
  "fake-indexeddb": "^5",
169
169
  "glob": "^10",
170
170
  "husky": "^8",
171
- "jsdom": "^23.0.0",
171
+ "jsdom": "^23",
172
172
  "just-diff": "^6",
173
173
  "lint-staged": "^15",
174
174
  "lodash": "^4",
@@ -184,8 +184,8 @@
184
184
  "typescript": "^5",
185
185
  "unified": "^11",
186
186
  "unist-util-visit": "^5",
187
- "vitest": "^1.1.3",
188
- "vitest-canvas-mock": "^0.3.3"
187
+ "vitest": "^1",
188
+ "vitest-canvas-mock": "^0.3"
189
189
  },
190
190
  "publishConfig": {
191
191
  "access": "public",
@@ -38,7 +38,7 @@ export const useStyles = createStyles(({ css, token, stylish, cx }, withBackgrou
38
38
  overflow: hidden scroll;
39
39
 
40
40
  width: 100%;
41
- max-height: 40vh;
41
+ max-height: 40dvh;
42
42
 
43
43
  background: ${token.colorBgLayout};
44
44
  border: 1px solid ${token.colorBorder};
@@ -46,7 +46,6 @@ export const useStyles = createStyles(({ css, token, stylish, cx }, withBackgrou
46
46
 
47
47
  * {
48
48
  pointer-events: none;
49
- overflow: hidden;
50
49
 
51
50
  ::-webkit-scrollbar {
52
51
  width: 0 !important;
@@ -13,6 +13,7 @@ export default {
13
13
  close: '关闭',
14
14
  confirmRemoveSessionItemAlert: '即将删除该助手,删除后该将无法找回,请确认你的操作',
15
15
  copy: '复制',
16
+ copyFail: '复制失败',
16
17
  copySuccess: '复制成功',
17
18
  defaultAgent: '自定义助手',
18
19
  defaultSession: '自定义助手',
@@ -0,0 +1,117 @@
1
+ import { act, renderHook } from '@testing-library/react';
2
+ import { DeepPartial } from 'utility-types';
3
+ import { describe, expect, it, vi } from 'vitest';
4
+
5
+ import { DEFAULT_AGENT, DEFAULT_SETTINGS } from '@/const/settings';
6
+ import { useGlobalStore } from '@/store/global';
7
+ import { SettingsTabs } from '@/store/global/initialState';
8
+ import { LobeAgentSettings } from '@/types/session';
9
+ import { GlobalSettings, OpenAIConfig } from '@/types/settings';
10
+
11
+ beforeEach(() => {
12
+ vi.clearAllMocks();
13
+ });
14
+
15
+ vi.mock('@/utils/uuid', () => ({
16
+ nanoid: vi.fn(() => 'unique-id'),
17
+ }));
18
+
19
+ describe('SettingsAction', () => {
20
+ describe('importAppSettings', () => {
21
+ it('should import app settings', () => {
22
+ const { result } = renderHook(() => useGlobalStore());
23
+ const newSettings: GlobalSettings = {
24
+ ...DEFAULT_SETTINGS,
25
+ themeMode: 'dark',
26
+ };
27
+
28
+ act(() => {
29
+ result.current.importAppSettings(newSettings);
30
+ });
31
+
32
+ expect(result.current.settings).toEqual(newSettings);
33
+ });
34
+ });
35
+
36
+ describe('resetSettings', () => {
37
+ it('should reset settings to default', () => {
38
+ const { result } = renderHook(() => useGlobalStore());
39
+
40
+ act(() => {
41
+ result.current.resetSettings();
42
+ });
43
+
44
+ expect(result.current.settings).toEqual(DEFAULT_SETTINGS);
45
+ });
46
+ });
47
+
48
+ describe('setOpenAIConfig', () => {
49
+ it('should set OpenAI configuration', () => {
50
+ const { result } = renderHook(() => useGlobalStore());
51
+ const openAIConfig: Partial<OpenAIConfig> = { OPENAI_API_KEY: 'test' };
52
+
53
+ act(() => {
54
+ result.current.setOpenAIConfig(openAIConfig);
55
+ });
56
+
57
+ expect(result.current.settings.languageModel.openAI.OPENAI_API_KEY).toEqual(
58
+ openAIConfig.OPENAI_API_KEY,
59
+ );
60
+ });
61
+ });
62
+
63
+ describe('setSettings', () => {
64
+ it('should set partial settings', () => {
65
+ const { result } = renderHook(() => useGlobalStore());
66
+ const partialSettings: Partial<GlobalSettings> = { themeMode: 'dark' };
67
+
68
+ act(() => {
69
+ result.current.setSettings(partialSettings);
70
+ });
71
+
72
+ expect(result.current.settings.themeMode).toEqual('dark');
73
+ });
74
+ });
75
+
76
+ describe('switchSettingTabs', () => {
77
+ it('should switch settings tabs', () => {
78
+ const { result } = renderHook(() => useGlobalStore());
79
+
80
+ act(() => {
81
+ result.current.switchSettingTabs(SettingsTabs.Agent);
82
+ });
83
+
84
+ expect(result.current.settingsTab).toEqual(SettingsTabs.Agent);
85
+ });
86
+ });
87
+
88
+ describe('switchThemeMode', () => {
89
+ it('should switch theme mode', () => {
90
+ const { result } = renderHook(() => useGlobalStore());
91
+
92
+ act(() => {
93
+ result.current.switchThemeMode('light');
94
+ });
95
+
96
+ expect(result.current.settings.themeMode).toEqual('light');
97
+ });
98
+ });
99
+
100
+ describe('updateDefaultAgent', () => {
101
+ it('should update default agent settings', () => {
102
+ const { result } = renderHook(() => useGlobalStore());
103
+ const updatedAgent: DeepPartial<LobeAgentSettings> = {
104
+ meta: { title: 'docs' },
105
+ };
106
+
107
+ act(() => {
108
+ result.current.updateDefaultAgent(updatedAgent);
109
+ });
110
+
111
+ expect(result.current.settings.defaultAgent).toEqual({
112
+ ...DEFAULT_AGENT,
113
+ ...updatedAgent,
114
+ });
115
+ });
116
+ });
117
+ });
@@ -118,7 +118,7 @@ export const createSessionSlice: StateCreator<
118
118
 
119
119
  // duplicate Session Error
120
120
  if (!newId) {
121
- message.error('复制失败');
121
+ message.error(t('copyFail', { ns: 'common' }));
122
122
  return;
123
123
  }
124
124
 
@@ -8,7 +8,7 @@ export default ({ prefixCls }: { prefixCls: string }) => css`
8
8
  position: relative;
9
9
  overscroll-behavior: none;
10
10
  height: 100% !important;
11
- min-height: 100% !important;
11
+ max-height: 100dvh !important;
12
12
 
13
13
  ::-webkit-scrollbar {
14
14
  display: none;