Feature/implement v2#18
Merged
Merged
Conversation
…anslation components
…ding tasks in overview
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Pull request overview
Implements “quiz card example sentence” support by reading an optional Example column from the user’s Google Sheet and rendering it under the revealed answer, while refactoring the Reader’s interactive translation surface into a reusable TranslatableText component so the quiz can reuse identical hover/touch + selection translation behavior.
Changes:
- Added
KnowledgeItem.exampleand wired Google Sheets reading of the optionalExamplecolumn (read-only). - Extracted
TranslatableText(tokenization +TranslatableWordwiring + selection popup) and refactored the Reader page to use it. - Updated the quiz UI to show the example sentence after reveal, with Reader-style translation interactions.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/modules/vocab-test/types.ts | Adds example: string | null to the quiz knowledge item model. |
| src/modules/vocab-test/components/QuizSession.tsx | Renders the example sentence under the revealed answer using TranslatableText. |
| src/modules/vocab-test/adapters/GoogleSheetsKnowledgeRepository.ts | Reads the optional Example column from the sheet into KnowledgeItem. |
| src/modules/reader/index.ts | Exports the new TranslatableText component from the reader module API. |
| src/modules/reader/components/TranslatableText.tsx | New reusable interactive-text component (tokenization + hover/touch + selection translation popup). |
| src/modules/reader/components/SelectionTranslationPopup.tsx | Adds configurable scopeSelector for selection scoping. |
| src/app/page.tsx | Refactors Reader view to render via TranslatableText and removes the page-level selection popup. |
| src/app/api/quiz/result/route.ts | Updates the server-side KnowledgeItem construction to include example: null. |
| .project/tasks/task-012_quiz-card-example.md | Documents the task/implementation plan and completion notes for the feature. |
| .project/overview.md | Updates project overview wording about pending tasks. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
43
to
45
| const lastRaw = String(row[lt] ?? '').trim(); | ||
| const exampleRaw = ex === undefined ? '' : String(row[ex] ?? '').trim(); | ||
| return { |
Comment on lines
+89
to
+94
| targetLang={targetLang} | ||
| translationMode={translationMode} | ||
| isInputMode={false} | ||
| scopeSelector="[data-translatable-text]" | ||
| onTranslated={(range) => onTranslatedRange?.(range)} | ||
| onSelectionTranslated={onWordTranslated} |
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.
No description provided.