Add dictionary auto-sort and batch import#29
Open
leoxs22 wants to merge 3 commits intoyomihon:mainfrom
Open
Conversation
Auto-sort reorders dictionaries by a recommended priority based on
well-known Yomitan dictionary names (frequency, pitch, monolingual,
bilingual, grammar, kanji — for JA, YUE, and ZH). Unrecognised
dictionaries keep their relative order at the end.
Batch import adds three modes behind the existing import button:
- Import Files: multi-file picker (OpenMultipleDocuments)
- Import from Folder: folder picker that enumerates ZIPs via SAF
- Nested ZIP auto-detection: if a ZIP has no index.json, inner .zip
entries are extracted and each is imported sequentially
Progress is tracked per-batch ("Importing 2 of 5") and failed or
duplicate dictionaries do not block the rest of the batch.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
WorkManager chains created by enqueueUniqueWork with APPEND_OR_REPLACE break when any Worker returns Result.failure() — all remaining Workers in the chain are cancelled. This caused nested ZIP imports to stop after the first duplicate/error. Fix by processing all items inline within a single Worker: - Nested ZIPs: extract all inner .zip files, import each in a loop - Multi-file/folder: pass all URIs via KEY_URIS to a single Worker - Per-dict errors are caught and logged without stopping the batch - Summary logged at completion (N imported, N skipped, N failed) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
OpenMultipleDocuments) to select several ZIPs at onceOpenDocumentTree) that enumerates and imports all ZIPs in a directoryindex.jsonbut contains inner.zipentries, each is extracted and imported automaticallyTest plan
./gradlew :domain:test— all tests pass (including 9 new DictionaryAutoSorterTest cases)🤖 Generated with Claude Code