Skip to content

feat: optimize WebUI styles for cleaner and more modern appearance#7525

Open
LovieCode wants to merge 1 commit intoAstrBotDevs:masterfrom
LovieCode:feat/webui-custom-theme
Open

feat: optimize WebUI styles for cleaner and more modern appearance#7525
LovieCode wants to merge 1 commit intoAstrBotDevs:masterfrom
LovieCode:feat/webui-custom-theme

Conversation

@LovieCode
Copy link
Copy Markdown
Contributor

@LovieCode LovieCode commented Apr 13, 2026

Summary / 概要

  • 优化亮色/暗色模式的主题色彩和设计令牌
  • 缩小侧边栏导航图标与文字的间距
  • 为对话框添加毛玻璃背景模糊效果和平滑过渡动画
  • 美化 Snackbar 通知样式并添加弹出/收起动画
  • 增强 Tabs 标签页下划线滑动动画和底部装饰线
  • 修复数据表格中批量操作复选框变形的问题
  • 调整控制台日志行间距以提升可读性
  • 修复 select/autocomplete 组件在 solo-filled 变体下 label 不显示的问题
  • 新增页面过渡动画 CSS 类(page-fade、slide-up、fade-scale)
  • 打磨按钮、卡片、表单字段、折叠面板、Alert 等组件样式

本次 PR 对 WebUI 控制面板进行了全面的视觉优化,使界面更加简洁现代、精致统一。统一了亮色/暗色主题下的整体设计语言,细化了按钮、对话框、标签页、通知提示、侧边栏导航、表单字段和数据表格等组件的样式。同时修复了多个 UI 问题,包括批量操作表格中复选框变形、select 组件 label 不可见等。

Modifications / 改动点

主题与变量:

  • dashboard/src/theme/LightTheme.ts — 更新亮色模式配色方案
  • dashboard/src/theme/DarkTheme.ts — 更新暗色模式配色方案
  • dashboard/src/scss/_variables.scss — 优化排版层级、间距令牌、圆角、阴影变量

组件样式:

  • dashboard/src/scss/components/_VButtons.scss — 增强按钮悬停/激活态,调整密度尺寸
  • dashboard/src/scss/components/_VCard.scss — 优化卡片圆角、副标题样式、悬停阴影
  • dashboard/src/scss/components/_VField.scss — 将圆角样式限定在文本框组件(修复复选框变形)
  • dashboard/src/scss/components/_VInput.scss — 修复表格内复选框布局,调整 label 透明度
  • dashboard/src/scss/components/_VTextField.scss — 确保 solo-filled 变体下 label 可见(opacity: 1 !important
  • dashboard/src/scss/components/_VTabs.scss — 下划线使用 cubic-bezier 缓动动画,添加底部装饰线
  • dashboard/src/scss/components/_VNavigationDrawer.scss — 暗色模式下侧边栏背景色
  • dashboard/src/scss/components/_VScrollbar.scss — 滚动条样式微调
  • dashboard/src/scss/components/_VShadow.scss — 阴影令牌定义
  • dashboard/src/scss/components/_CodeBlockDark.scss — 暗色主题代码块配色

全局覆盖:

  • dashboard/src/scss/_override.scss — 对话框背景模糊、Snackbar 动画、菜单样式、进度条平滑过渡、页面过渡动画类(page-fadeslide-upfade-scale)、头像悬停缩放、折叠面板/Alert/骨架屏等打磨

布局:

  • dashboard/src/scss/layout/_sidebar.scss — 缩小图标与文字间距(8px),控制 spacer 宽度
  • dashboard/src/scss/layout/_container.scss — 页面容器细节调整

视图组件:

  • dashboard/src/components/shared/ConsoleDisplayer.vue — 调整日志行高(line-height: 1.4)和间距
  • dashboard/src/views/SessionManagementPage.vue — 布局微调

入口文件:

  • dashboard/src/scss/style.scss — 整理导入顺序

  • This is NOT a breaking change. / 这不是一个破坏性变更。

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

image image image image

Checklist / 检查清单

  • 😊 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.txt and pyproject.toml.
    / 我确保没有引入新依赖库,或者引入了新依赖库的同时将其添加到 requirements.txtpyproject.toml 文件相应位置。

  • 😮 My changes do not introduce malicious code.
    / 我的更改没有引入恶意代码。

Summary by Sourcery

Refresh WebUI theming and component styling to deliver a cleaner, more modern, and more consistent dashboard experience across light and dark modes.

New Features:

  • Introduce global page transition utility classes for fade, slide-up, and fade-scale animations.
  • Add enhanced visual treatments for dialogs, snackbars, tooltips, badges, progress indicators, and code blocks, including blur, rounded corners, and motion.

Bug Fixes:

  • Correct data-table checkbox alignment and sizing to avoid deformation in batch selection flows.
  • Ensure labels remain visible for select and autocomplete components using the solo-filled variant.

Enhancements:

  • Retune light and dark theme color palettes, typography scale, radii, and elevation tokens for a softer, more cohesive visual language.
  • Refine sidebar, header, and container layouts with updated spacing, borders, and scrollbar styling for improved readability and navigation.
  • Standardize buttons, tabs, cards, form fields, and inputs with updated sizes, radii, hover/active behaviors, and animations for better usability.
  • Improve console log display and terminal output readability via adjusted line height, spacing, and monospace styling.

- Enhance theme colors and design tokens for light/dark mode
- Improve sidebar navigation with reduced icon spacing
- Add dialog backdrop blur effect with smooth transitions
- Beautify snackbar notifications with animations
- Enhance tabs slider animation and bottom decoration
- Fix checkbox distortion in data tables
- Adjust console log line spacing for better readability
- Optimize select/autocomplete label visibility in solo-filled variant
- Add page transition animation classes (page-fade, slide-up, fade-scale)
- Polish buttons, cards, fields, expansion panels, alerts, and more
@dosubot dosubot bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label Apr 13, 2026
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

This pull request implements a comprehensive UI/UX overhaul of the dashboard, updating the global design system and refining component-level styling. Key changes include increasing the root border radius to 12px, adopting the 'Inter' font family, and modernizing the color palette for both light and dark themes. Numerous Vuetify components—including buttons, cards, fields, tabs, and scrollbars—have been customized with updated padding, transitions, and hover effects to ensure a consistent and polished interface. The review feedback highlights opportunities to improve maintainability by using global variables for border radii, optimizing performance by avoiding universal selectors for scrollbar styles, and ensuring visual clarity by using integer pixel values for focused input borders.

text-transform: none;
letter-spacing: $btn-letter-spacing;
font-weight: $btn-font-weight;
border-radius: 10px;
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

硬编码的 10px 圆角与全局变量 $border-radius-root(在 _variables.scss 中已更新为 12px)不一致。在多个组件中直接使用硬编码数值而不是主题变量会降低代码的可维护性,并可能导致 UI 视觉上的不统一。建议使用 $border-radius-root 或其派生变量以保持一致性。

Suggested change
border-radius: 10px;
border-radius: $border-radius-root;

}

