Skip to content

feat(dashboard): local progress panel + fix the sub-panel modules stage-2b missed#205

Merged
heznpc merged 4 commits into
mainfrom
feat/local-dashboard
Jun 10, 2026
Merged

feat(dashboard): local progress panel + fix the sub-panel modules stage-2b missed#205
heznpc merged 4 commits into
mainfrom
feat/local-dashboard

Conversation

@heznpc

@heznpc heznpc commented Jun 10, 2026

Copy link
Copy Markdown
Owner

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.js and text-selection.js still queried sidebar elements via document.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 use sb.$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) across closeSubPanel + the four sibling panels' guards.

E2E

New dashboard.spec.js (panel opens, localized header, four stat cards in zero-state) + toggleDashboardPanel/readDashboard ops — full suite 20/20. 527 unit · lint · prettier green.

🤖 Generated with Claude Code

heznpc added 2 commits June 10, 2026 15:53
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 heznpc enabled auto-merge (squash) June 10, 2026 07:03
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.
@heznpc heznpc merged commit d4123b3 into main Jun 10, 2026
9 checks passed
@heznpc heznpc deleted the feat/local-dashboard branch June 10, 2026 07:43
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant