Skip to content

perf(Setting): 加快设置界面过渡动画速度#844

Merged
imsyy merged 1 commit intoimsyy:devfrom
MoYingJi:pr/d
Feb 8, 2026
Merged

perf(Setting): 加快设置界面过渡动画速度#844
imsyy merged 1 commit intoimsyy:devfrom
MoYingJi:pr/d

Conversation

@MoYingJi
Copy link
Collaborator

@MoYingJi MoYingJi commented Feb 7, 2026

上来就是砍动画时长

@gemini-code-assist
Copy link
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

  • 设置界面主内容过渡动画加速: 为设置界面的主要内容切换动画(fade 过渡)显式设置了 70 毫秒的持续时间,以加快页面间的过渡速度。
  • 设置项入场动画延迟缩短: 将设置项分组标题和单个设置项的错开动画延迟从 0.05 秒缩短至 0.03 秒,减少了元素逐个出现的等待时间。
  • 设置项入场动画持续时间缩短: 将设置项的 slide-up-fade-in 动画持续时间从 0.4 秒缩短至 0.25 秒,使动画效果更加迅速。
Changelog
  • src/components/Setting/MainSetting.vue
    • Transition 组件添加了 duration 属性,将淡入淡出动画持续时间设置为 70ms。
  • src/components/Setting/UniversalSetting.vue
    • 调整了分组标题和设置项的 slide-in-item 样式中 --delay CSS 变量的计算值,从 0.05s 变为 0.03s
    • .slide-in-itemanimation 持续时间从 0.4s 缩短至 0.25s
Activity
  • 此拉取请求由 MoYingJi 创建,旨在优化设置界面的动画性能。目前没有其他评审或评论活动。
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
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 旨在加快设置界面的过渡动画,通过减少动画时长和延迟来实现。代码变更与此目标一致,有效地提升了界面的响应速度。我的审查意见主要集中在提高代码质量和可维护性方面,包括提取魔法数字为常量或变量,以及消除重复的动画延迟计算逻辑,以便于未来的维护和调整。

:content-style="{ overflow: 'hidden', padding: '40px 0' }"
>
<Transition name="fade" mode="out-in" @after-leave="setScrollbar?.scrollTo({ top: 0 })">
<Transition name="fade" mode="out-in" :duration="70" @after-leave="setScrollbar?.scrollTo({ top: 0 })">
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

为了提高代码的可读性和可维护性,建议将魔法数字 70 提取为具名常量。例如,在 <script setup> 中定义 const FADE_DURATION = 70;,然后在模板中使用它。这使得值的意图更清晰,并且将来更容易修改。

}
.slide-in-item {
animation: slide-up-fade-in 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) backwards;
animation: slide-up-fade-in 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94) backwards;
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

为了提高可维护性,建议将动画时长 0.25s 定义为一个 SCSS 变量。例如:$slide-in-duration: 0.25s;,然后在 animation 属性中使用该变量。这样可以方便未来统一调整动画参数,也让代码意图更明确。

@apoint123 apoint123 requested a review from imsyy February 7, 2026 17:07
@imsyy imsyy merged commit e70a4d5 into imsyy:dev Feb 8, 2026
@MoYingJi MoYingJi deleted the pr/d branch February 8, 2026 15:07
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.

3 participants