Fix correctness, performance, privacy and content issues found in review - #8
Merged
Merged
Conversation
Correctness - Refuse a phrasebook template unless it covers ~all of the input. Substring matching silently replaced a long classroom sentence with a short template and dropped the rest of what the child typed. - Show where the English came from (stored phrase / translation / word pile). The "local-words" fallback is now labelled as not being a sentence, and is excluded from sentence speech and from cloze practice. - Bound Chrome's built-in Translator with a timeout and an availability check. A pending model download used to hang the whole analysis with no fallback. - Look wordbook cards up by word when reading aloud. Due-word order differs from render order, so the highlight tracked the wrong card. - Defer revoking the export blob URL; revoking in the same tick cancels the download on Safari and iOS. - Wire the phrase lexicon into the runtime. findPhraseMatches/getPhraseMeaning were unreachable, so "show your work" was always split into single words. - Quiz: reset the round on entry, cancel pending advance timers on navigation, and de-duplicate options by the label the child actually reads. - Count "不确定" as its own outcome instead of folding it into `wrong`. - Mission: say that practice words are added to the wordbook, and let words whose meaning only arrives from the network still enter the mission. Performance - Cache the normalized wordbook. Every word card asked whether it was starred, costing dozens of parse-and-normalize passes per sentence. - Only run the full reverse-dictionary scan after translation actually fails. - Patch the wordbook list in place on a review tap instead of rebuilding it, which threw away focus and scroll position. - Split the runtime lexicon into an eager head (596 KB) and a deferred long tail (585 KB), cached after activation rather than during install. - Bound OCR compression to 5 predicted attempts instead of up to 36 encodes. Privacy and security - Route translation through a same-origin /api/translate backed by Workers AI, replacing the browser's direct call to an unauthorized Google endpoint. - Add an offline-only mode that stops every optional network call, with the UI no longer offering what it has been told not to do. - Drop 'unsafe-inline' from the CSP; inline script hashes are generated at build time and audit:seo fails if it returns. - Name upstream licences on the sources page and disclose the OCR client id. Accessibility and content - Implement roving tabindex and arrow/Home/End navigation for the tab bar. - Add a dark theme; align theme-color, manifest id/lang/maskable icon. - Stop speaking on page entry; focus the play button instead. - Render the authored steps, keywords and sample replies on the phrases page, which were generated into the phrasebook and never shown to anyone. - Reword the OCR "misrecognized" panel, which asserted an error that may not exist, and the stop-word explanation. Repository - Remove the dead Pages deployment path, _routes.json, unused image assets, the retired legacy lexicon, and personal documents from the public repo. - Move the shared worker code under worker/ and make the worker test pool hermetic; split the dependency audit out of the release gate. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
VeteranXYZ
added a commit
that referenced
this pull request
Sep 3, 2026
Fix correctness, performance, privacy and content issues found in review
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
Verification