Repository navigation
feat: include file transcriptions in backups - #1325
Draft
tarushvkodes wants to merge 1 commit into
Draft
tarushvkodes wants to merge 1 commit into
tarushvkodes wants to merge 1 commit into
Conversation
Backup export now writes File Transcription history (text, speaker segments, gaps, notices, custom titles) as an optional fileTranscriptionHistory array, and import restores it after dictation history inside the same restore lease. Backups without the key keep the current file transcripts; an explicit empty array clears them. Restored entries bump searchRevision past both the backup's and the indexed revision so search re-indexes changed text. That rule now lives in SearchIndexRecord.revisionAfterRestore and is shared with dictation history. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The PR Policy check is blocking this PR because required template information is missing. Please update the PR description with:
Visual files detected:
Screenshots or video are required for UI, UX, settings, onboarding, overlay, menu bar, or visual behavior changes. If this PR has no visual changes, check the no-visual-change box in the template. If this remains incomplete for 48 hours after opening, the PR may be closed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Settings → Backup & Restore now exports and imports File Transcription history: transcripts, speaker segments, gaps, notices and custom titles. Until now those transcripts lived only in
UserDefaultsand a backup left them out.Changes
AppBackupDocumentgainsfileTranscriptionHistory: [FileTranscriptionEntry]?. It encodes with the entry's existingCodableshape, the same one the store already persists.BackupService.makeBackupDocument()fills it from the newFileTranscriptionHistoryStore.makeBackupPayload().restore(_:)applies it right after dictation history, inside the same restore lease and beforesettingsBackupDidRestoreposts.FileTranscriptionHistoryStore.restore(from:)replaces the list, sorts it newest first, keeps the store's 50-entry cap, selects the newest entry and persists.searchRevisiongoes up. Restore bumps each entry past its backup revision, its currently indexed revision and the wall clock, using the same rule as dictation history. That rule moved fromTranscriptionHistoryEntry.markRestoredintoSearchIndexRecord.revisionAfterRestoreso both stores share it.Compatibility
fileTranscriptionHistorykey. They decode tonil, and restoring one leaves the current file transcripts alone, like the other fields the document added later.Type of Change
Related Issue or Discussion
Closes #1323
Testing
New
SettingsBackupRoundTripTests.testFileTranscriptionsRoundTripThroughBackupAndRestoreIntoStoreuses the real types:BackupService.encodeand thendecodeunchanged.fileTranscriptionHistoryisnil.FileTranscriptionHistoryStore(defaults:)on a temporary suite restores the entry. Its revision goes past a previously indexed revision, and a fresh store on the same suite reads it back.Tests/run_settings_backup_concurrency_tests.py(the CIsettings-backupcheck) gains stubs and assertions:Results:
The harness run against
main'sBackupService.swift(--ref main) fails at the new assertion, so the assertion tests this change:swiftlint --strict --config .swiftlint.ymlon the changed files, 0 violationsmainflags too. Nothing on the changed lines.Not done: a manual export and import in the running app, the full CI sequence (
Tests/run_ci_checks.sh), and Intel.Screenshots / Video
The test output above is the evidence. The change has no visible UI.
Notes
A backup now carries the full text of up to 50 file transcripts, so it can get noticeably larger. In one local install the stored file history was about 1.7 MB.
AI use: Claude Code drafted the change, the tests and this description.
A human created this PR or reviewed and approved it before submission, understands the full diff, and takes responsibility for the change.
🤖 Generated with Claude Code