@lobehub/chat 0.15.0 → 0.16.0

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,64 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ## [Version 0.16.0](https://github.com/lobehub/lobe-chat/compare/v0.15.1...v0.16.0)
6
+
7
+ <sup>Released on **2023-07-24**</sup>
8
+
9
+ #### ✨ Features
10
+
11
+ - **misc**: 支持自动跳转到第一条会话.
12
+
13
+ #### 💄 Styles
14
+
15
+ - **misc**: 修正插件的展示文案.
16
+
17
+ <br/>
18
+
19
+ <details>
20
+ <summary><kbd>Improvements and Fixes</kbd></summary>
21
+
22
+ #### What's improved
23
+
24
+ - **misc**: 支持自动跳转到第一条会话 ([54f01c7](https://github.com/lobehub/lobe-chat/commit/54f01c7))
25
+
26
+ #### Styles
27
+
28
+ - **misc**: 修正插件的展示文案 ([53c81ae](https://github.com/lobehub/lobe-chat/commit/53c81ae))
29
+
30
+ </details>
31
+
32
+ <div align="right">
33
+
34
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
35
+
36
+ </div>
37
+
38
+ ### [Version 0.15.1](https://github.com/lobehub/lobe-chat/compare/v0.15.0...v0.15.1)
39
+
40
+ <sup>Released on **2023-07-24**</sup>
41
+
42
+ #### 💄 Styles
43
+
44
+ - **misc**: 更新插件文案.
45
+
46
+ <br/>
47
+
48
+ <details>
49
+ <summary><kbd>Improvements and Fixes</kbd></summary>
50
+
51
+ #### Styles
52
+
53
+ - **misc**: 更新插件文案 ([0411335](https://github.com/lobehub/lobe-chat/commit/0411335))
54
+
55
+ </details>
56
+
57
+ <div align="right">
58
+
59
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
60
+
61
+ </div>
62
+
5
63
  ## [Version 0.15.0](https://github.com/lobehub/lobe-chat/compare/v0.14.0...v0.15.0)
6
64
 
7
65
  <sup>Released on **2023-07-24**</sup>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "0.15.0",
3
+ "version": "0.16.0",
4
4
  "description": "Lobe Chat is an open-source chatbot client using LangChain, Typescript and Next.js",
5
5
  "keywords": [
6
6
  "chatbot",
@@ -38,7 +38,7 @@ const MessageExtra = ({ role, extra, function_call }: ChatMessage): ReactNode =>
38
38
  ) : (
39
39
  <Icon icon={LucideToyBrick} />
40
40
  )}
41
- {t(`plugin-${function_call?.name}` as any)}
41
+ {t(`plugins.${function_call?.name}` as any, { ns: 'plugin' })}
42
42
  </Tag>
43
43
  </Tooltip>
44
44
  );
@@ -1 +1,24 @@
1
- export { default } from './[id]/index.page';
1
+ import Router from 'next/router';
2
+ import { useEffect } from 'react';
3
+
4
+ import { sessionSelectors, useSessionStore } from '@/store/session';
5
+
6
+ import Chat from './[id]/index.page';
7
+
8
+ export default () => {
9
+ // 支持用户在进到首页时,自动激活第一个列表中的角色
10
+ useEffect(() => {
11
+ const hasRehydrated = useSessionStore.persist.hasHydrated();
12
+ // 只有当水合完毕后,才往下走
13
+ if (!hasRehydrated) return;
14
+
15
+ // 如果当前有会话,那么就激活第一个会话
16
+ const list = sessionSelectors.chatList(useSessionStore.getState());
17
+ if (list.length > 0) {
18
+ const sessionId = list[0].id;
19
+ Router.push(`/chat/${sessionId}`);
20
+ }
21
+ }, []);
22
+
23
+ return <Chat />;
24
+ };