feat(history): batch delete for recognition history + test alignment#121
Open
MangoWAY wants to merge 1 commit intojoewongjc:mainfrom
Open
feat(history): batch delete for recognition history + test alignment#121MangoWAY wants to merge 1 commit intojoewongjc:mainfrom
MangoWAY wants to merge 1 commit intojoewongjc:mainfrom
Conversation
- Add HistoryStore.delete(ids:) transactional batch delete - HistoryTab: selection mode, select/deselect all, confirmation alert - Extract HistorySelectionHelpers + unit tests - Align XCTest with AssemblyAI, Soniox, Volc, AppState, ModeStorage Made-with: Cursor
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.
Summary
This PR adds batch delete for Settings → History (recognition history), refactors selection logic into a small testable helper, extends
HistoryStorewith a transactional multi-row delete, and aligns several XCTest suites with the current production behavior (AssemblyAI, Soniox, Volcano, AppState, ModeStorage).Features (user-visible)
Batch delete in History tab
Data layer
HistoryStore.delete(ids: [String]): runs in a single SQLite transaction, deletes in chunks of up to 500 IDs (SQLite variable limit), postshistoryStoreDidChangeonce on success.Testability
HistorySelectionHelpers: pure functions for “all filtered selected?” and toggle select-all / deselect-all; covered byHistorySelectionHelpersTests.HistoryStoreTests: batch delete, empty-ID no-op, notification expectation;HistoryRecordinitializers updated withasrProvider: nilwhere needed.Test suite fixes (why they changed)
These are not behavioral changes to those subsystems in this PR; tests were outdated vs current code:
finalizeonly runs whenbarPhase == .processing; test sets phase before calling.UpdateConfigurationafter connect; URL tests assert absence ofkeyterms_promptand validateupdateConfigurationMessage.contextis only{ "terms": [...] }(nogeneralblock).boostingTableIDis set, inline hotwordscontextis omitted (table wins); split expectations + new test for hotwords-only.processingLabelto the current default; assertion compares toProcessingMode.formalWriting.processingLabel.Risks & limitations
historyStoreDidChangetriggers a full reload of the first page; acceptable and consistent with single-row delete.How to verify
swift build -c release swift testManually: Settings → History → Select → select rows → Delete → confirm.
Checklist
swift build -c release)swift test)L(zh, en)pattern where applicable