### 详细变更:
1. **文档与配置**:更新AGENTS.md添加命令超时约束,升级Rive依赖至0.14.7并替换平台插件引用
2. **UI优化**:重构AppInfo页面布局、移除图表冗余配置、锁定部分系统设置项
3. **功能增强**:
- 新增工具面板拖拽状态管理与介绍弹窗
- 新增进度页面编辑/重排/清空用户进度功能
- 新增摇一摇路由作用域拦截逻辑
4. **体验优化**:
- 统一外部链接跳转弹窗,添加文件打开确认逻辑
- 修复设备卡片IP溢出、Android权限声明问题
- 后台任务初始化增加协议校验
5. **代码重构**:拆分工具面板配置、拖拽逻辑与动画参数,优化状态管理代码
6. **工具脚本**:新增协议文件上传脚本
6.0 KiB
工具面板15项改进实施计划
For agentic workers: REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (
- [ ]) syntax for tracking.
Goal: 实施工具面板15项架构重构与功能扩展
Architecture: 分4个阶段实施:Phase 1 架构基础 → Phase 2 代码质量 → Phase 3 UX打磨 → Phase 4 新功能。每阶段完成后运行 flutter analyze 验证。
Tech Stack: Flutter/Dart, Riverpod, share_plus, Cupertino风格
Phase 1: 架构基础(5项)
Task 1: 动画配置类抽取 (#5)
Files:
-
Create:
lib/features/discover/presentation/widgets/tool/tool_panel_config.dart -
Modify:
lib/features/discover/presentation/widgets/tool/tool_panel.dart -
创建 ToolPanelAnimConfig 配置类,抽取所有硬编码动画参数
-
在 _ToolPanelAnimatedContentState 中使用配置类替换硬编码值
Task 2: ToolPanelOverlayRoute 公开化 (#15)
Files:
-
Modify:
lib/features/discover/presentation/widgets/tool/tool_panel.dart -
将
_ToolPanelOverlayRoute重命名为ToolPanelOverlayRoute并公开 -
确保外部可测试和复用
Task 3: DragState 封装 (#12)
Files:
-
Create:
lib/features/discover/presentation/widgets/tool/tool_panel_drag_state.dart -
Modify:
lib/features/discover/presentation/widgets/tool/tool_panel.dart -
Modify:
lib/features/discover/presentation/widgets/tool/tool_panel_sections.dart -
创建 DragState 类封装拖拽状态管理
-
替换4个抽象方法为单一 DragState 对象
-
更新 SectionsMixin 使用 DragState
Task 4: 导航配置数据驱动 (#8)
Files:
-
Modify:
lib/features/discover/presentation/widgets/tool/tool_panel_navigator.dart -
Modify:
lib/features/discover/models/tool_item.dart -
在 ToolItem 模型中添加 navConfig 字段
-
创建 ToolNavConfig 数据类替代 switch-case
-
在 defaultTools 中为每个工具配置 navConfig
-
ToolPanelNavHelper 改为从 navConfig 读取
Task 5: Mixin链简化为组合模式 (#9)
Files:
-
Modify:
lib/features/discover/presentation/widgets/tool/tool_panel_navigator.dart -
Modify:
lib/features/discover/presentation/widgets/tool/tool_panel_actions.dart -
Modify:
lib/features/discover/presentation/widgets/tool/tool_panel_sections.dart -
Modify:
lib/features/discover/presentation/widgets/tool/tool_panel.dart -
将 NavigatorMixin 改为独立 ToolPanelNavigation 类(持有 ref/context)
-
将 ActionsMixin 改为独立 ToolPanelActions 类
-
将 SectionsMixin 改为独立 ToolPanelSections 类
-
State 中通过组合持有这些类实例
Phase 2: 代码质量(3项)
Task 6: GridView 重复代码抽取 (#10)
Files:
-
Modify:
lib/features/discover/presentation/widgets/tool/tool_panel_sections.dart -
抽取 buildToolGrid 公共方法
-
buildCategorizedTools 和 buildSearchResults 复用
Task 7: ToolGridItem 回调简化 (#11)
Files:
-
Modify:
lib/features/discover/presentation/widgets/tool/tool_panel_sections.dart -
抽取 buildGridItemCallbacks 方法
-
childWhenDragging 和 child 共用回调
Task 8: 错误边界 — 工具跳转失败用户提示 (#13)
Files:
-
Modify:
lib/features/discover/presentation/widgets/tool/tool_panel_navigator.dart -
navigateToTool 添加 try-catch + AppToast 错误提示
-
离线工具点击时显示状态提示
Phase 3: UX打磨(3项)
Task 9: 分类吸顶实现 (#4)
Files:
-
Modify:
lib/features/discover/presentation/widgets/tool/tool_panel.dart -
Modify:
lib/features/discover/presentation/widgets/tool/tool_panel_sections.dart -
将 Column+SliverToBoxAdapter 改为纯 Sliver 布局
-
实现 CategoryPinnedHeaderDelegate (SliverPersistentHeaderDelegate)
-
分类标题滚动时吸顶
Task 10: 弹性回弹动画 (#14)
Files:
-
Modify:
lib/features/discover/presentation/widgets/tool/tool_panel.dart -
使用 SpringSimulation 替代线性 dismissOffset 归零
-
添加弹性回弹效果
Task 11: 无障碍 Semantics 支持 (#6)
Files:
-
Modify:
lib/features/discover/presentation/widgets/tool/tool_panel_sections.dart -
Modify:
lib/features/discover/presentation/widgets/tool/tool_panel_widgets.dart -
Modify:
lib/features/discover/presentation/widgets/tool/tool_grid_item.dart -
工具网格项添加 Semantics(label/hint)
-
操作菜单项添加 Semantics
-
搜索结果空状态添加 Semantics
-
拖拽反馈添加 Semantics
Phase 4: 新功能(4项)
Task 12: 工具收藏/自定义排序 (#1)
Files:
-
Modify:
lib/features/discover/presentation/widgets/tool/tool_panel_sections.dart -
Modify:
lib/features/discover/presentation/widgets/tool/tool_panel.dart -
新增收藏工具专区(favoritedTools)
-
排序选择器(使用频率/名称/最近使用/评分)
-
排序状态持久化
Task 13: 工具使用统计面板 (#2)
Files:
-
Create:
lib/features/discover/presentation/widgets/tool/tool_stats_sheet.dart -
Modify:
lib/features/discover/presentation/widgets/tool/tool_panel_actions.dart -
创建 ToolStatsSheet 底部弹窗
-
显示使用频率柱状图 + 时长统计 + 最近使用记录
-
长按菜单"📊 使用统计"接入
Task 14: 工具分享功能 (#3)
Files:
-
Modify:
lib/features/discover/presentation/widgets/tool/tool_panel_navigator.dart -
接入项目已有 ShareSheet 系统
-
构建 ToolItem → ShareData 转换
-
替换 Toast 提示为真实分享
Task 15: 工具版本管理 (#7)
Files:
-
Modify:
lib/features/discover/models/tool_item.dart -
Modify:
lib/features/discover/presentation/widgets/tool/tool_grid_item.dart -
Modify:
lib/features/discover/presentation/widgets/tool/tool_panel_sections.dart -
ToolItem 添加 version/changelog/updatedAt 字段
-
isNew 角标逻辑优化(基于版本更新时间)
-
工具详情弹窗显示版本号和更新日志