Skip to content

feat(site): add interactive learning portal - #333

Open
Nikhil12108 wants to merge 1 commit into
rohitg00:mainfrom
Nikhil12108:feat/interactive-learning-experience
Open

feat(site): add interactive learning portal#333
Nikhil12108 wants to merge 1 commit into
rohitg00:mainfrom
Nikhil12108:feat/interactive-learning-experience

Conversation

@Nikhil12108

Copy link
Copy Markdown

What this PR does

Kind of change

  • New lesson
  • Fix to an existing lesson
  • Translation
  • New output (prompt, skill, agent, MCP server)
  • Docs / website / tooling

Checklist

  • Code runs without errors with the listed dependencies
  • No comments in code files (docs explain, code is self-explanatory)
  • Built from scratch first, then shown with a framework (for new lessons)
  • Lesson folder matches LESSON_TEMPLATE.md structure
  • ROADMAP.md row for the lesson is a markdown link ([Name](phases/...)), not bare text
  • One lesson per commit (atomic per-lesson rule)
  • Tested locally / code output matches what docs/en.md claims

Phase / lesson

Notes for reviewer

@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The static course site now builds local lesson assets, persists reading progress and preferences, loads materials locally, adds lesson completion controls, and provides an interactive homepage course map with progress-aware navigation.

Changes

Course site experience

Layer / File(s) Summary
Progress state and validation
site/progress.js, site/tests/progress.test.js
Lesson state now includes scroll position, recent-lesson lookup, full-state access, and validated completion behavior.
Local course build pipeline
site/build.js, .gitignore, site/README.md
The build generates materials.js, synchronizes course assets into site/course/, and documents local serving and testing.
Lesson materials and reading flow
site/lesson.html
Lessons support local-first content, reading controls, scroll restoration, materials panels, progress-based timelines, and completion toggles.
Interactive course navigation
site/app.js, site/index.html, site/style.css, site/about.html
The homepage adds a progress-aware learning command, interactive course universe, attribution content, and responsive styling.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Browser
  participant AppJS
  participant AIFSProgress
  participant LessonPage
  Browser->>AppJS: load interactive course homepage
  AppJS->>AIFSProgress: read completion state
  AIFSProgress-->>AppJS: return progress data
  AppJS-->>Browser: render course map and learning command
  Browser->>LessonPage: open or resume lesson
  LessonPage->>AIFSProgress: save scroll position or completion
  AIFSProgress-->>AppJS: notify progress change
  AppJS-->>Browser: refresh navigation state
Loading

Possibly related PRs

Suggested reviewers: rohitg00

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The description is only a template and does not convey meaningful details about the changeset. Replace the template with a brief summary of the site and learning-portal changes.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: an interactive learning portal for the site.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
site/lesson.html (1)

3309-3316: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Guard the clipboard call and handle rejection.

navigator.clipboard is undefined in non-secure contexts (e.g. serving over plain HTTP to a non-localhost host), so navigator.clipboard.writeText(...) throws a TypeError and the click does nothing with no feedback. The promise also has no .catch, so a denied permission produces an unhandled rejection.

♻️ Suggested guard
-      button.addEventListener('click', function () {
-        navigator.clipboard.writeText(button.getAttribute('data-command')).then(function () {
-          button.textContent = 'Copied!';
-          setTimeout(function () { button.textContent = 'Copy command'; }, 1500);
-        });
-      });
+      button.addEventListener('click', function () {
+        if (!navigator.clipboard) return;
+        navigator.clipboard.writeText(button.getAttribute('data-command')).then(function () {
+          button.textContent = 'Copied!';
+          setTimeout(function () { button.textContent = 'Copy command'; }, 1500);
+        }).catch(function () {});
+      });
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@site/lesson.html` around lines 3309 - 3316, Update the .code-card-copy click
handler to verify navigator.clipboard and its writeText method exist before
calling them, and handle rejected clipboard promises with user feedback.
Preserve the existing “Copied!” success behavior, while providing a fallback
message when the clipboard API is unavailable or the write fails.
site/app.js (1)

276-307: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Avoid getComputedStyle on every animation frame.

draw() runs each requestAnimationFrame tick, and Line 280 calls getComputedStyle(document.documentElement) per frame, forcing a style recalculation ~60×/sec for a value (--blueprint) that rarely changes. Read the stroke color once outside the loop (recompute only on theme change) to cut sustained main-thread cost.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@site/app.js` around lines 276 - 307, Move the --blueprint color lookup out of
the per-frame draw() function and cache the resolved stroke color for reuse
during animation. Update the cache only when the theme changes, while preserving
the existing fallback color and ctx.strokeStyle behavior in draw().
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@site/app.js`:
- Around line 209-211: Replace the corrupted · separator with the correct
middle dot in the user-facing strings at site/app.js lines 209-211 and 240, and
site/lesson.html line 3224, including the Continue/Start phase labels, resume
text, node title, and Included with this lesson text.

---

Nitpick comments:
In `@site/app.js`:
- Around line 276-307: Move the --blueprint color lookup out of the per-frame
draw() function and cache the resolved stroke color for reuse during animation.
Update the cache only when the theme changes, while preserving the existing
fallback color and ctx.strokeStyle behavior in draw().

In `@site/lesson.html`:
- Around line 3309-3316: Update the .code-card-copy click handler to verify
navigator.clipboard and its writeText method exist before calling them, and
handle rejected clipboard promises with user feedback. Preserve the existing
“Copied!” success behavior, while providing a fallback message when the
clipboard API is unavailable or the write fails.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e8136dad-4064-4d70-b00c-20110a20d1d9

📥 Commits

Reviewing files that changed from the base of the PR and between c8b9b92 and 3c57bca.

📒 Files selected for processing (10)
  • .gitignore
  • site/README.md
  • site/about.html
  • site/app.js
  • site/build.js
  • site/index.html
  • site/lesson.html
  • site/progress.js
  • site/style.css
  • site/tests/progress.test.js

Comment thread site/app.js
Comment on lines +209 to +211
if (kicker) kicker.textContent = recent ? 'Continue · Phase ' + String(target.phase.id).padStart(2, '0') : 'Start · Phase ' + String(target.phase.id).padStart(2, '0');
if (title) title.textContent = target.lesson.name;
if (meta) meta.textContent = completed + ' of ' + lessons.length + ' lessons completed' + (readingPct > 1 ? ' · resume at ' + readingPct + '%' : '') + '. Progress stays saved on this device.';

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Fix mojibake separator in user-facing strings. The middle-dot separator was saved as corrupted UTF-8 (· instead of ·, U+00B7) and will render as garbled text in the UI. Replace each · with · (or the \u00B7 escape / · where markup allows).

  • site/app.js#L209-L211: correct 'Continue · Phase ', 'Start · Phase ', and ' · resume at ' to use ·.
  • site/app.js#L240-L240: correct the 'Phase ' + ... + ' · ' + ... node title to use ·.
  • site/lesson.html#L3224-L3224: correct 'Included with this lesson · ' to use ·.
📍 Affects 2 files
  • site/app.js#L209-L211 (this comment)
  • site/app.js#L240-L240
  • site/lesson.html#L3224-L3224
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@site/app.js` around lines 209 - 211, Replace the corrupted · separator with
the correct middle dot in the user-facing strings at site/app.js lines 209-211
and 240, and site/lesson.html line 3224, including the Continue/Start phase
labels, resume text, node title, and Included with this lesson text.

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