fix(dashboard): use learner view for lesson lock empty states (#764)

Lock checks gated on isOrgStudent missed org-site students where
isStudentExperience is true but org role may be unset. Introduce
isCourseLearnerView (student experience OR org student) and mirror
the exercise page branch structure so locked lessons always show
StudentContentLockedNotice instead of the teacher empty state.

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Rotimi Best <rotimi-best@users.noreply.github.com>
This commit is contained in:
Rotimi Best
2026-07-16 11:29:59 +01:00
committed by GitHub
co-authored by Cursor Agent Rotimi Best
parent 7a867dad45
commit 3ef286ed39
5 changed files with 67 additions and 26 deletions
+13
View File
@@ -32,6 +32,19 @@ export const isStudentExperience = derived([globalStore, isOrgStudent], ([$gs, $
return $isStudent ?? false;
});
/**
* True when course lesson/exercise pages should render the learner UI
* (locked notices, student empty states, no teacher authoring CTAs).
* Cloud org-site visitors always get the learner view; on the app host
* only org-role students do.
*/
export const isCourseLearnerView = derived(
[isStudentExperience, isOrgStudent],
([$isStudentExperience, $isOrgStudent]) => {
return $isStudentExperience || $isOrgStudent === true;
}
);
/**
* The root path for navigation: '/lms' for students, '/org/{siteName}' for admin/teacher
*/