/* Firefox 兼容性 */
* {
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

使用通配符选择器 * 来应用滚动条样式(以及第 91 行的触摸滚动优化)可能会对渲染性能产生负面影响,尤其是在复杂的页面中,因为浏览器必须为每个元素计算这些样式。建议将这些全局样式限制在 htmlbody 或特定的滚动容器上。

Suggested change
* {
html {


&.v-field--focused {
.v-field__outline {
--v-field-border-width: 1.5px;
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

使用 1.5px 这种非整数的边框宽度在标准分辨率显示器上可能会导致渲染模糊。为了确保 UI 的清晰度和一致性,建议在焦点状态下使用整数像素值(例如 2px)。

Suggested change
--v-field-border-width: 1.5px;
--v-field-border-width: 2px;

Copy link
Copy Markdown
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 - I've left some high level feedback:

  • There are many newly introduced hard-coded pixel values for radii, padding, heights, and font sizes across components (buttons, tabs, fields, sidebar, etc.); consider consolidating these into shared SCSS variables or design tokens so future visual tweaks remain consistent and easier to maintain.
  • The new use of backdrop-filter/-webkit-backdrop-filter (dialogs, overlays) and multiple animated transitions (snackbar, page transitions, progress, drawer) may have performance implications on low-end devices; it would be good to confine these effects to the minimum necessary elements or add fallbacks for browsers that handle them poorly.
  • Code font and code block styling is now defined in multiple places (_override.scss, _CodeBlockDark.scss, and global pre/code rules); consider centralizing these styles so changes to code presentation only need to be made in one place and to avoid conflicting declarations.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- There are many newly introduced hard-coded pixel values for radii, padding, heights, and font sizes across components (buttons, tabs, fields, sidebar, etc.); consider consolidating these into shared SCSS variables or design tokens so future visual tweaks remain consistent and easier to maintain.
- The new use of `backdrop-filter`/`-webkit-backdrop-filter` (dialogs, overlays) and multiple animated transitions (snackbar, page transitions, progress, drawer) may have performance implications on low-end devices; it would be good to confine these effects to the minimum necessary elements or add fallbacks for browsers that handle them poorly.
- Code font and code block styling is now defined in multiple places (`_override.scss`, `_CodeBlockDark.scss`, and global `pre/code` rules); consider centralizing these styles so changes to code presentation only need to be made in one place and to avoid conflicting declarations.

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 Apr 13, 2026
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. size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant