@@ -142,7 +143,7 @@ export function StudentApp() {
{settings.maintenanceBanner &&
{settings.maintenanceBanner}
}
-
+ {!focus &&
}
{signedIn && section !== 'learn' && section !== 'course' &&
}
@@ -847,30 +848,33 @@ function AssessmentPage({ slug, id }: { slug?: string; id?: string }) {
function Player({ slug, lessonId }: { slug?: string; lessonId?: string }) {
const t = useTranslations();
const { courses, me, locale, nav, catalogLoaded, signedIn, viewer } = useApp();
+ const sheet = useRef
(null);
+ useEffect(() => { sheet.current?.close(); }, [lessonId]); // picking a lesson in the sheet closes it
const c = courses.find((x) => x.slug === slug);
const lessons = c ? publishedLessons(c) : [];
const lesson = lessons.find((l) => l.id === lessonId);
if (!catalogLoaded) return ;
if (!c || !lesson || !isStudentVisible(c, me)) return nav(`/${locale}/courses`)}>{t('catalog.title')}}>{t('course.notFound')};
const access = lessonAccess(c, lesson, signedIn ? me : null, courses);
- const p = courseProgress(c, me);
const idx = lessons.indexOf(lesson);
const next = lessons[idx + 1];
const notes = tr(lesson.translations, locale)?.description;
const chapter = c.chapters.find((ch) => ch.lessons.some((l) => l.id === lesson.id));
+ // L2: the video comes first; where you are (course, chapter, lesson) sits right under it
+ const head = (
+
+
+
+ {chapter && {tr(chapter.translations, locale)?.title}}
+
+
{idx + 1}. {lessonTitle(lesson, locale)}
+
+ );
return (
-
-
- {ct(c, locale).title}
-
-
-
- {tr(chapter?.translations, locale)?.title}
-
{idx + 1}. {lessonTitle(lesson, locale)}
-
- {access.ok ?
: (
+
+ {access.ok ?
: <>
{t(`player.${access.reason}`)}
@@ -879,44 +883,63 @@ function Player({ slug, lessonId }: { slug?: string; lessonId?: string }) {
{access.reason === 'PREREQUISITE_REQUIRED' &&
}
{access.reason === 'ACCOUNT_DEACTIVATED' &&
}
- )}
-
+ {head}
+ >}
+ {/* L5: only real lesson notes; no card standing in with the course blurb */}
+ {notes &&
{t('player.notes')}
-
{notes || ct(c, locale).subtitle || ct(c, locale).description}
-
+
{notes}
+
}
-
+
{viewer && !viewer.id &&
{t('auth.noIdentity')}
}
+ {/* L6: on phones and tablets the lesson list slides up over the video instead of scrolling the page away from it */}
+
);
}
-function VideoPanel({ c, lesson, next }: { c: Course; lesson: Lesson; next?: Lesson }) {
+// The course's chapters and lessons with progress: the player's sidebar on desktop and its lesson sheet on phones.
+function CourseContents({ c, lesson }: { c: Course; lesson: Lesson }) {
+ const t = useTranslations();
+ const { me, locale } = useApp();
+ const p = courseProgress(c, me);
+ return <>
+
+ {owns(me, c.id) &&
}
+
{t('course.content')}{ct(c, locale).title}
+ {owns(me, c.id) && {t('player.progress', { done: p.done, total: p.total })}}
+
+ {[...c.chapters].sort((a, b) => a.sortOrder - b.sortOrder).map((ch, ci) => {
+ const ls = [...ch.lessons].sort((a, b) => a.sortOrder - b.sortOrder).filter((l) => l.isPublished);
+ if (!ls.length) return null;
+ const doneN = ls.filter((l) => isCompleted(me, l.id)).length;
+ return
l.id === lesson.id) || undefined}>
+
+ {doneN === ls.length ? : String(ci + 1).padStart(2, '0')}
+ {tr(ch.translations, locale)?.title}{doneN}/{ls.length} · {clock(ls.reduce((a, l) => a + l.durationSec, 0))}
+
+
+ {ls.map((l) => )}
+ ;
+ })}
+ >;
+}
+
+const AUTO_NEXT_SEC = 5;
+
+function VideoPanel({ c, lesson, next, head }: { c: Course; lesson: Lesson; next?: Lesson; head?: ReactNode }) {
const t = useTranslations();
const { me, locale, nav, ds, write, signedIn, viewer } = useApp();
const vimeo = !lesson.videoAssetId; // no upload yet: play the Vimeo placeholder instead
@@ -930,6 +953,9 @@ function VideoPanel({ c, lesson, next }: { c: Course; lesson: Lesson; next?: Les
const [saver, setSaver] = useState
(() => !!conn && (conn.saveData || /2g|3g/.test(conn.effectiveType ?? '')));
const [quality, setQuality] = useState('auto');
const [justDone, setJustDone] = useState(false);
+ // L4: when a lesson ends, "up next" appears over the video and plays it after a short count the student can cancel
+ const [ended, setEnded] = useState(false);
+ const [auto, setAuto] = useState(null);
const videoRef = useRef(null);
const frameRef = useRef(null);
const screenRef = useRef(null);
@@ -963,8 +989,9 @@ function VideoPanel({ c, lesson, next }: { c: Course; lesson: Lesson; next?: Les
let m: any; try { m = typeof e.data === 'string' ? JSON.parse(e.data) : e.data; } catch { return; }
if (m.event === 'ready') vlisten();
else if (m.event === 'timeupdate') { setPos(m.data.seconds); if (m.data.duration) setVdur(m.data.duration); }
- else if (m.event === 'play') setPlaying(true);
- else if (m.event === 'pause' || m.event === 'ended') setPlaying(false);
+ else if (m.event === 'play') { setPlaying(true); setEnded(false); setAuto(null); }
+ else if (m.event === 'pause') setPlaying(false);
+ else if (m.event === 'ended') { setPlaying(false); setEnded(true); }
else if (m.method === 'getDuration' && m.value) setVdur(m.value);
};
addEventListener('message', on);
@@ -979,6 +1006,14 @@ function VideoPanel({ c, lesson, next }: { c: Course; lesson: Lesson; next?: Les
}, [heartbeat]);
useEffect(() => { const v = videoRef.current; if (v) v.playbackRate = rate; }, [rate]);
useEffect(() => { if (vimeo && rate !== 1) vcall('setPlaybackRate', rate); }, [rate]);
+ const goNext = () => { if (next) nav(`/${locale}/learn/${c.slug}/${next.id}`); };
+ useEffect(() => { if (ended && next) setAuto(AUTO_NEXT_SEC); }, [ended, next]);
+ useEffect(() => {
+ if (auto == null) return;
+ if (auto <= 0) { goNext(); return; }
+ const id = setTimeout(() => setAuto((a) => (a == null ? null : a - 1)), 1000);
+ return () => clearTimeout(id);
+ }, [auto]);
const toggle = () => {
const v = videoRef.current;
@@ -989,6 +1024,7 @@ function VideoPanel({ c, lesson, next }: { c: Course; lesson: Lesson; next?: Les
const full = () => { screenRef.current?.requestFullscreen?.().catch(() => { /* not allowed in this frame */ }); };
const onKey = (e: React.KeyboardEvent) => {
if ((e.target as HTMLElement).tagName === 'SELECT' || (e.target as HTMLElement).tagName === 'INPUT') return;
+ if (e.key === 'Escape' && auto != null) { setAuto(null); return; }
if (e.key === ' ') { e.preventDefault(); toggle(); } else if (e.key === 'ArrowLeft') seek(pos - 10); else if (e.key === 'ArrowRight') seek(pos + 10); else if (e.key === 'f') full(); else if (e.key === 'm' && videoRef.current) videoRef.current.muted = !videoRef.current.muted;
};
const mark = (me?.phone || me?.email || viewer?.name || 'student').replace(/^(.{3}).*(.{2})$/, '$1•••$2');
@@ -1000,11 +1036,20 @@ function VideoPanel({ c, lesson, next }: { c: Course; lesson: Lesson; next?: Les
{lesson.videoAssetId ? (
- {vimeo && {t('player.demoVideo')}{canSave && !done && <> · >}
}
+ {head}
+ {vimeo && {t('player.demoVideo')}{canSave && !done && <> · >}
}
{done && pct === 100 && (
{Array.from({ length: 18 }, (_, k) => )}
@@ -1037,7 +1083,7 @@ function VideoPanel({ c, lesson, next }: { c: Course; lesson: Lesson; next?: Les
)}
- {done && pct < 100 && (
+ {done && pct < 100 && auto == null && (
{t('player.completed')}{t('player.courseProgress', { pct })}
diff --git a/packages/features/src/styles.css b/packages/features/src/styles.css
index 36cfc51..5cae7e6 100644
--- a/packages/features/src/styles.css
+++ b/packages/features/src/styles.css
@@ -1165,7 +1165,7 @@ fieldset[disabled] .quiz-opt { cursor: default; }
.ps-ch summary:hover { background: var(--mist); }
.ps-ch summary > svg { flex: none; color: var(--ink-3); transition: transform 200ms var(--ease-out); }
.ps-ch[open] summary > svg { transform: rotate(180deg); }
-.ps-ch-n { flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--mist); font-size: 12px; font-weight: 700; color: var(--ink-2); }
+.ps-ch-n { flex: none; width: 28px; height: 28px; border-radius: 50%; /* L7: same round marker as lesson rows */ display: grid; place-items: center; background: var(--mist); font-size: 12px; font-weight: 700; color: var(--ink-2); }
.ps-ch.is-done .ps-ch-n { background: var(--ink); color: var(--paper); }
.ps-ch-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ps-ch-list { padding: 2px 0 8px 18px; margin-left: 13px; border-left: 1px solid var(--line); }
@@ -1216,3 +1216,38 @@ fieldset[disabled] .quiz-opt { cursor: default; }
/* the full footer is always on its dark frame, so its powered-by line keeps light text in both themes */
.foot-full .powered { color: #8A8A8A; }
.foot-full .shine, :root:not([data-theme="dark"]) .foot-full .shine { background-image: linear-gradient(110deg, #C9C9C9 40%, #fff 50%, #C9C9C9 60%); }
+
+/* ---------- lesson player polish (L1–L6, 2026-10-27) ---------- */
+/* L1: focus mode while watching: the logo and account stay, the site links and footer go */
+.s-focus .s-nav { display: none; }
+/* L2: the video comes first (edge to edge on phones, right under the header); course, chapter and title sit under it */
+.p-head { display: flex; flex-direction: column; gap: 6px; }
+.p-head h1 { font-size: var(--fs-xl); line-height: 1.2; letter-spacing: -.02em; }
+.p-crumb { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; font-size: var(--fs-sm); color: var(--ink-3); }
+.p-crumb button { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0; border: 0; background: none; color: var(--ink-2); font-weight: 600; cursor: pointer; }
+.p-crumb > span::before { content: '·'; margin-inline-end: 8px; }
+@media (hover: hover) and (pointer: fine) { .p-crumb button:hover { color: var(--ink); } }
+@media (max-width: 599px) { .s-focus .s-main { padding-top: 0; } .s-focus .screen { margin-inline: calc(50% - 50vw); width: 100vw; max-width: 100vw; border-radius: 0; } /* full bleed whatever the page padding is */ }
+/* L4: "up next" over the finished video; the ring empties over the countdown (linear: it's a timer) */
+.p-upnext { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 6px; padding: clamp(16px, 4vw, 32px); background: rgba(10, 10, 10, .84); backdrop-filter: blur(6px); color: #F5F5F5; animation: upnext-in 240ms var(--ease-out); }
+.p-upnext-k { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: rgba(245, 245, 245, .7); }
+.p-upnext strong { font-size: clamp(18px, 3vw, 24px); line-height: 1.25; max-width: 32ch; }
+.p-upnext-n { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: rgba(245, 245, 245, .75); }
+.p-upnext-n svg { rotate: -90deg; }
+.p-upnext-n circle { fill: none; stroke: #F5F5F5; stroke-width: 2.5; stroke-dasharray: 63; animation: upnext-count 5s linear forwards; }
+.p-upnext-go { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
+.p-upnext .btn-accent { background: #F5F5F5; color: #0A0A0A; }
+.p-upnext .btn-quiet { color: #F5F5F5; }
+@keyframes upnext-in { from { opacity: 0; } }
+@keyframes upnext-count { to { stroke-dashoffset: 63; } }
+/* L6: lesson list as a bottom sheet (phones and tablets; the sidebar covers desktop) */
+.lsheet { position: fixed; inset: auto 0 0 0; margin: 0; width: 100%; max-width: 100%; max-height: 80dvh; padding: 0; border: 0; border-radius: 22px 22px 0 0; background: var(--paper); color: var(--ink); box-shadow: var(--shadow-pop); }
+.lsheet::backdrop { background: rgba(0, 0, 0, .5); }
+.lsheet[open] { animation: lsheet-up 300ms cubic-bezier(0.32, 0.72, 0, 1); }
+.lsheet[open]::backdrop { animation: fade-in 300ms ease; }
+@keyframes lsheet-up { from { transform: translateY(100%); } }
+.lsheet-in { max-height: 80dvh; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 8px; padding: 0 16px calc(20px + env(safe-area-inset-bottom, 0px)); }
+.lsheet-top { position: sticky; top: 0; z-index: 1; display: flex; justify-content: center; align-items: center; min-height: 48px; background: var(--paper); }
+.lsheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line); }
+.lsheet-top .icon-btn { position: absolute; inset-inline-end: 0; }
+@media (min-width: 640px) { .lsheet { max-width: 560px; margin-inline: auto; } }
diff --git a/packages/i18n/messages/am.json b/packages/i18n/messages/am.json
index ea7fb04..f5c5d4b 100644
--- a/packages/i18n/messages/am.json
+++ b/packages/i18n/messages/am.json
@@ -223,6 +223,9 @@
"progress": "ከ{total} ትምህርቶች {done} ተጠናቀዋል",
"nowPlaying": "አሁን እየታየ",
"upNext": "ቀጣይ",
+ "nextShort": "ቀጣይ",
+ "playNow": "አሁን አጫውት",
+ "autoNext": "በ{n} ሰከንድ ይጀምራል",
"courseProgress": "ኮርሱ {pct}% ተጠናቋል",
"courseDoneT": "ኮርሱ ተጠናቋል",
"courseDone": "{course}ን ጨርሰዋል። ለዘላለም የእርስዎ ነው፤ በፈለጉ ጊዜ ወደ ማንኛውም ትምህርት ይመለሱ።",
diff --git a/packages/i18n/messages/en.json b/packages/i18n/messages/en.json
index 0621ccb..bf412c6 100644
--- a/packages/i18n/messages/en.json
+++ b/packages/i18n/messages/en.json
@@ -223,6 +223,9 @@
"progress": "{done} of {total} lessons completed",
"nowPlaying": "Now playing",
"upNext": "Up next",
+ "nextShort": "Next",
+ "playNow": "Play now",
+ "autoNext": "Starting in {n}",
"courseProgress": "Course {pct}% complete",
"courseDoneT": "Course complete",
"courseDone": "You finished {course}. It stays yours for life, so come back to any lesson whenever you need it.",
diff --git a/packages/i18n/messages/om.json b/packages/i18n/messages/om.json
index 148b2da..4051b70 100644
--- a/packages/i18n/messages/om.json
+++ b/packages/i18n/messages/om.json
@@ -223,6 +223,9 @@
"progress": "Barnoota {total} keessaa {done} xumurameera",
"nowPlaying": "Amma taphachaa jira",
"upNext": "Kan itti aanu",
+ "nextShort": "Itti aanu",
+ "playNow": "Amma taphachiisi",
+ "autoNext": "Sekondii {n} keessatti jalqaba",
"courseProgress": "Koorsiin {pct}% xumurameera",
"courseDoneT": "Koorsiin xumurameera",
"courseDone": "{course} xumurteetta. Bara baraan kan kee ta'a; yeroo barbaadde barnoota kamittuu deebi'i.",
diff --git a/packages/i18n/messages/ti.json b/packages/i18n/messages/ti.json
index 90fdd06..640aece 100644
--- a/packages/i18n/messages/ti.json
+++ b/packages/i18n/messages/ti.json
@@ -223,6 +223,9 @@
"progress": "ካብ {total} ትምህርትታት {done} ተወዲኦም",
"nowPlaying": "ሕጂ ይርአ ኣሎ",
"upNext": "ቀጻሊ",
+ "nextShort": "ቀጻሊ",
+ "playNow": "ሕጂ ኣጻውት",
+ "autoNext": "ኣብ {n} ካልኢት ይጅምር",
"courseProgress": "ኮርስ {pct}% ተወዲኡ",
"courseDoneT": "ኮርስ ተወዲኡ",
"courseDone": "{course} ወዲእኪ። ንሓዋሩ ናትኪ እዩ፣ ኣብ ዝደለኽዮ ግዜ ናብ ዝኾነ ትምህርቲ ተመለሲ።",