feat(dashboard): local progress panel + fix the sub-panel modules stage-2b missed#205
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.
…ge-2b missed Item 4b of the learning-companion deepening, plus a real bug the work surfaced: - FIX: resume.js and text-selection.js still queried sidebar elements via document.getElementById — but the sidebar moved into the shadow root in stage 2b (#190), so the Recent panel had been silently dead (null panel → early return) and select-and-ask couldn't focus the chat input. Both now use sb.$id. (They were the two modules the 62-site migration missed; the E2E suite didn't cover the Recent panel, which is why it went unnoticed.) - NEW: "My progress" dashboard (Tools menu) — a sub-panel aggregating LOCAL data only: lessons visited (sb_recent), bookmarks (sb_bookmarks), flashcard decks + cards mastered (fc_* Leitner boxes, box>=3), and the three most recent lessons as jump-back links (http(s)-guarded). Reads exclusively from chrome.storage.local — nothing leaves the device, consistent with the privacy policy. Labels in all 12 UI languages; dark-mode styles included; all storage-derived values escaped via sb.escapeHtml. - Sub-panel state machine extended (dashboardPanelOpen) across closeSubPanel and the four sibling panels' guards. - E2E: new dashboard.spec.js (panel opens, localized header renders, four stat cards in zero-state) + toggleDashboardPanel/readDashboard ops. Gates: 527 unit tests, full E2E 20/20, lint, prettier — green.
heznpc
added a commit
that referenced
this pull request
Jun 10, 2026
…adow-rooted input wrap (#206) The stage-2b sweep-up in #205 fixed text-selection.js's chat-input lookup but missed the .si18n-chat-input-wrap lookup 17 lines above — document.querySelector returns null now that the sidebar lives in the shadow root, so the quoted-text bar silently never rendered. Found by the post-batch max-effort review; now uses sb.$() like its sibling. Gates: 527 unit, full E2E 20/20, lint, prettier green.
# Conflicts: # src/lib/constants.js
…NS + dashboard labels)
heznpc
added a commit
that referenced
this pull request
Jun 10, 2026
…om constants The #205 merge-conflict resolution silently ate the it: lines from EXAMPLE_QUESTIONS, MENU_LABELS.dashboard, and DASHBOARD_LABELS — the #1 install market would have shipped with English-fallback chips and dashboard labels. Caught by the pre-build ship-gate review (structural gates can't see this: sb.t falls back to en). Restored all three maps; verified 12 languages x 3 maps complete by evaluating the real constants module.
heznpc
added a commit
that referenced
this pull request
Jun 10, 2026
…om constants (#207) The #205 merge-conflict resolution silently ate the it: lines from EXAMPLE_QUESTIONS, MENU_LABELS.dashboard, and DASHBOARD_LABELS — the #1 install market would have shipped with English-fallback chips and dashboard labels. Caught by the pre-build ship-gate review (structural gates can't see this: sb.t falls back to en). Restored all three maps; verified 12 languages x 3 maps complete by evaluating the real constants module.
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 4b of the learning-companion deepening — plus a real bug the work surfaced.
FIX: Recent panel had been silently dead since stage 2b
resume.jsandtext-selection.jsstill queried sidebar elements viadocument.getElementById— but the sidebar moved into the shadow root in #190, so the Recent panel no-op'd (null panel → early return) and select-and-ask couldn't focus the chat input. Both now usesb.$id. (The two modules the 62-site migration missed; no E2E covered the Recent panel, which is why it went unnoticed.)NEW: "My progress" dashboard (Tools ▸)
Sub-panel aggregating local data only (consistent with the privacy policy — reads
chrome.storage.local, nothing leaves the device): lessons visited (sb_recent), bookmarks, flashcard decks + cards mastered (fc_*Leitner boxes, box≥3), and the three most recent lessons as jump-back links (http(s)-guarded). Labels in all 12 UI languages, dark-mode styles, storage-derived values escaped.Sub-panel state machine extended (
dashboardPanelOpen) acrosscloseSubPanel+ the four sibling panels' guards.E2E
New
dashboard.spec.js(panel opens, localized header, four stat cards in zero-state) +toggleDashboardPanel/readDashboardops — full suite 20/20. 527 unit · lint · prettier green.🤖 Generated with Claude Code