Add unit detail page with lesson accordions and learning objectives
❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.
Overview
Add a unit detail page to the coach course monitoring experience. When a coach clicks a unit on the course summary page, they navigate to a view showing the unit's lessons as accordion items, with each lesson's associated learning objectives listed inside the accordion. Sparkline bars show mastery distribution per LO, reusing SparklineBar and the score bucketing utilities from the recently merged LO reports work.
Complexity: Medium Target branch: release-v0.19.x
Context
lesson_objectivesin the unit'sContentNode.optionsmaps lesson ContentNode IDs to arrays of LO IDs- The unit report API already provides learning objectives, scores, and sparkline data at the unit level
- The lesson completion status endpoint (#14473) returns lesson ContentNodes and per-learner content status data, so no separate tree fetch is needed
StatusSummaryfrom Lesson/Quiz reports can be reused to display aggregate learner completion progress (completed/started/helpNeeded/notStarted breakdown) per lesson
The Change
- Add a unit detail route and page component, wired from the unit links on CourseSummaryPage (currently stubbed as
:to="{}") - Fetch data from the existing unit report API and the lesson completion status endpoint (#14473), which returns both lesson ContentNodes and per-learner content status data
- Display lessons as accordion items using
AccordionContainer/AccordionItem, withStatusSummaryshowing aggregate learner completion progress per lesson - Inside each accordion, list the lesson's learning objectives (mapped via
lesson_objectivesfrom unit options) withSparklineBarshowing mastery distribution per LO - No tabs — single view only
Out of Scope
- "View by groups" filtering
- "Preview as learner" button
- Side panel detail views for individual learners or learning objectives (covered in parent issue design but not this task)
Acceptance Criteria
General
- [ ] Clicking a unit on CourseSummaryPage navigates to the new unit detail page
- [ ] Page displays the unit title with a back link to the course summary
- [ ] Lessons are rendered as accordion items using
AccordionContainer/AccordionItem, all collapsed by default - [ ] Each lesson accordion header shows
StatusSummarywith aggregate learner completion progress - [ ] Inside each accordion, the lesson's learning objectives are listed (mapped via
lesson_objectivesfrom unit options) - [ ] Each learning objective row shows a
SparklineBarwith mastery distribution - [ ] No tabs — single view only
Accessibility and i18n
- [ ] Hidden header row for the LO/mastery table, matching the pattern in
LearningObjectivesReport - [ ] All user-visible strings use existing coach strings where available, new strings added to the courses translator in
kolibri-common - [ ] Keyboard navigation works for accordion expand/collapse
Testing
- [ ] Tests written before implementation (TDD)
- [ ] Unit detail route is registered and navigable
- [ ] Accordion rendering with lesson data is tested
- [ ] LO-to-lesson mapping via
lesson_objectivesis tested - [ ] SparklineBar integration with per-LO mastery data is tested
Design Checklist
Page Header
Layout:
- [ ] Back link/breadcrumb above unit title, linking to course summary page
- [ ] Unit title displayed as a heading
Lesson Accordion Items
Layout:
- [ ] Lessons rendered using
AccordionContainer/AccordionItemcomponents - [ ] All accordions collapsed by default
- [ ] Accordion header shows lesson title and
StatusSummarycompletion indicator
States:
- [ ] Collapsed: shows lesson title + completion status only
- [ ] Expanded: reveals list of learning objectives with sparkline bars
Learning Objectives List (inside accordion)
Layout:
- [ ] Each LO row displays LO text and
SparklineBaron the right - [ ] LO text and sparkline aligned in a two-column layout matching
LearningObjectivesReportpattern - [ ] Hidden
theadfor accessibility, matching the pattern inLearningObjectivesReport(visually hidden viadisplay: none, caption provides screen reader context)
Spacing:
- [ ] LO name cell:
padding: 12px 0 12px 16px(matchingLearningObjectivesReport.lo-link) - [ ] Sparkline cell:
padding: 12px 16px 12px 0(matchingLearningObjectivesReport.lo-sparkline)
Colors:
- [ ] SparklineBar segments use existing palette colors: low
palette.red.v_600, midpalette.yellow.v_500, highpalette.green.v_600
Empty state:
- [ ] When no test is activated for the unit, show appropriate empty state message
Spec shows desktop only — responsive behavior not specified. The AccordionContainer/AccordionItem components and responsive-window/responsive-element system handle responsive behavior.
References
- Design spec:
- Existing components:
AccordionContainer/AccordionIteminpackages/kolibri-common/components/accordion/,SparklineBarinkolibri/plugins/coach/frontend/views/common/,StatusSummaryinkolibri/plugins/coach/frontend/views/common/status/,LearningObjectivesReportinkolibri/plugins/coach/frontend/views/courses/
AI usage
This issue was drafted collaboratively with Claude Code. Visual acceptance criteria were extracted from the design spec screenshot. Component references and theme token values were verified against the current codebase.
Watching for resolution on behalf of learningequality/kolibri#14458.