feat(tutor): viewport-centred lesson grounding + quiz/summarize chips#204
Merged
Conversation
Item 4a of the learning-companion deepening:
- getPageContext now grounds the tutor in what the user is ACTUALLY reading.
Long lessons used to send only the first 2,000 chars, so questions about
anything past the fold had no grounding. The context now carries a short
lesson opening (global context) + the text from the block currently in the
viewport, and the heading map (up to 8) marks the current section with "▶".
Hard-capped at 2,000 chars total — the privacy policy's "≤2,000 chars of
lesson context" disclosure holds regardless of how the pieces combine.
Exam-page behavior unchanged.
- Two new suggestion chips in all 12 UI languages: "Quiz me on this lesson"
and "Summarize this lesson" — the two highest-value learning actions the
grounded tutor can serve ("key takeaways" chip kept; the redundant third
example rotated out to keep the chip row tight).
Gates: 527 unit tests, full E2E 19/19, lint, prettier — green.
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.
Item 4a of the learning-companion deepening ("번역기 → AI 코스 학습 동반자").
Viewport-centred grounding
getPageContextused to send the first 2,000 chars of the lesson — questions about anything past the fold had no grounding. Now it sends a short lesson opening (global context) + the text from the block the user is currently viewing, and the heading map marks the current section with▶. Hard-capped at 2,000 chars total, so the privacy policy's "≤2,000 chars of lesson context" disclosure keeps holding. Exam-page behavior unchanged.New chips (12 UI languages)
"Quiz me on this lesson" and "Summarize this lesson" — the two highest-value actions a lesson-grounded tutor can serve. (Kept "key takeaways", rotated out the redundant third example to keep the row tight.)
Gates: 527 unit · full E2E 19/19 · lint · prettier — green.
🤖 Generated with Claude Code