Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ feat: add session group manager #1055

Merged
merged 20 commits into from
Jan 24, 2024
Merged

✨ feat: add session group manager #1055

merged 20 commits into from
Jan 24, 2024

Conversation

canisminor1990
Copy link
Member

@canisminor1990 canisminor1990 commented Jan 15, 2024

💻 变更类型 | Change Type

  • ✨ feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 🔨 chore
  • ⚡️ perf
  • 📝 docs

🔀 变更说明 | Description of Change

#1045 的基础上:

  • 增加分组重命名 / 删除 / 管理
  • 在管理中支持对分组进行排序
  • 当导入的助手分组不存在时,自动移动到默认列表
  • 其他项: 修改一些样式细节

@arvinxx @Justin3go

📝 补充信息 | Additional Information

Copy link

vercel bot commented Jan 15, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lobe-chat ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 24, 2024 7:24am

@lobehubbot
Copy link
Member

👍 @canisminor1990

Thank you for raising your pull request and contributing to our Community
Please make sure you have followed our contributing guidelines. We will review it as soon as possible.
If you encounter any problems, please feel free to connect with us.
非常感谢您提出拉取请求并为我们的社区做出贡献,请确保您已经遵循了我们的贡献指南,我们会尽快审查它。
如果您遇到任何问题,请随时与我们联系。

Copy link

codecov bot commented Jan 15, 2024

Codecov Report

Attention: Patch coverage is 91.26394% with 47 lines in your changes missing coverage. Please review.

Project coverage is 91.54%. Comparing base (28206b6) to head (041a6d1).
Report is 1896 commits behind head on main.

Files with missing lines Patch % Lines
src/store/session/slices/sessionGroup/action.ts 64.81% 19 Missing ⚠️
src/store/session/slices/session/action.ts 38.46% 8 Missing ⚠️
src/store/global/store.ts 14.28% 6 Missing ⚠️
src/store/session/slices/sessionGroup/selectors.ts 66.66% 5 Missing ⚠️
src/database/models/sessionGroup.ts 94.73% 4 Missing ⚠️
src/store/global/slices/common/action.ts 78.57% 3 Missing ⚠️
src/services/session.ts 97.01% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1055      +/-   ##
==========================================
+ Coverage   89.42%   91.54%   +2.11%     
==========================================
  Files         170      175       +5     
  Lines        8207     8582     +375     
  Branches      953     1059     +106     
==========================================
+ Hits         7339     7856     +517     
+ Misses        868      726     -142     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@arvinxx arvinxx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

另外相关单测补一下

src/app/api/openai/stt/route.ts Outdated Show resolved Hide resolved
src/store/session/slices/session/selectors/list.ts Outdated Show resolved Hide resolved
src/store/global/slices/common/action.ts Outdated Show resolved Hide resolved
src/database/models/__tests__/session.test.ts Show resolved Hide resolved
@arvinxx
Copy link
Contributor

arvinxx commented Jan 15, 2024

  1. 不应该一进去默认折起:
image
  1. 顺序应该是默认列表在最下吧?
image
  1. 一个新分组如果是空的,是否需要显示下此分组内容为空?或者分组为空时,不允许展开?
image

package.json Outdated Show resolved Hide resolved
@Justin3go
Copy link
Contributor

Justin3go commented Jan 16, 2024

之前阻止了modal中的默认点击事件:

<div onClick={(e) => e.stopPropagation()}>
  <Modal.....
 </ div>

是因为弹窗也属于session Item,如果不阻止会出现以下情况(下方视频包含修改后-->修改前的对比):

demo.mp4

用文字描述就是在弹窗中点击也会触发切换当前会话的事件,看是否属于预期现象?

相关PR

@arvinxx
Copy link
Contributor

arvinxx commented Jan 16, 2024

之前阻止了modal中的默认点击事件:

<div onClick={(e) => e.stopPropagation()}>
  <Modal.....
 </ div>

是因为弹窗也属于session Item,如果不阻止会出现以下情况(下方视频包含修改后-->修改前的对比):

demo.mp4
用文字描述就是在弹窗中点击也会触发切换当前会话的事件,看是否属于预期现象?

相关PR

感觉要阻止的

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Default click event in modal was previously blocked:

<div onClick={(e) => e.stopPropagation()}>
<Modal.....
</div>

This is because the pop-up window also belongs to the session item. If it is not blocked, the following situations will occur (the video below contains the comparison after modification-->before modification):

demo.mp4
Use text to describe that clicking in the pop-up window will also trigger the event of switching the current session. See if it is an expected phenomenon?

Related PR

I feel like I need to stop it. Should this be put into the Modal component?

@canisminor1990
Copy link
Member Author

之前阻止了modal中的默认点击事件:

<div onClick={(e) => e.stopPropagation()}>
  <Modal.....
 </ div>

是因为弹窗也属于session Item,如果不阻止会出现以下情况(下方视频包含修改后-->修改前的对比):
demo.mp4
用文字描述就是在弹窗中点击也会触发切换当前会话的事件,看是否属于预期现象?
相关PR

