Skip to content

style: 统一滚动条样式与设置页面字体规范#366

Merged
lzx8589561 merged 1 commit intoZToolsCenter:mainfrom
Yueby:style/ui-consistency-and-scrollbar
Apr 1, 2026
Merged

style: 统一滚动条样式与设置页面字体规范#366
lzx8589561 merged 1 commit intoZToolsCenter:mainfrom
Yueby:style/ui-consistency-and-scrollbar

Conversation

@Yueby
Copy link
Copy Markdown
Collaborator

@Yueby Yueby commented Mar 31, 2026

Summary

  • 统一全局滚动条样式:降低默认透明度,hover 恢复原始值,添加过渡动画;移除各组件重复的滚动条定义,由 globalStyles.ts 和 style.css 统一管理
  • MCP 服务设置页面完全重写:移除发光背景/阴影/浮起动画,对齐 HttpServiceSetting/SyncSetting 风格;添加折叠动画和 SVG 箭头图标
  • 规范设置插件字体大小:GeneralSetting 标签 15px→14px / 说明 13px→12px,DebugSetting 标题 16px→20px
  • 重命名语义冲突的 CSS 类名:ShortcutsSetting section-title → category-label,PluginMarketSetting section-title → storefront-title

Changes

  • src/main/core/globalStyles.ts / src/renderer/src/style.css / src/main/api/plugin/toast.ts: 滚动条透明度和过渡
  • internal-plugins/setting/src/views/McpServiceSetting/McpServiceSetting.vue: 完全重写
  • GeneralSetting.vue / DebugSetting.vue / ShortcutsSetting.vue / PluginMarketSetting.vue / CategoryDetail.vue: 字体和类名规范
  • SearchResults.vue / UpdateWindow.vue / global.css / Dropdown.vue: 移除重复滚动条样式

滚动条统一:
- 降低默认透明度,hover 恢复原始值,添加过渡动画
- 移除 SearchResults、UpdateWindow、setting/global.css、Dropdown 的
  重复滚动条样式,由 globalStyles.ts 和 style.css 统一管理
- toast.ts 内联样式同步更新

设置插件 UI 规范:
- MCP 服务页面完全重写,对齐 HttpServiceSetting/SyncSetting 风格
  移除发光背景、大圆角、阴影、浮起动画;添加折叠动画和 SVG 箭头
- GeneralSetting: setting-label 15px→14px, setting-desc 13px→12px
- DebugSetting: section-title 16px→20px
- ShortcutsSetting: section-title 重命名为 category-label 避免混淆
- PluginMarketSetting/CategoryDetail: section-title 重命名为 storefront-title

Made-with: Cursor
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 focuses on unifying the application's visual style by centralizing scrollbar CSS into a global configuration and refactoring the MCP Service settings into a more consistent list-based layout. It also includes various font size adjustments, class renames for better specificity, and minor import cleanups. Review feedback identifies a missing state rollback mechanism when saving MCP configurations fails, potential concurrency issues when toggling multiple plugins rapidly, and the inclusion of unsupported CSS transition properties on scrollbar pseudo-elements.

<span class="setting-desc">开启后外部 MCP 客户端可连接并调用插件工具</span>
</div>
<label class="toggle">
<input v-model="enabled" type="checkbox" @change="handleServiceToggle" />
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

此处绑定的 handleServiceToggle 函数(最终调用 saveConfig)在后端保存失败时缺少回滚 enabled 状态的逻辑。由于 enabled 是通过 v-model 双向绑定的,如果后端接口返回错误,UI 上的开关仍会保持在错误的状态。建议在 saveConfig 的错误处理逻辑中增加回滚操作。

<label class="toggle" @click.stop>
<input
:checked="plugin.enabled"
:disabled="savingPluginPath === plugin.pluginPath"
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

使用 savingPluginPath === plugin.pluginPath 来禁用开关在处理并发操作时是不够的。如果用户快速点击多个插件,savingPluginPath 只会记录最后一个点击的路径,导致之前正在处理的插件开关被提前解除禁用。此外,并发修改 MCP_DISABLED_PLUGINS_KEY 可能会导致状态丢失。建议在脚本逻辑中使用 Set 管理加载状态,并确保数据库操作的顺序性。


::-webkit-scrollbar-thumb {
border-radius: 3px !important;
transition: background 0.2s ease !important;
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

在 WebKit/Chromium 环境下,::-webkit-scrollbar-thumb 等伪元素并不支持 transition 属性。这段代码不会产生预期的过渡动画效果,属于无效代码。建议移除以保持全局样式表的纯净,避免误导后续开发。同理,src/main/core/globalStyles.tssrc/main/api/plugin/toast.ts 中类似的定义也建议移除。

@lzx8589561 lzx8589561 merged commit c8c4e32 into ZToolsCenter:main Apr 1, 2026
@Yueby Yueby deleted the style/ui-consistency-and-scrollbar branch April 14, 2026 13:45
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