-
-
Notifications
You must be signed in to change notification settings - Fork 10k
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
💄 style: support to reset fetched models #4260
base: main
Are you sure you want to change the base?
Conversation
@vual is attempting to deploy a commit to the LobeChat Community Team on Vercel. A member of the Team first needs to authorize it. |
👍 @vual Thank you for raising your pull request and contributing to our Community |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4260 +/- ##
==========================================
- Coverage 92.53% 92.52% -0.02%
==========================================
Files 522 522
Lines 37340 37363 +23
Branches 3665 3668 +3
==========================================
+ Hits 34552 34569 +17
- Misses 2788 2794 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
建议放在我画圈的位置,用 ActionIcon 组件 (默认不展示文本只放图标,hover 才显示 title)。放你现在那个位置很容易出现多点一次重置模型的情况,即 CLS 会有问题。详见:https://web.dev/articles/cls?hl=zh-cn |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
功能没问题了,把这个细节实现再修一下~
另外可以跑下 npm run i18n 自动生成 locale
@@ -52,19 +53,28 @@ const ModelFetcher = memo<ModelFetcherProps>(({ provider }) => { | |||
(s) => modelProviderSelectors.getModelCardsById(provider)(s).length, | |||
); | |||
|
|||
const remoteModels = useUserStore((s) => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import isEqual from 'fast-deep-equal';
const remoteModels = useUserStore(modelProviderSelectors.remoteProviderModelCards(provider), isEqual
);
remoteModels 是一个数组,因此需要这么写来避免 rerender
@vual 配到 .env 里 |
@vual allocated to .env |
可以了。 |
That's it. |
rebase 下 main |
rebase under main |
# Conflicts: # locales/ko-KR/models.json # locales/pt-BR/models.json # locales/ru-RU/models.json # locales/zh-CN/models.json
可以了。 |
That's it. |
有问题哈,locale 这边不应该有回车的,你需要跑一下 git commit 前的 lint 自动格式化掉。 |
There is a problem. There should not be a carriage return in the locale. You need to run lint before git commit to automatically format it. |
重新pnpm run i18n了,应该可以了。 |
Re-pnpm run i18n, it should be OK. |
rebase 下main? 另外 locale 的更新不应该每个都加回车的,你是不是提交前没跑下 lint 和 format? 功能代码上没问题了, locale 的部分处理下 |
Rebase under main? In addition, every locale update should not include a carriage return. Did you not run lint and format before submitting? There is no problem with the function code |
很奇怪,我并没有加回车,我只是重跑了npm run i18n |
It's strange, I didn't add the carriage return, I just reran npm run i18n |
# Conflicts: # src/store/user/slices/modelList/action.ts
重跑以后正常提交会做一次格式化,会自动把回车去掉的,你是不是跳过 commit 时候的hook了? |
After re-running, normal submission will be formatted and the carriage return will be automatically removed. Did you skip the hook during commit? |
有可能,我重新弄下 |
It's possible, I'll do it again |
# Conflicts: # locales/ar/models.json # locales/ar/providers.json # locales/ar/setting.json # locales/bg-BG/models.json # locales/bg-BG/providers.json # locales/bg-BG/setting.json # locales/de-DE/models.json # locales/de-DE/providers.json # locales/en-US/models.json # locales/en-US/providers.json # locales/en-US/setting.json # locales/es-ES/models.json # locales/es-ES/providers.json # locales/fa-IR/modelProvider.json # locales/fa-IR/models.json # locales/fa-IR/providers.json # locales/fa-IR/setting.json # locales/fr-FR/models.json # locales/fr-FR/providers.json # locales/fr-FR/setting.json # locales/it-IT/models.json # locales/it-IT/providers.json # locales/it-IT/setting.json # locales/ja-JP/models.json # locales/ja-JP/providers.json # locales/ko-KR/models.json # locales/ko-KR/providers.json # locales/ko-KR/setting.json # locales/nl-NL/models.json # locales/nl-NL/providers.json # locales/nl-NL/setting.json # locales/pl-PL/models.json # locales/pl-PL/providers.json # locales/pt-BR/models.json # locales/pt-BR/providers.json # locales/ru-RU/models.json # locales/ru-RU/providers.json # locales/tr-TR/models.json # locales/tr-TR/providers.json # locales/vi-VN/models.json # locales/vi-VN/providers.json # locales/vi-VN/setting.json # locales/zh-TW/models.json # src/app/(main)/settings/llm/components/ProviderModelList/ModelFetcher.tsx
弄好了,你再检查看看 |
It's done, check again |
💻 变更类型 | Change Type
🔀 变更说明 | Description of Change
增加【清除获取的模型】的功能,主要是用于在获取模型列表后,不想要了,需要恢复系统自带的模型。
📝 补充信息 | Additional Information