@lobehub/chat 0.162.13 โ†’ 0.162.15

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.162.15](https://github.com/lobehub/lobe-chat/compare/v0.162.14...v0.162.15)
6
+
7
+ <sup>Released on **2024-06-03**</sup>
8
+
9
+ #### ๐Ÿ› Bug Fixes
10
+
11
+ - **misc**: Fix send button loading on only add user message.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### What's fixed
19
+
20
+ - **misc**: Fix send button loading on only add user message, closes [#2774](https://github.com/lobehub/lobe-chat/issues/2774) ([a7f2982](https://github.com/lobehub/lobe-chat/commit/a7f2982))
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.162.14](https://github.com/lobehub/lobe-chat/compare/v0.162.13...v0.162.14)
31
+
32
+ <sup>Released on **2024-06-03**</sup>
33
+
34
+ #### ๐Ÿ’„ Styles
35
+
36
+ - **misc**: Improve loading state.
37
+
38
+ <br/>
39
+
40
+ <details>
41
+ <summary><kbd>Improvements and Fixes</kbd></summary>
42
+
43
+ #### Styles
44
+
45
+ - **misc**: Improve loading state, closes [#2767](https://github.com/lobehub/lobe-chat/issues/2767) ([fbdfde9](https://github.com/lobehub/lobe-chat/commit/fbdfde9))
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.162.13](https://github.com/lobehub/lobe-chat/compare/v0.162.12...v0.162.13)
6
56
 
7
57
  <sup>Released on **2024-06-01**</sup>
package/README.md CHANGED
@@ -223,14 +223,14 @@ In addition, these plugins are not limited to news aggregation, but can also ext
223
223
 
224
224
  <!-- PLUGIN LIST -->
225
225
 
226
- | Recent Submits | Description |
227
- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
228
- | [Space](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **automateyournetwork** on **2024-05-12**</sup> | Space data including NASA.<br/>`space` `nasa` |
229
- | [Search1API](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **fatwang2** on **2024-05-06**</sup> | Search aggregation service, specifically designed for LLMs<br/>`web` `search` |
230
- | [Search Google via Serper](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **Barry** on **2024-04-30**</sup> | Google search engine via Serper.dev free API (2500x๐Ÿ†“/month)<br/>`web` `search` |
231
- | [NFT Guru](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **swap** on **2024-04-03**</sup> | Discover current prices of NFTs across major platforms and keep track of the rapidly changing marketplace with real-time<br/>`crypto` `nft` |
226
+ | Recent Submits | Description |
227
+ | ------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
228
+ | [Social Search](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **say-apps** on **2024-06-02**</sup> | The Social Search provides access to tweets, users, followers, images, media and more.<br/>`social` `twitter` `x` `search` |
229
+ | [Space](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **automateyournetwork** on **2024-05-12**</sup> | Space data including NASA.<br/>`space` `nasa` |
230
+ | [Search1API](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **fatwang2** on **2024-05-06**</sup> | Search aggregation service, specifically designed for LLMs<br/>`web` `search` |
231
+ | [Search Google via Serper](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **Barry** on **2024-04-30**</sup> | Google search engine via Serper.dev free API (2500x๐Ÿ†“/month)<br/>`web` `search` |
232
232
 
233
- > ๐Ÿ“Š Total plugins: [<kbd>**54**</kbd>](https://github.com/lobehub/lobe-chat-plugins)
233
+ > ๐Ÿ“Š Total plugins: [<kbd>**55**</kbd>](https://github.com/lobehub/lobe-chat-plugins)
234
234
 
235
235
  <!-- PLUGIN LIST -->
236
236
 
@@ -264,12 +264,12 @@ Our marketplace is not just a showcase platform but also a collaborative space.
264
264
 
265
265
  | Recent Submits | Description |
266
266
  | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
267
+ | [Chinese History Lecturer](https://chat-preview.lobehub.com/market?agent=history-master)<br/><sup>By **[a562314](https://github.com/a562314)** on **2024-05-30**</sup> | Proficient in Chinese history, explaining historical issues in a simple and clear manner, emphasizing historical accuracy, and applying dialectical materialism.<br/>`historian` `teaching-ability` `dialectical-materialism` `simple-and-clear` `multiple-comparisons` `twenty-four-histories` |
267
268
  | [Dart/Flutter Dev](https://chat-preview.lobehub.com/market?agent=dart-flutter)<br/><sup>By **[rezmeplxrf](https://github.com/rezmeplxrf)** on **2024-05-28**</sup> | Dart/Flutter Expert. Never nest more than 3 levels deep. Use riverpod, flutter_riverpod, riverpod_hook, flutter_hook for state management.<br/>`dart` `flutter` `development` `state-management` `riverpod` |
268
269
  | [C# .NET Technology Expert](https://chat-preview.lobehub.com/market?agent=dotnet-expert)<br/><sup>By **[johnnyqian](https://github.com/johnnyqian)** on **2024-05-28**</sup> | C# .NET Technology Expert<br/>`net` `developer` `net-core` `azure` `c` `microsoft` `sql-server` `entity-framework` `ef` `ef-core` |
269
270
  | [Christian Missionary](https://chat-preview.lobehub.com/market?agent=jesus-missionary)<br/><sup>By **[epochaudio](https://github.com/epochaudio)** on **2024-05-28**</sup> | As a missionary of Jesus, I will enlighten your understanding and practical application of God's word based on the teachings of the Bible. Whether in times of confusion or seeking spiritual growth, I am here to serve you by this source of wisdom.<br/>`bible-teaching` `christian-mission` `theology-preaching` |
270
- | [Daily Assistant](https://chat-preview.lobehub.com/market?agent=junior-helper)<br/><sup>By **[Qinks6](https://github.com/Qinks6)** on **2024-05-28**</sup> | A cute little helper that can search and draw<br/>`assistant` `search` `drawing` `information-retrieval` `user-interaction` |
271
271
 
272
- > ๐Ÿ“Š Total agents: [<kbd>**280**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
272
+ > ๐Ÿ“Š Total agents: [<kbd>**281**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
273
273
 
274
274
  <!-- AGENT LIST -->
275
275
 
package/README.zh-CN.md CHANGED
@@ -215,14 +215,14 @@ LobeChat ็š„ๆ’ไปถ็”Ÿๆ€็ณป็ปŸๆ˜ฏๅ…ถๆ ธๅฟƒๅŠŸ่ƒฝ็š„้‡่ฆๆ‰ฉๅฑ•๏ผŒๅฎƒๆžๅคงๅœฐ
215
215
 
216
216
  <!-- PLUGIN LIST -->
217
217
 
218
- | ๆœ€่ฟ‘ๆ–ฐๅขž | ๆ’ไปถๆ่ฟฐ |
219
- | ------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------- |
220
- | [็ฉบ้—ด](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **automateyournetwork** on **2024-05-12**</sup> | ๅŒ…ๆ‹ฌ NASA ็š„็ฉบ้—ดๆ•ฐๆฎใ€‚<br/>`็ฉบ้—ด` `nasa` |
221
- | [Search1API](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **fatwang2** on **2024-05-06**</sup> | ๆœ็ดข่šๅˆๆœๅŠก๏ผŒไธ“ไธบ LLMs ่ฎพ่ฎก<br/>`web` `search` |
222
- | [้€š่ฟ‡ Serper ๆœ็ดข Google](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **Barry** on **2024-04-30**</sup> | ้€š่ฟ‡ Serper.dev ๅ…่ดน API ่ฟ›่กŒ Google ๆœ็ดขๅผ•ๆ“Ž๏ผˆๆฏๆœˆ 2500 ๆฌก๐Ÿ†“๏ผ‰<br/>`็ฝ‘็ปœ` `ๆœ็ดข` |
223
- | [NFT Guru](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **swap** on **2024-04-03**</sup> | ๅ‘็Žฐไธป่ฆๅนณๅฐไธŠ NFT ็š„ๅฝ“ๅ‰ไปทๆ ผ๏ผŒๅนถ้€š่ฟ‡ๅฎžๆ—ถ่ทŸ่ธชๅฟซ้€Ÿๅ˜ๅŒ–็š„ๅธ‚ๅœบไบ†่งฃๆƒ…ๅ†ต<br/>`ๅŠ ๅฏ†่ดงๅธ` `nft` |
218
+ | ๆœ€่ฟ‘ๆ–ฐๅขž | ๆ’ไปถๆ่ฟฐ |
219
+ | ------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------- |
220
+ | [็คพไบคๆœ็ดข](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **say-apps** on **2024-06-02**</sup> | ็คพไบคๆœ็ดขๆไพ›่ฎฟ้—ฎๆŽจๆ–‡ใ€็”จๆˆทใ€ๅ…ณๆณจ่€…ใ€ๅ›พ็‰‡ใ€ๅช’ไฝ“็ญ‰ๅŠŸ่ƒฝใ€‚<br/>`็คพไบค` `ๆŽจ็‰น` `x` `ๆœ็ดข` |
221
+ | [็ฉบ้—ด](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **automateyournetwork** on **2024-05-12**</sup> | ๅŒ…ๆ‹ฌ NASA ็š„็ฉบ้—ดๆ•ฐๆฎใ€‚<br/>`็ฉบ้—ด` `nasa` |
222
+ | [Search1API](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **fatwang2** on **2024-05-06**</sup> | ๆœ็ดข่šๅˆๆœๅŠก๏ผŒไธ“ไธบ LLMs ่ฎพ่ฎก<br/>`web` `search` |
223
+ | [้€š่ฟ‡ Serper ๆœ็ดข Google](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **Barry** on **2024-04-30**</sup> | ้€š่ฟ‡ Serper.dev ๅ…่ดน API ่ฟ›่กŒ Google ๆœ็ดขๅผ•ๆ“Ž๏ผˆๆฏๆœˆ 2500 ๆฌก๐Ÿ†“๏ผ‰<br/>`็ฝ‘็ปœ` `ๆœ็ดข` |
224
224
 
225
- > ๐Ÿ“Š Total plugins: [<kbd>**54**</kbd>](https://github.com/lobehub/lobe-chat-plugins)
225
+ > ๐Ÿ“Š Total plugins: [<kbd>**55**</kbd>](https://github.com/lobehub/lobe-chat-plugins)
226
226
 
227
227
  <!-- PLUGIN LIST -->
228
228
 
@@ -252,12 +252,12 @@ LobeChat ็š„ๆ’ไปถ็”Ÿๆ€็ณป็ปŸๆ˜ฏๅ…ถๆ ธๅฟƒๅŠŸ่ƒฝ็š„้‡่ฆๆ‰ฉๅฑ•๏ผŒๅฎƒๆžๅคงๅœฐ
252
252
 
253
253
  | ๆœ€่ฟ‘ๆ–ฐๅขž | ๅŠฉๆ‰‹่ฏดๆ˜Ž |
254
254
  | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
255
+ | [ๅ›ฝๅญฆๅކๅฒ่ฎฒๅธˆ](https://chat-preview.lobehub.com/market?agent=history-master)<br/><sup>By **[a562314](https://github.com/a562314)** on **2024-05-30**</sup> | ็ฒพ้€šไธญๅ›ฝๅކๅฒ๏ผŒๆทฑๅ…ฅๆต…ๅ‡บ่งฃ้‡Šๅކๅฒ้—ฎ้ข˜๏ผŒๆณจ้‡ๅฒๅฎžๅ‡†็กฎๆ€ง๏ผŒ่ฟ็”จๅ”ฏ็‰ฉ่พฉ่ฏๆณ•ใ€‚<br/>`ๅކๅฒๅญฆๅฎถ` `ๆ•™ๅญฆ่ƒฝๅŠ›` `ๅ”ฏ็‰ฉ่พฉ่ฏๆณ•` `ๆทฑๅ…ฅๆต…ๅ‡บ` `ๅคšๅ…ƒๅฏนๆฏ”` `ไบŒๅๅ››ๅฒ` |
255
256
  | [Dart/Flutter Dev](https://chat-preview.lobehub.com/market?agent=dart-flutter)<br/><sup>By **[rezmeplxrf](https://github.com/rezmeplxrf)** on **2024-05-28**</sup> | Dart/Flutter ์ „๋ฌธ๊ฐ€. 3๋‹จ๊ณ„ ์ด์ƒ ์ค‘์ฒฉํ•˜์ง€ ์•Š์Œ. ์ƒํƒœ ๊ด€๋ฆฌ์— riverpod, flutter_riverpod, riverpod_hook, flutter_hook ์‚ฌ์šฉ.<br/>`dart` `flutter` `๊ฐœ๋ฐœ` `์ƒํƒœ-๊ด€๋ฆฌ` `riverpod` |
256
257
  | [C# .NET ๆŠ€ๆœฏไธ“ๅฎถ](https://chat-preview.lobehub.com/market?agent=dotnet-expert)<br/><sup>By **[johnnyqian](https://github.com/johnnyqian)** on **2024-05-28**</sup> | C# .NET ๆŠ€ๆœฏไธ“ๅฎถ<br/>`net` `developer` `net-core` `azure` `c` `microsoft` `sql-server` `entity-framework` `ef` `ef-core` |
257
258
  | [ๅŸบ็ฃไผ ๆ•™ๅฃซ](https://chat-preview.lobehub.com/market?agent=jesus-missionary)<br/><sup>By **[epochaudio](https://github.com/epochaudio)** on **2024-05-28**</sup> | ไฝœไธบไธ€ๅ่€ถ็จฃไผ ๆ•™ๅฃซ๏ผŒๆˆ‘ๅฐ†ไพๆฎๅœฃ็ปๆ•™ๅฏผไปฅๅฏ่ฟชไฝ ๅฏน็ฅž็š„่ฏ่ฏญ็š„็†่งฃๅ’Œๅฎž้™…่ฟ็”จใ€‚ๆ— ่ฎบๆ˜ฏๅœจๅ›ฐๆƒ‘่ฟ˜ๆ˜ฏๅฏปๆฑ‚็ตๆ€งๆˆ้•ฟ็š„่ฟ‡็จ‹ไธญ๏ผŒๆˆ‘้ƒฝๅœจ่ฟ™ๆ™บๆ…ง็š„ๆบๆณ‰ๆ—ไธบไฝ ๆœๅŠก<br/>`ๅœฃ็ปๆ•™ๅญฆ` `ๅŸบ็ฃไผ ๆ•™` `็ฅžๅญฆๅธƒ้“` |
258
- | [ๆ—ฅๅธธๅฐๅŠฉๆ‰‹](https://chat-preview.lobehub.com/market?agent=junior-helper)<br/><sup>By **[Qinks6](https://github.com/Qinks6)** on **2024-05-28**</sup> | ไธ€ไธช่ƒฝๆœ็ดขใ€่ƒฝ็”ปๅ›พ็š„ๅฐๅฏ็ˆฑ<br/>`ๅŠฉๆ‰‹` `ๆœ็ดข` `็ป˜ๅ›พ` `ไฟกๆฏๆŸฅ่ฏข` `็”จๆˆทไบคไบ’` |
259
259
 
260
- > ๐Ÿ“Š Total agents: [<kbd>**280**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
260
+ > ๐Ÿ“Š Total agents: [<kbd>**281**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
261
261
 
262
262
  <!-- AGENT LIST -->
263
263
 
@@ -61,8 +61,8 @@ The `DEFAULT_AGENT_CONFIG` is used to configure the default settings for the Lob
61
61
  | Array | `plugins=search-engine,lobe-image-designer` | Enable the `search-engine` and `lobe-image-designer` plugins. |
62
62
  | Chinese Comma | `plugins=search-engine๏ผŒlobe-image-designer` | Same as above, demonstrating support for Chinese comma separation. |
63
63
  | Multiple Configurations | `model=glm-4;provider=zhipu` | Set the model to `glm-4` and the model provider to `zhipu`. |
64
- | Numeric Value | `params.max_tokens=300` | Set the maximum tokens to `300`. |
65
- | Boolean Value | `enableAutoCreateTopic=true` | Enable automatic topic creation. |
64
+ | Numeric Value | `params.max_tokens=300`, `chatConfig.historyCount=5` | Set the maximum tokens to `300`, Set the number of historical messages to 5. |
65
+ | Boolean Value | `chatConfig.enableAutoCreateTopic=true`, `chatConfig.enableCompressThreshold=true`, `chatConfig.enableHistoryCount=true` | Enable automatic topic creation, History length compression threshold, number of historical records. |
66
66
  | Special Characters | `inputTemplate="Hello; I am a bot;"` | Set the input template to `Hello; I am a bot;`. |
67
67
  | Error Handling | `model=gpt-4;maxToken` | Ignore invalid entry `maxToken` and only parse `model=gpt-4`. |
68
68
  | Value Override | `model=gpt-4;model=gpt-4-1106-preview` | If a key is repeated, use the value that appears last; in this case, the value of `model` is `gpt-4-1106-preview`. |
@@ -57,8 +57,8 @@ LobeChat ๅœจ้ƒจ็ฝฒๆ—ถๆไพ›ไบ†ไธ€ไบ›้ขๅค–็š„้…็ฝฎ้กน๏ผŒไฝ ๅฏไปฅไฝฟ็”จ็Žฏๅขƒ
57
57
  | ๆ•ฐ็ป„ | `plugins=search-engine,lobe-image-designer` | ๅฏ็”จ `search-engine` ๅ’Œ `lobe-image-designer` ๆ’ไปถใ€‚ |
58
58
  | ไธญๆ–‡้€—ๅท | `plugins=search-engine๏ผŒlobe-image-designer` | ๅŒไธŠ๏ผŒๆผ”็คบๆ”ฏๆŒไธญๆ–‡้€—ๅทๅˆ†้š”ใ€‚ |
59
59
  | ๅคšไธช้…็ฝฎ้กน | `model=glm-4;provider=zhipu` | ่ฎพ็ฝฎๆจกๅž‹ไธบ `glm-4` ไธ”ๆจกๅž‹ๆœๅŠกๅ•†ไธบ `zhipu`ใ€‚ |
60
- | ๆ•ฐๅญ—ๅ€ผ | `params.max_tokens=300` | ่ฎพ็ฝฎๆœ€ๅคงไปค็‰Œๆ•ฐไธบ `300`ใ€‚ |
61
- | ๅธƒๅฐ”ๅ€ผ | `enableAutoCreateTopic=true` | ๅฏ็”จ่‡ชๅŠจๅˆ›ๅปบไธป้ข˜ใ€‚ |
60
+ | ๆ•ฐๅญ—ๅ€ผ | `params.max_tokens=300`, `chatConfig.historyCount=5` | ่ฎพ็ฝฎๆœ€ๅคงไปค็‰Œๆ•ฐไธบ `300`๏ผŒ่ฎพ็ฝฎๅކๅฒๆถˆๆฏๆกๆ•ฐไธบ5ใ€‚ |
61
+ | ๅธƒๅฐ”ๅ€ผ | `chatConfig.enableAutoCreateTopic=true`,`chatConfig.enableCompressThreshold=true`, `chatConfig.enableHistoryCount=true` | ๅฏ็”จ่‡ชๅŠจๅˆ›ๅปบไธป้ข˜๏ผŒๅކๅฒ้•ฟๅบฆๅŽ‹็ผฉ้˜ˆๅ€ผ๏ผŒๅކๅฒ่ฎฐๅฝ•ๆกๆ•ฐใ€‚ |
62
62
  | ็‰นๆฎŠๅญ—็ฌฆ | `inputTemplate="Hello; I am a bot;"` | ่ฎพ็ฝฎ่พ“ๅ…ฅๆจกๆฟไธบ `Hello; I am a bot;`ใ€‚ |
63
63
  | ้”™่ฏฏๅค„็† | `model=gpt-4;maxToken` | ๅฟฝ็•ฅๆ— ๆ•ˆๆก็›ฎ `maxToken`๏ผŒไป…่งฃๆžๅ‡บ `model=gpt-4`ใ€‚ |
64
64
  | ๅ€ผ่ฆ†็›– | `model=gpt-4;model=gpt-4-1106-preview` | ๅฆ‚ๆžœ้”ฎ้‡ๅค๏ผŒไฝฟ็”จๆœ€ๅŽไธ€ๆฌกๅ‡บ็Žฐ็š„ๅ€ผ๏ผŒๆญคๅค„ `model` ็š„ๅ€ผไธบ `gpt-4-1106-preview`ใ€‚ |
package/netlify.toml CHANGED
@@ -2,6 +2,8 @@
2
2
  command = "npm run build"
3
3
  publish = ".next"
4
4
 
5
+ [build.environment]
6
+ NODE_OPTIONS = "--max_old_space_size=8192"
5
7
 
6
8
  [template.environment]
7
9
  OPENAI_API_KEY = "set your OpenAI API Key"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "0.162.13",
3
+ "version": "0.162.15",
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",
@@ -13,7 +13,7 @@ import { useSendMessage } from '@/features/ChatInput/useSend';
13
13
  import { useAgentStore } from '@/store/agent';
14
14
  import { agentSelectors } from '@/store/agent/slices/chat';
15
15
  import { useChatStore } from '@/store/chat';
16
- import { chatSelectors } from '@/store/chat/selectors';
16
+ import { chatSelectors, topicSelectors } from '@/store/chat/selectors';
17
17
  import { filesSelectors, useFileStore } from '@/store/file';
18
18
  import { useUserStore } from '@/store/user';
19
19
  import { modelProviderSelectors, preferenceSelectors } from '@/store/user/selectors';
@@ -61,10 +61,20 @@ const Footer = memo<FooterProps>(({ setExpand }) => {
61
61
 
62
62
  const { theme, styles } = useStyles();
63
63
 
64
- const [isAIGenerating, stopGenerateMessage] = useChatStore((s) => [
64
+ const [
65
+ isAIGenerating,
66
+ isHasMessageLoading,
67
+ isCreatingMessage,
68
+ isCreatingTopic,
69
+ stopGenerateMessage,
70
+ ] = useChatStore((s) => [
65
71
  chatSelectors.isAIGenerating(s),
72
+ chatSelectors.isHasMessageLoading(s),
73
+ chatSelectors.isCreatingMessage(s),
74
+ topicSelectors.isCreatingTopic(s),
66
75
  s.stopGenerateMessage,
67
76
  ]);
77
+
68
78
  const isImageUploading = useFileStore(filesSelectors.isImageUploading);
69
79
 
70
80
  const model = useAgentStore(agentSelectors.currentAgentModel);
@@ -93,6 +103,9 @@ const Footer = memo<FooterProps>(({ setExpand }) => {
93
103
 
94
104
  const wrapperShortcut = useCmdEnterToSend ? enter : cmdEnter;
95
105
 
106
+ const buttonDisabled =
107
+ isImageUploading || isHasMessageLoading || isCreatingTopic || isCreatingMessage;
108
+
96
109
  return (
97
110
  <Flexbox
98
111
  align={'end'}
@@ -136,7 +149,8 @@ const Footer = memo<FooterProps>(({ setExpand }) => {
136
149
  ) : (
137
150
  <Space.Compact>
138
151
  <Button
139
- disabled={isImageUploading}
152
+ disabled={buttonDisabled}
153
+ loading={buttonDisabled}
140
154
  onClick={() => {
141
155
  sendMessage();
142
156
  setExpand?.(false);
@@ -145,7 +159,7 @@ const Footer = memo<FooterProps>(({ setExpand }) => {
145
159
  >
146
160
  {t('input.send')}
147
161
  </Button>
148
- <SendMore disabled={isImageUploading} />
162
+ <SendMore disabled={buttonDisabled} />
149
163
  </Space.Compact>
150
164
  )}
151
165
  </Flexbox>
@@ -20,13 +20,16 @@ const useStyles = createStyles(({ css, token, isDarkMode }) => ({
20
20
  container: css`
21
21
  cursor: pointer;
22
22
 
23
- width: calc(100% - 16px);
24
23
  margin-block: 2px;
25
24
  margin-inline: 8px;
26
25
  padding: 8px;
27
26
 
28
27
  border-radius: ${token.borderRadius}px;
29
28
 
29
+ &.topic-item {
30
+ width: calc(100% - 16px);
31
+ }
32
+
30
33
  &:hover {
31
34
  background: ${token.colorFillSecondary};
32
35
  }
@@ -52,7 +55,7 @@ const TopicItem = memo<ConfigCellProps>(({ title, active, id, fav }) => {
52
55
  return (
53
56
  <Flexbox
54
57
  align={'center'}
55
- className={cx(styles.container, active && styles.active)}
58
+ className={cx(styles.container, 'topic-item', active && styles.active)}
56
59
  distribution={'space-between'}
57
60
  horizontal
58
61
  onClick={() => {
@@ -232,6 +232,7 @@ export const chatMessage: StateCreator<
232
232
 
233
233
  // if message is empty or no files, then stop
234
234
  if (!message && isNoFile) return;
235
+ set({ isCreatingMessage: true }, false, 'creatingMessage/start');
235
236
 
236
237
  const newMessage: CreateMessageParams = {
237
238
  content: message,
@@ -305,14 +306,16 @@ export const chatMessage: StateCreator<
305
306
 
306
307
  // if only add user message, then stop
307
308
  if (onlyAddUserMessage) {
309
+ set({ isCreatingMessage: false }, false, 'creatingMessage/start');
308
310
  return;
309
311
  }
310
312
 
311
313
  // Get the current messages to generate AI response
312
314
  const messages = chatSelectors.currentChats(get());
313
-
314
315
  await internal_coreProcessMessage(messages, id, { isWelcomeQuestion });
315
316
 
317
+ set({ isCreatingMessage: false }, false, 'creatingMessage/stop');
318
+
316
319
  // if autoCreateTopic is false, then stop
317
320
  if (!agentConfig.enableAutoCreateTopic) return;
318
321
 
@@ -707,7 +710,6 @@ export const chatMessage: StateCreator<
707
710
  internal_createMessage: async (message, context) => {
708
711
  const { internal_createTmpMessage, refreshMessages, internal_toggleMessageLoading } = get();
709
712
  let tempId = context?.tempMessageId;
710
-
711
713
  if (!tempId) {
712
714
  // use optimistic update to avoid the slow waiting
713
715
  tempId = internal_createTmpMessage(message);
@@ -721,7 +723,6 @@ export const chatMessage: StateCreator<
721
723
  }
722
724
 
723
725
  internal_toggleMessageLoading(false, tempId);
724
-
725
726
  return id;
726
727
  },
727
728
 
@@ -12,6 +12,7 @@ export interface ChatMessageState {
12
12
  */
13
13
  chatLoadingIds: string[];
14
14
  inputMessage: string;
15
+ isCreatingMessage: boolean;
15
16
  /**
16
17
  * is the message is editing
17
18
  */
@@ -35,6 +36,7 @@ export const initialMessageState: ChatMessageState = {
35
36
  activeId: 'inbox',
36
37
  chatLoadingIds: [],
37
38
  inputMessage: '',
39
+ isCreatingMessage: false,
38
40
  messageEditingIds: [],
39
41
  messageLoadingIds: [],
40
42
  messagesInit: false,
@@ -125,6 +125,9 @@ const isCurrentChatLoaded = (s: ChatStore) => !!s.messagesMap[currentChatKey(s)]
125
125
 
126
126
  const isMessageEditing = (id: string) => (s: ChatStore) => s.messageEditingIds.includes(id);
127
127
  const isMessageLoading = (id: string) => (s: ChatStore) => s.messageLoadingIds.includes(id);
128
+ const isHasMessageLoading = (s: ChatStore) => s.messageLoadingIds.length > 0;
129
+ const isCreatingMessage = (s: ChatStore) => s.isCreatingMessage;
130
+
128
131
  const isMessageGenerating = (id: string) => (s: ChatStore) => s.chatLoadingIds.includes(id);
129
132
  const isToolCallStreaming = (id: string, index: number) => (s: ChatStore) => {
130
133
  const isLoading = s.toolCallingStreamIds[id];
@@ -146,7 +149,9 @@ export const chatSelectors = {
146
149
  getMessageById,
147
150
  getTraceIdByMessageId,
148
151
  isAIGenerating,
152
+ isCreatingMessage,
149
153
  isCurrentChatLoaded,
154
+ isHasMessageLoading,
150
155
  isMessageEditing,
151
156
  isMessageGenerating,
152
157
  isMessageLoading,
@@ -80,13 +80,14 @@ export const chatTopic: StateCreator<
80
80
  const { activeId, internal_createTopic } = get();
81
81
 
82
82
  const messages = chatSelectors.currentChats(get());
83
+
84
+ set({ creatingTopic: true }, false, n('creatingTopic/start'));
83
85
  const topicId = await internal_createTopic({
84
86
  sessionId: activeId,
85
87
  title: t('topic.defaultTitle', { ns: 'chat' }),
86
88
  messages: messages.map((m) => m.id),
87
89
  });
88
-
89
- // get().internal_updateTopicLoading(topicId, true);
90
+ set({ creatingTopic: false }, false, n('creatingTopic/end'));
90
91
 
91
92
  return topicId;
92
93
  },
@@ -3,6 +3,7 @@ import { ChatTopic } from '@/types/topic';
3
3
  export interface ChatTopicState {
4
4
  // TODO: need to add the null to the type
5
5
  activeTopicId?: string;
6
+ creatingTopic: boolean;
6
7
  isSearchingTopic: boolean;
7
8
  searchTopics: ChatTopic[];
8
9
  topicLoadingIds: string[];
@@ -17,6 +18,7 @@ export interface ChatTopicState {
17
18
 
18
19
  export const initialTopicState: ChatTopicState = {
19
20
  activeTopicId: null as any,
21
+ creatingTopic: false,
20
22
  isSearchingTopic: false,
21
23
  searchTopics: [],
22
24
  topicLoadingIds: [],
@@ -21,6 +21,7 @@ const getTopicById =
21
21
  (id: string) =>
22
22
  (s: ChatStore): ChatTopic | undefined =>
23
23
  currentTopics(s)?.find((topic) => topic.id === id);
24
+ const isCreatingTopic = (s: ChatStore) => s.creatingTopic;
24
25
 
25
26
  export const topicSelectors = {
26
27
  currentActiveTopic,
@@ -29,5 +30,6 @@ export const topicSelectors = {
29
30
  currentUnFavTopics,
30
31
  displayTopics,
31
32
  getTopicById,
33
+ isCreatingTopic,
32
34
  searchTopics,
33
35
  };