Files
ballet-server/.scratch/project-icons/spec.md
T
yuxuanhui b0c62d461e feat: add project icon picker component and integrate with project management
- Implemented ProjectIconPicker component for selecting project icons.
- Created ProjectIcon component to display selected icons.
- Updated calendar page to remove unused PageHeading component.
- Modified growth page to enhance UI and improve text clarity.
- Refactored index page to include project icons and improve layout.
- Added mine page for user profile management with avatar selection.
- Introduced projects-sort page for managing project order with drag-and-drop functionality.
- Enhanced projects page to allow icon selection when adding or editing projects.
- Updated record page to streamline user experience and improve form actions.
- Adjusted practice service to support project icon management.
- Added tests for project saving functionality to ensure correct handling of icons.
- Updated global type definitions to support SVG and PNG imports.
2026-09-29 18:40:25 +08:00

31 lines
2.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 项目图标接入
Type: task
Status: resolved
## Scope
将已确认的 18 个项目图标接入小程序。首页和项目管理保留紧凑单列卡片;添加、编辑项目时从专业动作、基础练习、物件三类选择,也可不使用图标。图标随项目保存到现有 PostgreSQL,沿用身份隔离、归档和刷新规则。
## Implementation
- 保留 `docs/design/project-icons/` 下的 SVG 原稿,小程序使用同图案的透明 PNG,随包提供,不依赖外部图片服务。
- 新增可选请求字段 `iconId`;空字符串取消,旧客户端省略时保留已有选择。服务端仅接受已提供的 18 个标识。
- 新增版本迁移;为已有同名预置项目一次性配置对应图标,其他项目保持无图标。重新登录不重置用户选择。
- 项目管理的“改名”改为“编辑”,名称与图标一次保存。选择面板关闭不提交;保存失败保留表单。
- 不更改记录统计、身份方式或发布配置。
## Validation
验证新增、改名保留图标、更换、取消、未知标识拒绝、跨账号隔离、重新读取及旧数据库迁移;执行小程序 typecheck/client/build 与后端 vet/race/build、隔离 PostgreSQL 集成测试。平台运行与静态构建分别记录。
## Result
2026-09-29 完成本地接入,未发布或提交。
- `pnpm typecheck`、`pnpm test:client`(4 项)、`pnpm build` 通过。18 张 384 × 384 透明 PNG 共约 167 KiB,均进入小程序构建产物,保留 SVG 原稿。
- `go vet ./...`、`./scripts/test-integration.sh`(真实隔离 PostgreSQL 下执行 `go test -race ./...`)、`go build -o bin/api ./cmd/server` 通过。新增测试覆盖全部 18 个标识、旧客户端省略字段、取消、归档、未知值拒绝、用户隔离、服务重建读取、迁移重复执行和旧结构升级后历史保留。
- 微信开发者工具连接本机真实后端,7 项交互验证通过:默认图标与紧凑卡片、6/8/4 分类切换和试选、新增并持久化、重进首页恢复、更换、取消编辑不写入、取消图标后无占位。未捕获未处理异常;只新增和清理本次唯一标记的临时项目,未变更既有项目选择或练习记录。
- 本机后端已更新并执行迁移;默认项目图标正常读取。只读代理 `/root/project_icon_review` 已完成,未发现具体可行动缺陷。`git diff --check` 通过。
- 已目视检查首页、项目管理与选择面板的模拟器截图。真机、其他屏幕宽度和原生键盘交互未在本轮验证。