感觉要阻止的

需要用 div 包裹么 还是直接挂在弹窗也行?

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Default click event in modal was previously blocked:

<div onClick={(e) => e.stopPropagation()}>
<Modal.....
</div>

This is because the pop-up window also belongs to the session item. If it is not blocked, the following situations will occur (the video below contains the comparison after modification-->before modification):
demo.mp4
Use text to describe that clicking in the pop-up window will also trigger the event of switching the current session. See if it is an expected phenomenon?
Related PR

Feel like I want to stop it

Does it need to be wrapped in a div or can it be hung directly in the pop-up window?

@Justin3go
Copy link
Contributor

需要用 div 包裹么 还是直接挂在弹窗也行?

@canisminor1990 之前试了是因为会报类型错误,Modal上没这个属性:

image

@arvinxx
Copy link
Contributor

arvinxx commented Jan 16, 2024

当导入的助手分组不存在时,自动移动到默认列表

这个逻辑有问题,导入的分组不存在时,应该自动创建这个分组。

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


When the imported assistant group does not exist, it is automatically moved to the default list

There is a problem with this logic. When the imported group does not exist, this group should be automatically created.

package.json Outdated Show resolved Hide resolved
@arvinxx
Copy link
Contributor

arvinxx commented Jan 16, 2024

需要用 div 包裹么 还是直接挂在弹窗也行?

@canisminor1990 之前试了是因为会报类型错误,Modal上没这个属性:

我估计 modal 应该在文档流里没有实体 div 节点,所以估计没法有这个事件。

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Do I need to wrap it with a div? Or can I hang it directly in the pop-up window?

@canisminor1990 I tried it before because it would report a type error and there is no such attribute on Modal:

I estimate that modal should not have entity div nodes in the document flow, so it is estimated that this event cannot occur.

Copy link
Contributor

@arvinxx arvinxx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arvinxx arvinxx merged commit e3281fc into main Jan 24, 2024
8 checks passed
@arvinxx arvinxx deleted the feat/group branch January 24, 2024 08:38
@lobehubbot
Copy link
Member

❤️ Great PR @canisminor1990 ❤️

The growth of project is inseparable from user feedback and contribution, thanks for your contribution! If you are interesting with the lobehub developer community, please join our discord and then dm @arvinxx or @canisminor1990. They will invite you to our private developer channel. We are talking about the lobe-chat development or sharing ai newsletter around the world.
项目的成长离不开用户反馈和贡献,感谢您的贡献! 如果您对 LobeHub 开发者社区感兴趣,请加入我们的 discord,然后私信 @arvinxx@canisminor1990。他们会邀请您加入我们的私密开发者频道。我们将会讨论关于 Lobe Chat 的开发,分享和讨论全球范围内的 AI 消息。

github-actions bot pushed a commit that referenced this pull request Jan 24, 2024
## [Version&nbsp;0.121.0](v0.120.6...v0.121.0)
<sup>Released on **2024-01-24**</sup>

#### ✨ Features

- **misc**: Add session group manager.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### What's improved

* **misc**: Add session group manager, closes [#1055](#1055) [#1045](#1045) [#1126](#1126) [#1120](#1120) ([e3281fc](e3281fc))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>
@lobehubbot
Copy link
Member

🎉 This PR is included in version 0.121.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

github-actions bot pushed a commit to bentwnghk/lobe-chat that referenced this pull request Jan 24, 2024
## [Version&nbsp;1.3.0](v1.2.5...v1.3.0)
<sup>Released on **2024-01-24**</sup>

#### ✨ Features

- **misc**: Add session group manager.

#### 🐛 Bug Fixes

- **misc**: Fix default, fix rename.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### What's improved

* **misc**: Add session group manager, closes [lobehub#1055](https://github.com/bentwnghk/lobe-chat/issues/1055) [lobehub#1045](https://github.com/bentwnghk/lobe-chat/issues/1045) [lobehub#1126](https://github.com/bentwnghk/lobe-chat/issues/1126) [lobehub#1120](https://github.com/bentwnghk/lobe-chat/issues/1120) ([e3281fc](e3281fc))

#### What's fixed

* **misc**: Fix default ([82cbbde](82cbbde))
* **misc**: Fix rename ([5680bd7](5680bd7))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>
miroshar-success added a commit to miroshar-success/OpenAI_Integraion_platform that referenced this pull request Apr 5, 2024
## [Version&nbsp;0.121.0](lobehub/lobe-chat@v0.120.6...v0.121.0)
<sup>Released on **2024-01-24**</sup>

#### ✨ Features

- **misc**: Add session group manager.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### What's improved

* **misc**: Add session group manager, closes [#1055](lobehub/lobe-chat#1055) [#1045](lobehub/lobe-chat#1045) [#1126](lobehub/lobe-chat#1126) [#1120](lobehub/lobe-chat#1120) ([e3281fc](lobehub/lobe-chat@e3281fc))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants