Repository navigation
fix(web): show lesson type icons in the course viewer sidebar - #889
Open
RafaelJaime wants to merge 2 commits into
Open
RafaelJaime wants to merge 2 commits into
RafaelJaime wants to merge 2 commits into
Conversation
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
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.
Fixes #888
The course viewer sidebar showed a
BookOpenicon for every lesson, regardless of its type, and only the lesson title was clickable.typein thelessonsselection of the course query (helpers.ts).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 itsBookOpen.Linkis now theSidebarMenuButton(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 aspan(asChild) instead of abuttonnested 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 onapps/web/app/(with-contexts)/coursepass; prettier applied.