Skip to content

fix(dashboard): 将插件页面的提示与整个用户界面中心对齐 (#6022)#6043

Open
catDforD wants to merge 2 commits intoAstrBotDevs:masterfrom
catDforD:fix/6022
Open

fix(dashboard): 将插件页面的提示与整个用户界面中心对齐 (#6022)#6043
catDforD wants to merge 2 commits intoAstrBotDevs:masterfrom
catDforD:fix/6022

Conversation

@catDforD
Copy link
Contributor

@catDforD catDforD commented Mar 11, 2026

Fixes #6022

Closes #6022

插件页中的底部提示框(snackbar)视觉中心与安装弹窗、加载弹窗不一致。
根因是 VSnackbar 会额外应用 Vuetify layout 的左右偏移量,导致提示框按主内容区居中,而弹窗更接近按整个 UI 视口居中,最终在插件栏目下表现为“偏心”。

本次改动仅针对插件页做最小修复:

  • 显式将插件页 snackbar 定位为 bottom center
  • 覆盖 snackbar 的 --v-layout-left / --v-layout-right0px
  • 让提示框按整个 UI 视口中心线显示,与插件页弹窗视觉对齐
  • 不改动全局 toast 逻辑,不影响其他页面

Modifications / 改动点

文件变更统计:

  • 新增文件:0 个
  • 修改文件:1 个
  • 删除文件:0 个

详细变更:

文件 变更类型 说明
dashboard/src/views/ExtensionPage.vue 修改 调整插件页 snackbar 的定位与 layout 偏移,使其按整个 UI 居中显示
  • This is NOT a breaking change. / 这不是一个破坏性变更。

Screenshots or Test Results / 运行截图或测试结果

已本地构建验证,并同步前端产物到运行时优先读取的 data/dist

验证步骤:

  1. 打开 Dashboard 的“插件”栏目
  2. 触发底部提示框,例如安装插件、刷新插件市场、插件操作提示
  3. 对比提示框与安装弹窗/加载弹窗的水平中心线

测试命令:

cd dashboard
pnpm install --frozen-lockfile
pnpm build
rsync -a --delete dashboard/dist/ data/dist/

测试结果:

  • pnpm build 通过
  • 仅存在项目原有的 CSS minify warning,无新增构建错误
  • 插件页底部提示框改为按整个 UI 视口居中显示

运行视频:

test.mp4

补充说明:

根据 review 反馈,这次在原先仅修复插件页 snackbar 的基础上,进一步统一处理了 Dashboard 中其他页面的 snackbar 定位问题,保证整体视觉风格一致,效果如下:

re2.mp4

Checklist / 检查清单

  • 😊 如果 PR 中有新加入的功能,已经通过 Issue / 邮件等方式和作者讨论过。/ If there are new features added in the PR, I have discussed it with the authors through issues/emails, etc.
  • 👀 我的更改经过了良好的测试,并已在上方提供了“验证步骤”和“运行截图”。/ My changes have been well-tested, and "Verification Steps" and "Screenshots" have been provided above.
  • 🤓 我确保没有引入新依赖库,或者引入了新依赖库的同时将其添加到了 requirements.txtpyproject.toml 文件相应位置。/ 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.txt and pyproject.toml.
  • 😮 我的更改没有引入恶意代码。/ My changes do not introduce malicious code.

Summary by Sourcery

错误修复:

  • 修复扩展页面上 snackbar 对齐不正确的问题,使其相对于完整界面居中,而不是相对于主内容区域居中。
Original summary in English

Summary by Sourcery

Bug Fixes:

  • Fix misaligned snackbar on the extension page so it centers relative to the full UI instead of the main content area.

@auto-assign auto-assign bot requested review from LIghtJUNction and Soulter March 11, 2026 10:56
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Mar 11, 2026
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - 我在这里给出了一些总体反馈:

  • 建议将 --v-layout-left / --v-layout-right 的内联 :style 覆盖提取到一个具名的 class 或 scoped style 块中,这样样式意图会更清晰,之后在单一位置进行调整也会更方便。
  • 建议在 snackbar 附近添加一个简短的代码注释,说明为什么要重写这些布局变量(相对于整个 UI 而不是主内容进行居中),以避免将来的重构不小心移除这个修复。
给 AI Agent 的提示
Please address the comments from this code review:

## Overall Comments
- Consider extracting the inline `:style` overrides for `--v-layout-left`/`--v-layout-right` into a named class or scoped style block so the styling intent is clearer and easier to adjust in one place later.
- It may be helpful to add a short code comment near the snackbar explaining why the layout variables are being overridden (centering relative to the full UI instead of the main content) to avoid future refactors accidentally removing this fix.

Sourcery 对开源项目是免费的——如果你觉得我们的评审有帮助,欢迎分享 ✨
帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进后续评审。
Original comment in English

Hey - I've left some high level feedback:

  • Consider extracting the inline :style overrides for --v-layout-left/--v-layout-right into a named class or scoped style block so the styling intent is clearer and easier to adjust in one place later.
  • It may be helpful to add a short code comment near the snackbar explaining why the layout variables are being overridden (centering relative to the full UI instead of the main content) to avoid future refactors accidentally removing this fix.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider extracting the inline `:style` overrides for `--v-layout-left`/`--v-layout-right` into a named class or scoped style block so the styling intent is clearer and easier to adjust in one place later.
- It may be helpful to add a short code comment near the snackbar explaining why the layout variables are being overridden (centering relative to the full UI instead of the main content) to avoid future refactors accidentally removing this fix.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@dosubot dosubot bot added the area:webui The bug / feature is about webui(dashboard) of astrbot. label Mar 11, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, 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!

此拉取请求旨在提升用户体验,通过修正插件页面中底部提示框的对齐方式,使其与页面上的其他弹窗保持视觉一致。这一调整确保了所有重要的 UI 元素都能在整个视口中居中显示,从而提供一个更加协调和专业的界面布局。

Highlights

  • 修复 Snackbar 对齐问题: 解决了插件页面中底部提示框(snackbar)与安装/加载弹窗视觉中心不一致的问题。此前,snackbar 按照主内容区居中,而弹窗则按整个 UI 视口居中,导致视觉上的“偏心”。
  • 调整定位与样式: 通过显式设置 snackbar 的 location 属性为 bottom center,并覆盖 --v-layout-left--v-layout-right CSS 变量为 0px,使提示框能够按整个 UI 视口中心线显示。
  • 最小化影响范围: 此改动仅针对插件页面进行,不影响全局 toast 逻辑或其他页面的显示效果,确保了修复的局部性和安全性。
Changelog
  • dashboard/src/views/ExtensionPage.vue
    • 调整插件页 snackbar 的定位与 layout 偏移,使其按整个 UI 居中显示
Activity
  • 作者已本地构建并验证了更改,确保功能正常。
  • 前端产物已同步到 data/dist 进行运行时优先读取测试。
  • 提供了详细的验证步骤和测试结果,包括 pnpm build 通过和无新增构建错误。
  • 附带了运行视频以直观展示修复效果。
  • Sourcery 提供了自动生成的摘要,确认了这是一个错误修复,解决了扩展页面上 snackbar 对齐不正确的问题。
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

本次 PR 修复了插件页面底部提示框(snackbar)的对齐问题,使其与 UI 整体居中对齐。改动通过为 v-snackbar 组件添加内联样式来覆盖 Vuetify 的布局偏移量,从而解决了问题。代码改动是有效的。我提供了一个建议,将内联样式重构为 CSS 类,以提高代码的可维护性。

Comment on lines +399 to +400
location="bottom center"
:style="{ '--v-layout-left': '0px', '--v-layout-right': '0px' }"
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

为了更好的可维护性和分离关注点,建议将内联样式提取到一个 CSS 类中。您可以在 <style scoped> 块中添加一个类,例如 .centered-snackbar,然后在模板中使用它。这使得样式更易于管理和复用。

例如,在 <style scoped> 中添加:

.centered-snackbar {
  --v-layout-left: 0px;
  --v-layout-right: 0px;
}

然后在模板中这样使用:

    location="bottom center"
    class="centered-snackbar"

@zouyonghe
Copy link
Member

e7c83bef016bc49912f69d7dea1c8f89

其他很多地方的snacbar也需要一起改掉,保证风格统一

@catDforD
Copy link
Contributor Author

行,明天一起改了。

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Mar 11, 2026
@Soulter
Copy link
Member

Soulter commented Mar 11, 2026

怎么我感觉不对齐也挺好看的(

@catDforD
Copy link
Contributor Author

e7c83bef016bc49912f69d7dea1c8f89 其他很多地方的snacbar也需要一起改掉,保证风格统一

已调整为统一风格,以整体界面为参照设置中心 。

@zouyonghe zouyonghe requested a review from Soulter March 12, 2026 03:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:webui The bug / feature is about webui(dashboard) of astrbot. lgtm This PR has been approved by a maintainer size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]弹窗和提示不对齐

3 participants