Sync conversation notes via Git Sync, add discard shortcut to crash-recovery prompt

Notes files now export to notes/ + notes.json alongside conversations.json,
matching folders.json's manifest pattern: matched by conversation ID, never
overwrites notes a machine already has locally, same empty-state orphan-
cleanup safety guard as the existing conversation/folder sync code. Also
adds Cmd+D to the "Discard" button on the crash-recovery restore prompt.

Fixes two Swift 6 actor-isolation build warnings surfaced along the way:
ConversationNotesService and the String filename-sanitizing extension are
pure, state-free helpers called from nonisolated contexts (DatabaseService,
GitSyncService) but defaulted to @MainActor — marked nonisolated.
This commit is contained in:
2026-08-04 08:31:16 +02:00
parent 3414e37e24
commit d93c233453
7 changed files with 195 additions and 6 deletions
+14
View File
@@ -86,6 +86,20 @@ nonisolated struct FolderSyncManifest: Codable {
var assignments: [String: String]
}
/// Serialized as `notes.json` at the sync repo root, alongside a `notes/` directory holding the
/// raw note file content (same format as `~/Library/Application Support/oAI/notes/`, see
/// ConversationNotesService). Matching is by conversationId via this manifest, not by parsing the
/// embedded `**ID**:` header inside each note file same approach as `FolderSyncManifest`.
nonisolated struct NotesSyncManifest: Codable {
nonisolated struct Entry: Codable {
let filename: String
let enabled: Bool
}
/// conversationId -> notes entry. Only present for conversations that have ever had notes.
var notes: [String: Entry]
}
nonisolated struct ConversationExport {
let id: String
let name: String