@lobehub/chat 1.97.10 → 1.97.11

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,31 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 1.97.11](https://github.com/lobehub/lobe-chat/compare/v1.97.10...v1.97.11)
6
+
7
+ <sup>Released on **2025-07-11**</sup>
8
+
9
+ #### 💄 Styles
10
+
11
+ - **misc**: Open new topic by tap Just Chat again.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### Styles
19
+
20
+ - **misc**: Open new topic by tap Just Chat again, closes [#8311](https://github.com/lobehub/lobe-chat/issues/8311) ([7e2f4ce](https://github.com/lobehub/lobe-chat/commit/7e2f4ce))
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
+
5
30
  ### [Version 1.97.10](https://github.com/lobehub/lobe-chat/compare/v1.97.9...v1.97.10)
6
31
 
7
32
  <sup>Released on **2025-07-11**</sup>
package/changelog/v1.json CHANGED
@@ -1,4 +1,13 @@
1
1
  [
2
+ {
3
+ "children": {
4
+ "improvements": [
5
+ "Open new topic by tap Just Chat again."
6
+ ]
7
+ },
8
+ "date": "2025-07-11",
9
+ "version": "1.97.11"
10
+ },
2
11
  {
3
12
  "children": {
4
13
  "improvements": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "1.97.10",
3
+ "version": "1.97.11",
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",
@@ -6,6 +6,8 @@ import { DEFAULT_INBOX_AVATAR } from '@/const/meta';
6
6
  import { INBOX_SESSION_ID } from '@/const/session';
7
7
  import { SESSION_CHAT_URL } from '@/const/url';
8
8
  import { useSwitchSession } from '@/hooks/useSwitchSession';
9
+ import { getChatStoreState, useChatStore } from '@/store/chat';
10
+ import { chatSelectors } from '@/store/chat/selectors';
9
11
  import { useServerConfigStore } from '@/store/serverConfig';
10
12
  import { useSessionStore } from '@/store/session';
11
13
 
@@ -17,13 +19,24 @@ const Inbox = memo(() => {
17
19
  const activeId = useSessionStore((s) => s.activeId);
18
20
  const switchSession = useSwitchSession();
19
21
 
22
+ const openNewTopicOrSaveTopic = useChatStore((s) => s.openNewTopicOrSaveTopic);
23
+
20
24
  return (
21
25
  <Link
22
26
  aria-label={t('inbox.title')}
23
27
  href={SESSION_CHAT_URL(INBOX_SESSION_ID, mobile)}
24
- onClick={(e) => {
28
+ onClick={async (e) => {
25
29
  e.preventDefault();
26
- switchSession(INBOX_SESSION_ID);
30
+ if (activeId === INBOX_SESSION_ID) {
31
+ // If user tap the inbox again, open a new topic
32
+ const inboxMessages = chatSelectors.inboxActiveTopicMessages(getChatStoreState());
33
+
34
+ if (inboxMessages.length > 0) {
35
+ await openNewTopicOrSaveTopic();
36
+ }
37
+ } else {
38
+ switchSession(INBOX_SESSION_ID);
39
+ }
27
40
  }}
28
41
  >
29
42
  <ListItem
@@ -201,6 +201,11 @@ const isSendButtonDisabledByMessage = (s: ChatStoreState) =>
201
201
  // 4. when the message is in RAG flow
202
202
  isInRAGFlow(s);
203
203
 
204
+ const inboxActiveTopicMessages = (state: ChatStoreState) => {
205
+ const activeTopicId = state.activeTopicId;
206
+ return state.messagesMap[messageMapKey(INBOX_SESSION_ID, activeTopicId)] || [];
207
+ };
208
+
204
209
  export const chatSelectors = {
205
210
  activeBaseChats,
206
211
  activeBaseChatsWithoutTool,
@@ -213,6 +218,7 @@ export const chatSelectors = {
213
218
  getMessageById,
214
219
  getMessageByToolCallId,
215
220
  getTraceIdByMessageId,
221
+ inboxActiveTopicMessages,
216
222
  isAIGenerating,
217
223
  isCreatingMessage,
218
224
  isCurrentChatLoaded,