feat(mobile, desktop): add dictionary lookup feature (featuring English and Chinese offline dictionaries) - #767
Open
Decidetto wants to merge 3 commits into
Conversation
Decidetto
marked this pull request as ready for review
September 6, 2026 12:02
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.
Add selection-based offline definitions and dictionary management on mobile and desktop. Currently supports optional English WordNet and Chinese Wiktionary SQLite packs. Select text and choose Define to see definitions in a popup. Dictionary settings support installation, updates, repair, removal, and source attribution.
Share lookup, pack validation, recovery, and state management across platforms. Desktop downloads stream directly to disk in native code, with limited progress updates and a separate verification phase. Dictionary downloads, About, Sync, and chapter translation reuse a styled progress bar. Desktop settings and action icons match the existing app UI.
The binary packs are currently available in the dictionary-packs-v1 release: English WordNet pack and Chinese Wiktionary pack. Maintainers can migrate these assets and update the manifest URLs while retaining the verified hashes. Manifest updates target the official repository, with a bundled fallback. Source/build configuration supports EXPO_PUBLIC_DICTIONARY_MANIFEST_URL on mobile and VITE_DICTIONARY_MANIFEST_URL on desktop. Reproducible pack-building and conversion tools are included.
Planned follow-up: an explicit "Look up online" button when no offline definition is found, opening a language-appropriate dictionary in the browser. This remains outside this PR's scope.
Validation: 13 desktop dictionary tests, 115 mobile tests, 619 core tests, and 4 native dictionary tests passed, along with desktop/mobile typechecks and a local Windows desktop build. The earlier pack-tool validation passed 17 CLI tests and its typecheck. The desktop preview was manually tested and approved. A same-machine comparison reduced the English pack transfer from 13.7 seconds to 1.6 seconds; verification remained about 0.6 seconds, with matching checksums. Existing dependency versions are unchanged.