Skip to content

fix(web): show lesson type icons in the course viewer sidebar - #889

Open
RafaelJaime wants to merge 2 commits into
codelitdev:mainfrom
RafaelJaime:fix/course-sidebar-lesson-type-icons
Open

RafaelJaime wants to merge 2 commits into
codelitdev:mainfrom
RafaelJaime:fix/course-sidebar-lesson-type-icons

Conversation

@RafaelJaime

@RafaelJaime RafaelJaime commented Nov 18, 2026 •

Copy link
Copy Markdown

Fixes #888

The course viewer sidebar showed a BookOpen icon for every lesson, regardless of its type, and only the lesson title was clickable.

  • Request type in the lessons selection of the course query (helpers.ts).
  • Render LessonIcon (already used by the page-blocks content widget) as the sidebar item's leading icon, wrapped in a 16px box to keep the previous sizing. The Introduction item keeps its BookOpen.
  • Make the whole lesson row the link: the Link is now the SidebarMenuButton (asChild) and wraps the icon, title and status icon. Previously only the title was an anchor, so clicking the icon did nothing. The tooltip trigger now renders a span (asChild) instead of a button nested inside the anchor.

Tests: added cases to layout-with-sidebar.test.tsx (lesson-type icon per lesson; icon and title share one link without a nested button). Both failed before their change and pass now. pnpm test -- course/ (5 suites, 39 tests) and eslint on apps/web/app/(with-contexts)/course pass; prettier applied.

The sidebar rendered a BookOpen icon for every lesson. Request type in the course query and render LessonIcon instead.
The anchor only wrapped the title, so clicking the icon did nothing, and the tooltip trigger rendered a button inside the anchor. The link is now the menu button itself.

This branch has not been deployed

No deployments
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.

Course sidebar shows the same icon for every lesson type

1 participant