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

🐛 fix: refresh model config form & mobile footer button lost #2318

Merged
merged 9 commits into from May 14, 2024

Conversation

sxjeru
Copy link
Contributor

@sxjeru sxjeru commented Apr 30, 2024

💻 变更类型 | Change Type

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

🔀 变更说明 | Description of Change

由于 Form 的 initialValues 只会在初次渲染时改变,导致更换自定义模型时,设置页的值没有跟随更新。

📝 补充信息 | Additional Information

fix #2294
fix #2319
fix #1977
fix #2456
close #1811

Copy link

vercel bot commented Apr 30, 2024

@sxjeru is attempting to deploy a commit to the LobeHub Team on Vercel.

A member of the Team first needs to authorize it.

@lobehubbot
Copy link
Member

👍 @sxjeru

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 Apr 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.89%. Comparing base (29b6442) to head (27b81b7).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2318   +/-   ##
=======================================
  Coverage   92.89%   92.89%           
=======================================
  Files         297      297           
  Lines       16928    16928           
  Branches     1963     1963           
=======================================
  Hits        15726    15726           
  Misses       1202     1202           

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

@arvinxx
Copy link
Contributor

arvinxx commented Apr 30, 2024

可能更好的方式是给 modal 设定 一个 key? 当 key 不一样的自动创建新的modal,就不会有这个问题了?

@lobehubbot
Copy link
Member

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


Maybe a better way is to set a key for the modal? When the key is different, a new modal is automatically created, so there won't be this problem?

@sxjeru
Copy link
Contributor Author

sxjeru commented Apr 30, 2024

<Modal /> 和 Form 一起配合使用时,设置 destroyOnClose 也不会在 Modal 关闭时销毁表单字段数据,
需要设置 <Form preserve={false} />。

看来 Ant Design 已经考虑到了。

@lobehubbot
Copy link
Member

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


// When is used with Form, setting destroyOnClose will not destroy the form field data when Modal is closed. You need to set

.

It seems Ant Design has thought of this.

@sxjeru sxjeru changed the title 🐛 fix: refresh model config form 🐛 fix: refresh model config form & mobile footer button lost Apr 30, 2024
open={open}
title={t('llm.customModelCards.modelConfig.modalTitle')}
zIndex={1051} // Select is 1050
Copy link
Contributor Author

@sxjeru sxjeru May 4, 2024

Choose a reason for hiding this comment

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

不知为何,明明 Drawer 也有 zIndex 属性,但参数传不到,Antd Modal 倒是拿到了。
想必与此处相关:https://github.com/lobehub/lobe-ui/blob/master/src/Modal/index.tsx

@arvinxx arvinxx merged commit eadcefc into lobehub:main May 14, 2024
4 of 5 checks passed
@lobehubbot
Copy link
Member

❤️ Great PR @sxjeru ❤️

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 May 14, 2024
### [Version&nbsp;0.159.4](v0.159.3...v0.159.4)
<sup>Released on **2024-05-14**</sup>

#### 🐛 Bug Fixes

- **misc**: Refresh model config form & mobile footer button lost.

#### 💄 Styles

- **misc**: Add GPT-4o model, update perplexity models, updates 01.AI model list.

<br/>

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

#### What's fixed

* **misc**: Refresh model config form & mobile footer button lost, closes [#2318](#2318) [#2319](#2319) [#1811](#1811) ([eadcefc](eadcefc))

#### Styles

* **misc**: Add GPT-4o model, closes [#2481](#2481) ([ae6a03f](ae6a03f))
* **misc**: Update perplexity models, closes [#2469](#2469) ([488cde7](488cde7))
* **misc**: Updates 01.AI model list, closes [#2471](#2471) ([f28711a](f28711a))

</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.159.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

@sxjeru sxjeru deleted the fork7 branch May 14, 2024 11:31
TheNameIsNigel pushed a commit to TheNameIsNigel/lobe-chat that referenced this pull request May 15, 2024
…#2318)

* fix form not update

* Update ModelConfigModal.tsx

* fix lobehub#2319

* react/jsx-sort-props

* lobehub#1811

* onCancel closeModal

* zIndex
TheNameIsNigel pushed a commit to TheNameIsNigel/lobe-chat that referenced this pull request May 15, 2024
### [Version&nbsp;0.159.4](lobehub/lobe-chat@v0.159.3...v0.159.4)
<sup>Released on **2024-05-14**</sup>

#### 🐛 Bug Fixes

- **misc**: Refresh model config form & mobile footer button lost.

#### 💄 Styles

- **misc**: Add GPT-4o model, update perplexity models, updates 01.AI model list.

<br/>

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

#### What's fixed

* **misc**: Refresh model config form & mobile footer button lost, closes [lobehub#2318](lobehub#2318) [lobehub#2319](lobehub#2319) [lobehub#1811](lobehub#1811) ([eadcefc](lobehub@eadcefc))

#### Styles

* **misc**: Add GPT-4o model, closes [lobehub#2481](lobehub#2481) ([ae6a03f](lobehub@ae6a03f))
* **misc**: Update perplexity models, closes [lobehub#2469](lobehub#2469) ([488cde7](lobehub@488cde7))
* **misc**: Updates 01.AI model list, closes [lobehub#2471](lobehub#2471) ([f28711a](lobehub@f28711a))

</details>

<div align="right">

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

</div>
github-actions bot pushed a commit to bentwnghk/lobe-chat that referenced this pull request May 15, 2024
### [Version&nbsp;1.39.2](v1.39.1...v1.39.2)
<sup>Released on **2024-05-15**</sup>

#### 🐛 Bug Fixes

- **misc**: Fix agent config on page init, fix retry issue when hide page, login button not show on user panel, refresh model config form & mobile footer button lost.

#### 💄 Styles

- **misc**: Add GPT-4o model, fix scroll and expand, update perplexity models, updates 01.AI model list.

<br/>

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

#### What's fixed

* **misc**: Fix agent config on page init, closes [lobehub#2506](https://github.com/bentwnghk/lobe-chat/issues/2506) ([90e742d](90e742d))
* **misc**: Fix retry issue when hide page, closes [lobehub#2503](https://github.com/bentwnghk/lobe-chat/issues/2503) ([24489bc](24489bc))
* **misc**: Login button not show on user panel, closes [lobehub#2496](https://github.com/bentwnghk/lobe-chat/issues/2496) ([39637fb](39637fb))
* **misc**: Refresh model config form & mobile footer button lost, closes [lobehub#2318](https://github.com/bentwnghk/lobe-chat/issues/2318) [lobehub#2319](https://github.com/bentwnghk/lobe-chat/issues/2319) [lobehub#1811](https://github.com/bentwnghk/lobe-chat/issues/1811) ([eadcefc](eadcefc))

#### Styles

* **misc**: Add GPT-4o model, closes [lobehub#2481](https://github.com/bentwnghk/lobe-chat/issues/2481) ([ae6a03f](ae6a03f))
* **misc**: Fix scroll and expand, closes [lobehub#2470](https://github.com/bentwnghk/lobe-chat/issues/2470) ([8b1202a](8b1202a))
* **misc**: Update perplexity models, closes [lobehub#2469](https://github.com/bentwnghk/lobe-chat/issues/2469) ([488cde7](488cde7))
* **misc**: Updates 01.AI model list, closes [lobehub#2471](https://github.com/bentwnghk/lobe-chat/issues/2471) ([f28711a](f28711a))

</details>

<div align="right">

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

</div>
akvsdk pushed a commit to akvsdk/lobe-chat that referenced this pull request May 20, 2024
…#2318)

* fix form not update

* Update ModelConfigModal.tsx

* fix lobehub#2319

* react/jsx-sort-props

* lobehub#1811

* onCancel closeModal

* zIndex
akvsdk pushed a commit to akvsdk/lobe-chat that referenced this pull request May 20, 2024
### [Version&nbsp;0.159.4](lobehub/lobe-chat@v0.159.3...v0.159.4)
<sup>Released on **2024-05-14**</sup>

#### 🐛 Bug Fixes

- **misc**: Refresh model config form & mobile footer button lost.

#### 💄 Styles

- **misc**: Add GPT-4o model, update perplexity models, updates 01.AI model list.

<br/>

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

#### What's fixed

* **misc**: Refresh model config form & mobile footer button lost, closes [lobehub#2318](lobehub#2318) [lobehub#2319](lobehub#2319) [lobehub#1811](lobehub#1811) ([eadcefc](lobehub@eadcefc))

#### Styles

* **misc**: Add GPT-4o model, closes [lobehub#2481](lobehub#2481) ([ae6a03f](lobehub@ae6a03f))
* **misc**: Update perplexity models, closes [lobehub#2469](lobehub#2469) ([488cde7](lobehub@488cde7))
* **misc**: Updates 01.AI model list, closes [lobehub#2471](lobehub#2471) ([f28711a](lobehub@f28711a))

</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