Skip to content

DeepTutor: Lifelong Personalized Tutoring. https://deeptutor.info/.

fix(mastery): preserve scrollable outline with long review trail (#1566)

Bingxi Zhao (Frank)4179fa222ceb
diff --git a/web/app/(workspace)/learning/mastery/[pathId]/page.tsx b/web/app/(workspace)/learning/mastery/[pathId]/page.tsx
index f0c7303d8..953ddae8f 100644
--- a/web/app/(workspace)/learning/mastery/[pathId]/page.tsx
+++ b/web/app/(workspace)/learning/mastery/[pathId]/page.tsx
@@ -349,7 +349,7 @@ export default function MasteryTopicPage() {
// Under `lg` the columns stack and the page scrolls normally — a phone has
// no second column to balance, and a fixed-height stack there would just
// be three tiny scrollers.
- <main className="mastery-shell flex h-full flex-col overflow-y-auto lg:overflow-hidden [scrollbar-gutter:stable]">
+ <main className="mastery-shell flex h-full flex-col overflow-y-auto [scrollbar-gutter:stable]">
<div className="mx-auto flex w-full min-h-0 max-w-[1180px] flex-1 flex-col px-4 pb-40 pt-6 sm:px-7 sm:pb-10 lg:px-8 lg:py-8">
<div className="flex items-center justify-between gap-3">
<Link
@@ -595,7 +595,7 @@ export default function MasteryTopicPage() {
</div>
{/* The outline is the tall thing on this page, so it is the one
that scrolls. Everything else keeps its place. */}
- <div className="min-h-0 lg:flex-1 lg:overflow-y-auto lg:pr-1">
+ <div className="min-h-0 lg:min-h-[260px] lg:flex-1 lg:overflow-y-auto lg:pr-1">
{topicView === "outline" ? (
<ModuleOutline
topic={topic}
diff --git a/web/components/space/learning/ReviewTrail.tsx b/web/components/space/learning/ReviewTrail.tsx
index 8653636b3..9478a38f9 100644
--- a/web/components/space/learning/ReviewTrail.tsx
+++ b/web/components/space/learning/ReviewTrail.tsx
@@ -44,8 +44,8 @@ export function ReviewTrail({
? RETENTION_TARGETS
: [...RETENTION_TARGETS, desiredRetention].sort((a, b) => a - b);
return (
- <section className="overflow-hidden rounded-xl border border-[var(--border)] bg-[var(--card)]">
- <div className="flex flex-wrap items-center justify-between gap-3 border-b border-[var(--border)] bg-[var(--secondary)] px-4 py-2.5">
+ <section className="flex min-h-0 flex-col overflow-hidden rounded-xl border border-[var(--border)] bg-[var(--card)] lg:max-h-[min(30vh,260px)] lg:shrink-0">
+ <div className="flex shrink-0 flex-wrap items-center justify-between gap-3 border-b border-[var(--border)] bg-[var(--secondary)] px-4 py-2.5">
<h2
className="text-[12px] font-semibold text-[var(--foreground)]"
title={t("Scheduled by your forgetting curve")}
@@ -80,7 +80,7 @@ export function ReviewTrail({
</span>
</div>
</div>
- <p id="review-retention-hint" className="px-4 pt-2 text-[10px] text-[var(--muted-foreground)]">
+ <p id="review-retention-hint" className="shrink-0 px-4 pt-2 text-[10px] text-[var(--muted-foreground)]">
{t("Higher targets schedule reviews sooner.")}
</p>
{retentionError && (
@@ -96,7 +96,7 @@ export function ReviewTrail({
)}
</div>
) : (
- <div className="p-2">
+ <div className="min-h-0 overflow-y-auto p-2">
{visible.map((review) => (
<div
key={review.id}