close
Skip to content

feat(setting): 支持自定义缓存大小上限#644

Merged
imsyy merged 1 commit intoimsyy:devfrom
MoYingJi:feat-cache-size
Dec 20, 2025
Merged

feat(setting): 支持自定义缓存大小上限#644
imsyy merged 1 commit intoimsyy:devfrom
MoYingJi:feat-cache-size

Conversation

@MoYingJi
Copy link
Copy Markdown
Collaborator

No description provided.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @MoYingJi, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

此拉取请求旨在提升应用程序中缓存大小上限设置的灵活性和用户体验。通过引入自定义输入功能和“无限制”选项,用户现在可以更精细地控制本地缓存的使用,以适应不同的存储需求和偏好,从而优化应用程序的性能和资源管理。

Highlights

  • 缓存大小设置界面优化: 将原有的预设缓存大小选择器替换为更灵活的输入组,允许用户自定义缓存大小。
  • 支持自定义缓存大小: 用户现在可以通过数字输入框设置精确的缓存大小上限,支持小数,最小值为 2GB,最大值为 9999GB。
  • 新增“无限制”选项: 缓存大小设置中新增了“无限制”选项,用户可以选择不限制缓存大小。
  • 移除固定选项: 移除了之前预设的缓存大小选项列表(如 5G, 10G 等)。
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

此 PR 引入了自定义缓存大小上限的功能,将原有的固定选项选择框替换为了一个允许用户输入具体数值的输入框,并可以切换是否启用限制。这是一个很好的功能增强。代码整体实现良好,但在 UI/UX 和边缘情况处理上有一些可以改进的地方。我提出了两点建议:一是处理用户清空输入框时的逻辑,避免状态不一致;二是优化选择器的标签,使其行为更直观,避免用户困惑。请查看具体的代码注释。

Comment thread src/components/Setting/LocalSetting.vue Outdated
Comment thread src/components/Setting/LocalSetting.vue Outdated
v-model:value="cacheLimited"
:options="[
{ label: '无限制', value: 0 },
{ label: cacheLimited ? 'GB' : '手动限制', value: 1 },
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

n-select 选项的标签是动态的 (cacheLimited ? 'GB' : '手动限制'),这可能会导致用户体验上的困惑。当用户在“无限制”模式下选择“手动限制”后,选项的文本会立刻变为“GB”。用户选择的是一个动作,但看到的是一个单位,这不符合直觉。建议使用静态的标签“手动限制”,让 n-select 的行为更像一个模式切换开关。单位“GB”可以通过提示文本(目前已有)或是在数字输入框旁边显示来告知用户。

                { label: '手动限制', value: 1 },

@MoYingJi
Copy link
Copy Markdown
Collaborator Author

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

这个 PR 引入了自定义缓存大小上限的功能,替代了之前固定的选项。整体实现很好,用一个 n-input-group 结合 n-input-numbern-select 来提供一个灵活的设置界面。代码结构清晰,也正确地在组件挂载时加载了已保存的设置。

我发现一个小问题,当用户在“不限制”和“限制大小”之间切换时,之前自定义的缓存大小会丢失,并重置为默认的 10GB。我提供了一个代码建议来改善这个用户体验,避免数据丢失。

Comment thread src/components/Setting/LocalSetting.vue
@MoYingJi
Copy link
Copy Markdown
Collaborator Author

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

这次的 Pull Request 主要是为了实现自定义缓存大小上限的功能。整体实现得不错,通过组合 n-input-numbern-select 组件提供了一个灵活的用户界面。代码逻辑大部分是正确的,但我发现了一个事件处理函数中的小 bug,可能会导致组件内部状态和持久化存储的数据不一致。我已经就此问题提出了具体的代码修改建议。除此以外,其他改动看起来都很好。

Comment thread src/components/Setting/LocalSetting.vue Outdated
@MoYingJi
Copy link
Copy Markdown
Collaborator Author

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

此次更新引入了自定义缓存大小上限的功能,替代了原有的固定选项,为用户提供了更高的灵活性。整体实现良好,通过组合输入框和选择器,UI 交互设计得比较巧妙。代码逻辑在处理“不限制”状态和保留用户输入值方面考虑周全。我只发现了一个可以改进的地方,即在模板中可以采用更清晰的数据绑定方式,以提高代码的可读性和可维护性。

Comment thread src/components/Setting/LocalSetting.vue
@imsyy imsyy merged commit 4f74566 into imsyy:dev Dec 20, 2025
@MoYingJi MoYingJi deleted the feat-cache-size branch December 20, 2025 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants