Match custom vocabulary cards to lesson practice - #130
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a156597dc6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| audio = await get_audio( | ||
| target, |
There was a problem hiding this comment.
Make custom pronunciation artifacts erasable
When a learner practices a custom entry, get_audio writes an MP3 derived from the learner-supplied target into the persistent global DATA_DIR/audio_cache (tts.py:38-50). The cache key contains no user or entry handle, and erase_user_learning_data deletes only database rows, so /privacy can report successful deletion while audio conveying the personal vocabulary remains indefinitely and cannot be attributed for cleanup. Use nonpersistent rendering or an erasable per-user cache for custom terms.
AGENTS.md reference: AGENTS.md:L70-L74
Useful? React with 👍 / 👎.
| label = str(word.get("target") or "").strip() | ||
| if transcription: | ||
| label = f"{label} {transcription}" | ||
| return f"{flag} *{escape_markdown(label)}*" |
There was a problem hiding this comment.
Respect pack-specific transcription layout
For Japanese, Chinese, Russian, and Arabic custom entries with transcriptions, this always renders target transcription, although those packs declare transcription_position="before"; Arabic also needs the bidi isolation performed by _directional_text. The standard lesson renderer handles both rules in format_target_word, so these custom cards do not actually match lesson practice and mixed Arabic/transcription text can display in the wrong visual order.
Useful? React with 👍 / 👎.
What changed
Verification
python -m unittest tests.test_custom_vocabulary_v1(25 passed)python -m unittest tests.test_learning_blocks(45 passed)python -m unittest tests.test_voice_handlers(13 passed)python -m unittest discover -s tests(1049 passed, 3 skipped)python -m compileall -q bot.py tests/test_custom_vocabulary_v1.pygit diff --check