feat(ui): 侧边栏折叠与主题切换系统 #55
Merged
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.
概述
本 PR 实现了侧边栏折叠功能和完整的主题切换系统,显著提升应用的用户体验和个性化能力。
主要功能
1. 侧边栏折叠功能 ✨
localStorage2. 主题切换系统 🎨
localStorage3. 新增 UI 组件
@radix-ui/react-avatar)@radix-ui/react-tooltip)4. HTTP 客户端优化 🔧
FileDownloader改为每次请求时动态创建 HTTP 客户端视觉改进
技术实现
文件变更
src/hooks/useTheme.tsx- 主题管理 Hooksrc/components/ui/avatar.tsx- Avatar 组件src/components/ui/tooltip.tsx- Tooltip 组件src/components/layout/AppSidebar.tsx- 侧边栏重构(+348/-105行)src/main.tsx- 添加 ThemeProvidersrc/index.css- 主题色调整src-tauri/src/services/tool/downloader.rs- HTTP 客户端优化依赖更新
@radix-ui/react-avatar: ^1.1.11@radix-ui/react-tooltip: ^1.2.8测试情况
npm run check)用户体验提升
风险评估
低风险
需要关注
prefers-color-scheme后续优化建议
截图
(建议添加折叠前后对比、主题切换效果截图)
关联 Issue: 无(主动 UX 优化)