fix: prevent floating buttons from jumping during page transitions#7214
Open
KBVsent wants to merge 1 commit intoAstrBotDevs:masterfrom
Open
fix: prevent floating buttons from jumping during page transitions#7214KBVsent wants to merge 1 commit intoAstrBotDevs:masterfrom
KBVsent wants to merge 1 commit intoAstrBotDevs:masterfrom
Conversation
Contributor
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- The visibility condition
(selectedConfigID || isSystemConfig) && fetchedis now duplicated in both thev-slide-y-transitioncontent and the surrounding<template>; consider extracting this into a computed property or a single wrapper element to avoid divergence in future changes. - The three floating buttons all use inline
style="position: fixed; right: 52px; bottom: ...px;"; moving these styles into a dedicated class (e.g., a small FAB stack component or utility classes) would make layout adjustments easier and reduce repetition.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The visibility condition `(selectedConfigID || isSystemConfig) && fetched` is now duplicated in both the `v-slide-y-transition` content and the surrounding `<template>`; consider extracting this into a computed property or a single wrapper element to avoid divergence in future changes.
- The three floating buttons all use inline `style="position: fixed; right: 52px; bottom: ...px;"`; moving these styles into a dedicated class (e.g., a small FAB stack component or utility classes) would make layout adjustments easier and reduce repetition.
## Individual Comments
### Comment 1
<location path="dashboard/src/views/ConfigPage.vue" line_range="69" />
<code_context>
- </template>
- </v-tooltip>
-
- <v-tooltip text="测试当前配置" location="left" v-if="!isSystemConfig">
- <template v-slot:activator="{ props }">
- <v-btn v-bind="props" icon="mdi-chat-processing" size="x-large"
</code_context>
<issue_to_address>
**suggestion:** Align the hard-coded tooltip text with the existing i18n usage.
Other tooltips use `tm(...)` for translated strings, but this one hardcodes `"测试当前配置"`. Please switch to the same i18n mechanism here (e.g. `:text="tm('config.testCurrent')"`) to keep localization consistent.
Suggested implementation:
```
<v-tooltip :text="tm('config.testCurrent')" location="left" v-if="!isSystemConfig">
```
If `tm` is not yet available in the `<script setup>` (or equivalent) section of this component, ensure it is imported or injected in the same way as in nearby tooltip usages you referenced (e.g. via `const { tm } = useI18n()` or similar) so that `tm('config.testCurrent')` works correctly.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors ConfigPage.vue by moving floating action buttons outside the transition block to avoid unnecessary UI animations. Feedback was provided regarding a hardcoded string that should be localized using the existing i18n framework for consistency.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When switching between config sub-pages , the three floating action buttons in the bottom-right corner momentarily jump to the upper part of the page before returning to their correct position. This creates a jarring visual experience for users.
The root cause is that the buttons were placed inside a
v-slide-y-transitioncomponent, causing them to animate along with the page content during transitions.Modifications / 改动点
dashboard/src/views/ConfigPage.vue: Move the three floating buttons outside ofv-slide-y-transitionand wrap them in<template v-if>to maintain the same visibility condition without being affected by transition animations.Screenshots or Test Results / 运行截图或测试结果
BeforeAfterChecklist / 检查清单
😊 If there are new features added in the PR, I have discussed it with the authors through issues/emails, etc.
/ 如果 PR 中有新加入的功能,已经通过 Issue / 邮件等方式和作者讨论过。
👀 My changes have been well-tested, and "Verification Steps" and "Screenshots" have been provided above.
/ 我的更改经过了良好的测试,并已在上方提供了“验证步骤”和“运行截图”。
🤓 I have ensured that no new dependencies are introduced, OR if new dependencies are introduced, they have been added to the appropriate locations in
requirements.txtandpyproject.toml./ 我确保没有引入新依赖库,或者引入了新依赖库的同时将其添加到
requirements.txt和pyproject.toml文件相应位置。😮 My changes do not introduce malicious code.
/ 我的更改没有引入恶意代码。
Summary by Sourcery
Bug Fixes: