001project_wildgrowth/ios/WildGrowth/COMPLETION_Y2K版_审查报告.md

73 lines
4.2 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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.

# CompletionView Y2K 版 — 审查报告(不应用)
**审查日期**2025-01-29
**范围**Y2K 风格完结页设计稿与附带的 Swift 代码
**结论**:仅审查、不修改仓库;以下为兼容性与逻辑核对结果。
---
## 1. 接口与调用方兼容性
| 项目 | 当前仓库 | Y2K 提案 | 结论 |
|------|----------|----------|------|
| **CompletionView 初始化参数** | `courseId: String`, `courseTitle: String?`, `navigationPath: Binding<NavigationPath>?` | 与提案一致3 个参数,同名同类型) | ✅ 兼容 |
| **VerticalScreenPlayerView 调用** | `CompletionView(courseId:, courseTitle:, navigationPath:)` | 无需修改 | ✅ 可直接编译 |
| **GrowthView / 其他 navigationDestination** | 若存在 `.completion` 且传上述 3 参数 | 无需修改 | ✅ 无影响 |
替换为 Y2K 版后,仅需整文件替换 `CompletionView.swift`**无需改任何调用处**。
---
## 2. 数据与依赖一致性
| 项目 | 当前实现 | Y2K 提案 | 结论 |
|------|----------|----------|------|
| **UserManager** | `UserManager.shared``studyStats.(time, lessons)` | 相同 | ✅ |
| **导航** | `navStore.switchToGrowthTab()` + `navigationPath?.wrappedValue = NavigationPath()``dismiss()` | 与提案一致 | ✅ |
| **持久化 key** | `has_revealed_course_\(courseId)` | `has_y2k_booted_\(courseId)` | ⚠️ 见下 |
- **持久化 key 不同**:若从当前「赛博拍立得」版直接切到 Y2K 版用户在本课程下会视为「未启动过」Y2K需再按一次 SYNC 才会显示结果。若希望换肤后「已显影过的课程仍为已显影」,可把 Y2K 的 `storageKey` 改为与现版一致(例如继续用 `has_revealed_course_\(courseId)`),否则保留 `has_y2k_booted_\(courseId)` 亦可,属产品选择。
---
## 3. 逻辑差异(游客与加载)
| 项目 | 当前实现 | Y2K 提案 | 建议 |
|------|----------|----------|------|
| **游客 (isGuest)** | 点击后不调 API直接显影并写持久化 | 仍执行 `Task.sleep` + `fetchUserProfile()`catch 后置 `isSystemOn = true` | 建议在 Y2K 的 `startUpload()` 内保留与现版一致的游客分支:若 `userManager.isGuest` 则直接设 `isSystemOn = true` 并写持久化,不调 `fetchUserProfile`,避免无谓请求与约 1.2s 延迟。 |
| **登录用户** | 拉取 `fetchUserProfile` 后显影 | 同1.2s 后拉取 + 显影) | ✅ 行为一致 |
若严格遵循「只换皮肤、逻辑不变」,建议在 Y2K 版中补上与现版相同的 `isGuest` 短路逻辑。
---
## 4. UI / 实现细节核对
- **Y2K 外壳与屏幕**:半透明渐变 + `strokeBorder` 高光 + `.ultraThinMaterial`、LCD 开/关色、果冻按钮与 SYNC DATA/进度态,均为纯视觉,无逻辑影响。
- **Y2KIdleView / Y2KResultView**:使用 `userManager.studyStats.lessons` / `time` 与当前数据源一致;字体与 XP 风格进度条仅为样式。
- **ForEach(0..<n)**提案中 `ForEach(0..<3)`、`ForEach(0..<5)`、`ForEach(0..<80)` 等以 `Range<Int>` 配合 `id: \.self` SwiftUI 中合法无需改
- **屏幕内布局**内屏 `overlay` 中再 `.padding(12)` 会形成双层内边距若希望与现版内边距一致可后续微调数值非阻塞
---
## 5. 影响范围(仅换 CompletionView 时)
- **仅替换** `Views/CompletionView.swift` Y2K 版时
- **VerticalScreenPlayerView**无需改动
- **MapView / MainTabView / GrowthView / ProfileView / DiscoveryView**无改动无影响
- 若采纳持久化 key 统一游客短路建议仅需在 Y2K 版单文件内修改不涉及其他页面
---
## 6. 总结
| 维度 | 结论 |
|------|------|
| **接口兼容** | 三参数一致调用方无需修改 |
| **数据与导航** | 与现版一致 |
| **持久化 key** | 与现版不同换肤后需再按一次 SYNC可按需统一 key |
| **游客逻辑** | 建议在 Y2K 版中保留与现版相同的 isGuest 短路实现只换皮肤 |
| **其他页面** | 无影响 |
**审查结论**Y2K 版可作为仅换皮肤的替换方案建议在应用前若采纳补上游客短路逻辑并按产品需求决定是否统一持久化 key。**本次未对仓库做任何修改。**