feat(site): update catalog and modal navigation#303
Conversation
Update lesson links to route through internal readers where available and add external GitHub source links to improve interface usability.
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughLesson name links in both the modal ( ChangesInternal Lesson Link Routing
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 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`:
- Line 244: The lessonPath variable is being concatenated directly into the URL
query parameter without encoding, which can produce malformed links for
non-URL-safe characters. In the line where the anchor tag is created with the
lesson.html link, wrap the lessonPath variable with encodeURIComponent() before
concatenating it into the href attribute to properly encode the query parameter
value and align with the existing pattern used in cmdpalette.js.
- Around line 248-250: The code is rendering an `<a>` tag without an `href`
attribute when there is no destination URL, which is semantically incorrect.
Replace the `<a>` and `</a>` tags in the else block (where html is concatenated
with escapeHtml(l.name)) with non-interactive `<span>` and `</span>` tags to
properly represent non-linked text without misleading link semantics.
In `@site/catalog.html`:
- Line 444: The GitHub link element with class "catalog-github-link" contains
only the visual icon character (↗) without an accessible label for screen
readers. Add an aria-label attribute to the anchor tag to provide a meaningful
description of the link's action (such as "View source on GitHub") so that
assistive technology users understand the purpose of this icon-only link.
- Line 442: The r.lessonPath parameter in the query string on the line that
constructs the href for lesson.html is not URL-encoded. Apply URL encoding to
r.lessonPath by wrapping it with encodeURIComponent() before concatenating it
into the href URL string. This ensures special characters in the path are
properly escaped for safe URL transmission, similar to how r.name is already
escaped with escapeHtml for HTML safety.
🪄 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: 8c8ab618-852d-4ade-953d-112abb71c610
📒 Files selected for processing (3)
site/app.jssite/catalog.htmlsite/style.css
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Update lesson links to route through internal readers where available and
add external GitHub source links to improve interface usability.
What this PR does
Makes lesson titles clickable links to the internal lesson viewer instead of redirecting to GitHub, while preserving GitHub access through secondary links.
Kind of change
Checklist
Most checklist items don't apply since this is a site-wide UX change, not a lesson:
LESSON_TEMPLATE.mdstructure[Name](phases/...)), not bare textdocs/en.mdclaimsAdditional checks:
site/app.js,site/catalog.html,site/style.css)lessonPathstill link to GitHub as beforePhase / lesson
Not applicable — site-wide UX improvement affecting the lesson modal and catalog page.
Notes for reviewer
Problem: Users clicking lesson titles in the modal and catalog were redirected to GitHub instead of the on-site lesson viewer (
lesson.html?path=...), even though the viewer already existed.Solution:
site/app.js): Lesson title now links to the internal viewer. The former "Read"/"Review" button is now a "GitHub" link that opens the source repo in a new tab.site/catalog.html): Lesson names link to the internal viewer. A small ↗ icon next to each name opens the GitHub source in a new tab.site/style.css+ inline incatalog.html): Secondary GitHub links use reduced opacity (0.5–0.6) that increases on hover, making them clearly subordinate to the primary title link.Files changed:
site/app.jssite/catalog.htmlsite/style.css.modal-lesson-githubstyles for the secondary buttonNo breaking changes: Fallback behavior is preserved — lessons without a parseable
lessonPathstill link to GitHub directly.