docs(plan): 勾选已完成步骤(余真机手测)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
link2026
2026-06-10 06:53:25 +08:00
parent 7e8e692695
commit 0a824610cf

View File

@@ -22,7 +22,7 @@
**Files:** 无(纯 git) **Files:** 无(纯 git)
- [ ] **Step 1: 从当前分支建 `feat/voice-diary`** - [x] **Step 1: 从当前分支建 `feat/voice-diary`**
```bash ```bash
cd /Users/xuhuayong/apps/康康 cd /Users/xuhuayong/apps/康康
@@ -40,7 +40,7 @@ Expected: `Switched to a new branch 'feat/voice-diary'`(`Localizable.xcstrings`
pbxproj 的 `INFOPLIST_KEY_*` 按字母序排列:Microphone 插在 `NSHealthUpdateUsageDescription` 之后,SpeechRecognition 插在 `NSPhotoLibraryUsageDescription` 之后。每个锚点行在文件中出现 **2 次**(Debug/Release),用 replace_all 一次改两处。 pbxproj 的 `INFOPLIST_KEY_*` 按字母序排列:Microphone 插在 `NSHealthUpdateUsageDescription` 之后,SpeechRecognition 插在 `NSPhotoLibraryUsageDescription` 之后。每个锚点行在文件中出现 **2 次**(Debug/Release),用 replace_all 一次改两处。
- [ ] **Step 1: 插入 NSMicrophoneUsageDescription(replace_all)** - [x] **Step 1: 插入 NSMicrophoneUsageDescription(replace_all)**
用 Edit 工具,`replace_all: true`: 用 Edit 工具,`replace_all: true`:
@@ -55,7 +55,7 @@ new_string:
INFOPLIST_KEY_NSMicrophoneUsageDescription = "康康需要使用麦克风进行语音记录,识别全程在本机完成,声音不会上传。"; INFOPLIST_KEY_NSMicrophoneUsageDescription = "康康需要使用麦克风进行语音记录,识别全程在本机完成,声音不会上传。";
``` ```
- [ ] **Step 2: 插入 NSSpeechRecognitionUsageDescription(replace_all)** - [x] **Step 2: 插入 NSSpeechRecognitionUsageDescription(replace_all)**
old_string: old_string:
``` ```
@@ -68,7 +68,7 @@ new_string:
INFOPLIST_KEY_NSSpeechRecognitionUsageDescription = "语音转文字使用 iOS 端侧识别,内容不会发送给 Apple 或任何服务器。"; INFOPLIST_KEY_NSSpeechRecognitionUsageDescription = "语音转文字使用 iOS 端侧识别,内容不会发送给 Apple 或任何服务器。";
``` ```
- [ ] **Step 3: 验证两个键各出现 2 次** - [x] **Step 3: 验证两个键各出现 2 次**
```bash ```bash
grep -c "NSMicrophoneUsageDescription\|NSSpeechRecognitionUsageDescription" 康康.xcodeproj/project.pbxproj grep -c "NSMicrophoneUsageDescription\|NSSpeechRecognitionUsageDescription" 康康.xcodeproj/project.pbxproj
@@ -76,7 +76,7 @@ grep -c "NSMicrophoneUsageDescription\|NSSpeechRecognitionUsageDescription" 康
Expected: `4` Expected: `4`
- [ ] **Step 4: Commit** - [x] **Step 4: Commit**
```bash ```bash
git add 康康.xcodeproj/project.pbxproj git add 康康.xcodeproj/project.pbxproj
@@ -91,7 +91,7 @@ git commit -m "feat(语音日记): 新增麦克风与语音识别权限描述(
- Test: `康康Tests/DiaryOrganizePromptTests.swift`(新建) - Test: `康康Tests/DiaryOrganizePromptTests.swift`(新建)
- Modify: `康康/AI/Prompts/DiaryAssistPrompts.swift`(文件末尾 `}` 前加方法) - Modify: `康康/AI/Prompts/DiaryAssistPrompts.swift`(文件末尾 `}` 前加方法)
- [ ] **Step 1: 写失败测试** - [x] **Step 1: 写失败测试**
新建 `康康Tests/DiaryOrganizePromptTests.swift`: 新建 `康康Tests/DiaryOrganizePromptTests.swift`:
@@ -126,7 +126,7 @@ struct DiaryOrganizePromptTests {
} }
``` ```
- [ ] **Step 2: 跑测试确认编译失败(方法还不存在)** - [x] **Step 2: 跑测试确认编译失败(方法还不存在)**
```bash ```bash
cd /Users/xuhuayong/apps/康康 cd /Users/xuhuayong/apps/康康
@@ -139,7 +139,7 @@ xcodebuild test -project 康康.xcodeproj -scheme 康康 \
Expected: 编译错误 `type 'DiaryAssistPrompts' has no member 'organize'`(TEST FAILED)。 Expected: 编译错误 `type 'DiaryAssistPrompts' has no member 'organize'`(TEST FAILED)。
- [ ] **Step 3: 实现 organize prompt** - [x] **Step 3: 实现 organize prompt**
`康康/AI/Prompts/DiaryAssistPrompts.swift` 的 enum 末尾(`suggest` 方法后、收尾 `}` 前)加: `康康/AI/Prompts/DiaryAssistPrompts.swift` 的 enum 末尾(`suggest` 方法后、收尾 `}` 前)加:
@@ -185,11 +185,11 @@ Expected: 编译错误 `type 'DiaryAssistPrompts' has no member 'organize'`(TEST
} }
``` ```
- [ ] **Step 4: 跑测试确认通过** - [x] **Step 4: 跑测试确认通过**
同 Step 2 命令。Expected: `** TEST SUCCEEDED **`,2 个用例通过。 同 Step 2 命令。Expected: `** TEST SUCCEEDED **`,2 个用例通过。
- [ ] **Step 5: Commit** - [x] **Step 5: Commit**
```bash ```bash
git add 康康Tests/DiaryOrganizePromptTests.swift 康康/AI/Prompts/DiaryAssistPrompts.swift git add 康康Tests/DiaryOrganizePromptTests.swift 康康/AI/Prompts/DiaryAssistPrompts.swift
@@ -205,7 +205,7 @@ git commit -m "feat(语音日记): organize prompt(自适应样式 + 数值不
无新单测(纯转发 AIRuntime,LLM 行为靠真机手测;解析逻辑只有 strip + trim,复用已测过的 `stripThinkBlocks`)。 无新单测(纯转发 AIRuntime,LLM 行为靠真机手测;解析逻辑只有 strip + trim,复用已测过的 `stripThinkBlocks`)。
- [ ] **Step 1: 加 organize 方法** - [x] **Step 1: 加 organize 方法**
`suggest` 方法的收尾 `}` 之后、struct 收尾 `}` 之前加: `suggest` 方法的收尾 `}` 之后、struct 收尾 `}` 之前加:
@@ -236,7 +236,7 @@ git commit -m "feat(语音日记): organize prompt(自适应样式 + 数值不
} }
``` ```
- [ ] **Step 2: 编译验证** - [x] **Step 2: 编译验证**
```bash ```bash
cd /Users/xuhuayong/apps/康康 cd /Users/xuhuayong/apps/康康
@@ -249,7 +249,7 @@ xcodebuild -project 康康.xcodeproj -scheme 康康 \
Expected: `BUILD SUCCEEDED`,无新增 warning。 Expected: `BUILD SUCCEEDED`,无新增 warning。
- [ ] **Step 3: Commit** - [x] **Step 3: Commit**
```bash ```bash
git add 康康/Services/DiaryAssistService.swift git add 康康/Services/DiaryAssistService.swift
@@ -265,7 +265,7 @@ git commit -m "feat(语音日记): DiaryAssistService.organize 转写稿整理"
硬件绑定,无单测;模拟器路径(`isAvailable == false`)与真机路径在 Task 7 手测。 硬件绑定,无单测;模拟器路径(`isAvailable == false`)与真机路径在 Task 7 手测。
- [ ] **Step 1: 新建 SpeechDictationService.swift** - [x] **Step 1: 新建 SpeechDictationService.swift**
```swift ```swift
import Foundation import Foundation
@@ -421,11 +421,11 @@ final class SpeechDictationService {
} }
``` ```
- [ ] **Step 2: 编译验证** - [x] **Step 2: 编译验证**
同 Task 3 Step 2 命令。Expected: `BUILD SUCCEEDED`。若出现 actor 隔离 warning(标注 error in Swift 6 language mode 的不阻塞),按提示把回调内对 self 的访问收进 `Task { @MainActor in }`,不许用 `nonisolated(unsafe)` 糊。 同 Task 3 Step 2 命令。Expected: `BUILD SUCCEEDED`。若出现 actor 隔离 warning(标注 error in Swift 6 language mode 的不阻塞),按提示把回调内对 self 的访问收进 `Task { @MainActor in }`,不许用 `nonisolated(unsafe)` 糊。
- [ ] **Step 3: Commit** - [x] **Step 3: Commit**
```bash ```bash
git add 康康/Services/SpeechDictationService.swift git add 康康/Services/SpeechDictationService.swift
@@ -441,7 +441,7 @@ git commit -m "feat(语音日记): SpeechDictationService 端侧流式转写(不
纯展示组件,状态全部外部传入,DiaryQuickSheet(已 600+ 行)不再膨胀。 纯展示组件,状态全部外部传入,DiaryQuickSheet(已 600+ 行)不再膨胀。
- [ ] **Step 1: 新建 DiaryVoicePanel.swift** - [x] **Step 1: 新建 DiaryVoicePanel.swift**
```swift ```swift
import SwiftUI import SwiftUI
@@ -587,11 +587,11 @@ struct DiaryVoicePanel: View {
} }
``` ```
- [ ] **Step 2: 编译验证** - [x] **Step 2: 编译验证**
同 Task 3 Step 2 命令。Expected: `BUILD SUCCEEDED` 同 Task 3 Step 2 命令。Expected: `BUILD SUCCEEDED`
- [ ] **Step 3: Commit** - [x] **Step 3: Commit**
```bash ```bash
git add 康康/Features/Diary/DiaryVoicePanel.swift git add 康康/Features/Diary/DiaryVoicePanel.swift
@@ -607,7 +607,7 @@ git commit -m "feat(语音日记): DiaryVoicePanel 录音/整理面板"
改 5 处:① 状态 + 录音流程函数;② 「内容」标签行加 mic 按钮;③ 输入框下方挂面板 / 提示条 / 回退 pill;④ `canRequestSuggest` 把 organizing 排除;⑤ onDisappear 清理。 改 5 处:① 状态 + 录音流程函数;② 「内容」标签行加 mic 按钮;③ 输入框下方挂面板 / 提示条 / 回退 pill;④ `canRequestSuggest` 把 organizing 排除;⑤ onDisappear 清理。
- [ ] **Step 1: 加语音状态(`@FocusState` 行之后、`hasContent` 之前)** - [x] **Step 1: 加语音状态(`@FocusState` 行之后、`hasContent` 之前)**
`DiaryQuickSheet.swift:38`(`@FocusState private var contentFocused: Bool`)之后插入: `DiaryQuickSheet.swift:38`(`@FocusState private var contentFocused: Bool`)之后插入:
@@ -632,7 +632,7 @@ git commit -m "feat(语音日记): DiaryVoicePanel 录音/整理面板"
private let dictation = SpeechDictationService() private let dictation = SpeechDictationService()
``` ```
- [ ] **Step 2: 「内容」标签行加 mic 按钮** - [x] **Step 2: 「内容」标签行加 mic 按钮**
把(`DiaryQuickSheet.swift:79-80` 附近): 把(`DiaryQuickSheet.swift:79-80` 附近):
@@ -672,7 +672,7 @@ git commit -m "feat(语音日记): DiaryVoicePanel 录音/整理面板"
(`TextField` 那段不动,仍在该 VStack 内。) (`TextField` 那段不动,仍在该 VStack 内。)
- [ ] **Step 3: 输入框下方挂面板 / 提示条 / 回退 pill** - [x] **Step 3: 输入框下方挂面板 / 提示条 / 回退 pill**
在 TextField 的 `.overlay(...)` 闭合后、该 VStack 的收尾 `}` 之前(即原 `DiaryQuickSheet.swift:95` `)``:96` `}` 之间)插入: 在 TextField 的 `.overlay(...)` 闭合后、该 VStack 的收尾 `}` 之前(即原 `DiaryQuickSheet.swift:95` `)``:96` `}` 之间)插入:
@@ -721,7 +721,7 @@ git commit -m "feat(语音日记): DiaryVoicePanel 录音/整理面板"
} }
``` ```
- [ ] **Step 4: organizing 期间禁用「AI 追问」+ 关 sheet 清理 + 权限 alert** - [x] **Step 4: organizing 期间禁用「AI 追问」+ 关 sheet 清理 + 权限 alert**
`DiaryQuickSheet.swift:48`: `DiaryQuickSheet.swift:48`:
@@ -762,7 +762,7 @@ git commit -m "feat(语音日记): DiaryVoicePanel 录音/整理面板"
} }
``` ```
- [ ] **Step 5: 加流程函数(`// MARK: - Actions` 区,`requestSuggestions` 之前)** - [x] **Step 5: 加流程函数(`// MARK: - Actions` 区,`requestSuggestions` 之前)**
`DiaryQuickSheet.swift``sectionLabel` 函数后插入: `DiaryQuickSheet.swift``sectionLabel` 函数后插入:
@@ -858,7 +858,7 @@ git commit -m "feat(语音日记): DiaryVoicePanel 录音/整理面板"
} }
``` ```
- [ ] **Step 6: 编译验证(touch 强制重编拿全量警告)** - [x] **Step 6: 编译验证(touch 强制重编拿全量警告)**
```bash ```bash
cd /Users/xuhuayong/apps/康康 cd /Users/xuhuayong/apps/康康
@@ -872,7 +872,7 @@ xcodebuild -project 康康.xcodeproj -scheme 康康 \
Expected: `BUILD SUCCEEDED`,无新增 warning。 Expected: `BUILD SUCCEEDED`,无新增 warning。
- [ ] **Step 7: 跑全量单测(确认没碰坏别的)** - [x] **Step 7: 跑全量单测(确认没碰坏别的)**
```bash ```bash
xcodebuild test -project 康康.xcodeproj -scheme 康康 \ xcodebuild test -project 康康.xcodeproj -scheme 康康 \
@@ -882,7 +882,7 @@ xcodebuild test -project 康康.xcodeproj -scheme 康康 \
Expected: `** TEST SUCCEEDED **` Expected: `** TEST SUCCEEDED **`
- [ ] **Step 8: Commit** - [x] **Step 8: Commit**
```bash ```bash
git add 康康/Features/Diary/DiaryQuickSheet.swift git add 康康/Features/Diary/DiaryQuickSheet.swift
@@ -895,7 +895,7 @@ git commit -m "feat(语音日记): DiaryQuickSheet 接入语音输入(录音→
**Files:** 无新增代码 **Files:** 无新增代码
- [ ] **Step 1: 模拟器降级路径验证** - [x] **Step 1: 模拟器降级路径验证**
模拟器跑 App(或 Xcode Preview `DiaryQuickSheet`),打开「+ 新建 → 写日记」: 模拟器跑 App(或 Xcode Preview `DiaryQuickSheet`),打开「+ 新建 → 写日记」:
- `SpeechDictationService.isAvailable` 在模拟器多半为 false → 「说一段」按钮应**整体不显示**,其余功能照旧。 - `SpeechDictationService.isAvailable` 在模拟器多半为 false → 「说一段」按钮应**整体不显示**,其余功能照旧。