Conversation
Read the new chunk-aware translation shape and add a fill-in-the-blank review card at Leitner level 3+, with recognition fallback. - Stop reading linguistic_data.examples[] / phonetic.ipa (gone after the save-schema overhaul); show phrase.translation plus per-chunk definitions on the card back, matching what the save modal displays. Same fix applied to the bundle PhraseCard list. - L3+ cloze: blank every confirmed chunk found in the source sentence; per-blank Check with green/red feedback, repeatable Recheck, and a Clear-wrong action to retry. Falls back to the recognition card when there is no chunk or the level is 1-2. - Wire chunks / Leitner level / source sentence through the review session; read boxLevel from the Mongoose _doc fallback and pick chunks that actually appear in the sentence. - Stable layout: fixed card height with internal scroll, and the cloze front is split into a flex-grow content area + a fixed-height action area so checking never shifts the sentence. - Expose the Chunk type to the frontend. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Refactor the monolithic flashcard into composables + per-mode pieces and give every card type one consistent flip control. - Extract useCardFlip (flip state + reset) and useClozeBlanks (pure buildClozeData + reactive cloze state: answers, snapshot check results, check/clear) into composables. - Move the L3+ cloze UI into widget/flashcard/ClozeCard.vue; FlashCard now just resolves the mode and renders the right piece. - Add widget/flashcard/FlashcardFlipToggle.vue: a single Question/Answer toggle shown on every card type that indicates the current side and is the one consistent way to flip (plus Space). Drops the inconsistent body-click-to-flip (recognition flipped on any tap, cloze front didn't). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Finish the modularization: FlashCard becomes a thin dispatcher and the recognition presentation moves out, so each mode is its own piece. - Extract widget/flashcard/RecognitionCard.vue (normal + linguistic). - FlashCard now derives front/back/context/chunks/etc. from a single :phrase prop (+ :leitner-level), resolves cloze-vs-recognition, and renders the right child under the shared flip toggle. Drops the dead unknown-type fallback branch. - Collapse callers: LeitnerReviewSession and flashcards-[id] go from three per-type <WidgetFlashCard> blocks to one `:phrase`/`:leitner-level`, removing the cardChunk/cardSentence/isNormalType/isLinguisticType plumbing. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- buildClozeData: empty/no-chunk/no-match cases, single + multi blank,
overlap handling, case-insensitive matching.
- FlashcardFlipToggle, RecognitionCard, ClozeCard, and the FlashCard
dispatcher (cloze vs recognition selection, no-match fallback).
Per-file `vi.mock('vue', actual)` restores real Vue reactivity, which the
global test setup otherwise stubs out.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Document the Conventional Commits -> semver bump mapping so commit and PR titles move the intended version part. Mirrors the convention already enforced by semantic-release in the sibling subturtle-extension-apps repo. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
Author
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.
🏷️ PR Title: feat(flashcard): modularize card modes, unify flip toggle, and add new translation shape with L3+ fill-in cloze
📋 Summary
This PR introduces several improvements to the flashcard component, including modularization of card modes, a unified flip toggle mechanism, and a new translation shape supporting level 3 and above fill-in cloze interactions. It also refactors the dispatcher to use the :phrase API and extracts card components for better maintainability. Additionally, comprehensive unit tests for cloze logic and card components have been added. Documentation is updated to include semver commit title conventions.
🔗 Related Tasks
📝 Additional Details
These changes improve code modularity and test coverage, enabling easier future enhancements and better user interaction with flashcards. The new translation shape enhances learning flexibility, particularly for advanced cloze exercises.
📜 Commit List