feat: edit a transcript in the Notitie editor, delete button per transcript

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-02 11:19:24 +02:00
co-authored by Claude Sonnet 5.5
parent 951e23ba22
commit b225718fb1
7 changed files with 101 additions and 10 deletions
+21
View File
@@ -146,3 +146,24 @@ struct HistoryGroupingTests {
#expect(days[0].day > days[1].day)
}
}
@MainActor
struct HistoryEditTests {
@Test func updateTextReplacesFinalTextAndDropsCorrections() {
let store = HistoryStore(fileURL: FileManager.default.temporaryDirectory.appending(path: "sst-tests-\(UUID().uuidString)/history.json"))
let item = HistoryEntry(
date: Date(), duration: 2, rawText: "cloud code", finalText: "Claude Code",
corrections: [AppliedCorrection(heard: "cloud code", wrote: "Claude Code", rule: "cloud code", start: 0, length: 11)])
store.add(item)
store.updateText(id: item.id, to: "Claude Code is fijn")
#expect(store.entries[0].finalText == "Claude Code is fijn")
#expect(store.entries[0].rawText == "cloud code")
#expect(store.entries[0].corrections.isEmpty)
}
@Test func updateTextOfUnknownIdIsHarmless() {
let store = HistoryStore(fileURL: FileManager.default.temporaryDirectory.appending(path: "sst-tests-\(UUID().uuidString)/history.json"))
store.updateText(id: UUID(), to: "x")
#expect(store.entries.isEmpty)
}
}