Skip to content

Commit 66315f1

Browse files
authored
improvement(docs): flatten the academy learn/chapters panels (#5253)
* improvement(docs): flatten the academy learn/chapters panels The "What you will learn" and "Chapters" panels were filled, bordered cards — the only boxed elements on the page. The docs design system is explicitly flat: global.css strips fumadocs cards/callouts/card-grids to transparent/divider-based, and the right-rail "On this page" TOC is small, muted, and borderless. - WhatYouWillLearn (inline): flat divider list like the FAQ, with a small panel label at the app's text scale instead of a page-h2-scale title - VideoChapters (right rail): borderless, matching the TOC — small muted label + flat hover rows, no card chrome * improvement(docs): drop the repeated per-row play icon from the chapters list The CirclePlay glyph repeated on every chapter row read as noise — a column of identical icons down the rail. The "On this page" TOC this list mirrors has no per-row icons; the timestamps already signal video chapters and the hover highlight signals they're seekable. Rows are now text + time only. * improvement(docs): drop the under-label rule on the learn callout A full-width rule under the small "What you will learn" label read as an awkward heading underline and blurred into the inter-item dividers. The label is now a quiet muted marker (matching the Chapters label and the TOC heading), with dividers only between items — so it never competes with the bold item titles or looks like an underlined heading.
1 parent 5a81341 commit 66315f1

2 files changed

Lines changed: 20 additions & 26 deletions

File tree

apps/docs/components/ui/video-chapters.tsx

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
'use client'
22

33
import { useEffect, useState } from 'react'
4-
import { CirclePlay } from 'lucide-react'
54
import { cn } from '@/lib/utils'
65

76
/** Parse a chapter timestamp ("M:SS" or "H:MM:SS") into seconds. */
@@ -26,9 +25,10 @@ interface VideoChaptersProps {
2625
}
2726

2827
/**
29-
* Right-rail panel listing the current video's chapters, styled to match the
30-
* Academy's course panels. Rows are skip-to controls; they activate once the
31-
* lesson's video is recorded.
28+
* Right-rail list of the current video's chapters — flat and borderless to
29+
* match the docs' "On this page" TOC (small muted label, hover-highlighted
30+
* rows). Rows are skip-to controls; they activate once the lesson's video is
31+
* recorded.
3232
*/
3333
export function VideoChapters({ title = 'Chapters', chapters, className }: VideoChaptersProps) {
3434
// Chapters only seek when a VideoPlaceholder with a real video is on the page.
@@ -42,13 +42,8 @@ export function VideoChapters({ title = 'Chapters', chapters, className }: Video
4242
}, [])
4343

4444
return (
45-
<aside
46-
className={cn(
47-
'not-prose rounded-xl border border-[var(--border-1)] bg-[var(--surface-3)] p-5',
48-
className
49-
)}
50-
>
51-
<h2 className='mt-0 mb-3 font-semibold text-[var(--text-primary)] text-lg'>{title}</h2>
45+
<aside className={cn('not-prose', className)}>
46+
<p className='mb-2 px-2.5 font-medium text-[0.8125rem] text-[var(--text-muted)]'>{title}</p>
5247
<ul className='m-0 flex list-none flex-col gap-0.5 p-0'>
5348
{chapters.map((chapter) => (
5449
<li key={chapter.title}>
@@ -61,12 +56,11 @@ export function VideoChapters({ title = 'Chapters', chapters, className }: Video
6156
new CustomEvent('academy:seek', { detail: { time: parseTime(chapter.time) } })
6257
)
6358
}}
64-
className='flex w-full cursor-pointer items-start gap-2.5 rounded-lg px-2.5 py-2 text-left text-[var(--text-secondary)] text-sm transition-colors hover:bg-[var(--surface-active)] disabled:cursor-default disabled:hover:bg-transparent'
59+
className='flex w-full cursor-pointer items-baseline gap-3 rounded-lg px-2.5 py-2 text-left text-[var(--text-secondary)] text-sm transition-colors hover:bg-[var(--surface-active)] disabled:cursor-default disabled:hover:bg-transparent'
6560
>
66-
<CirclePlay className='mt-0.5 size-4 shrink-0' />
6761
<span className='min-w-0 flex-1 break-words'>{chapter.title}</span>
6862
{chapter.time && (
69-
<span className='mt-0.5 shrink-0 text-[var(--text-muted)] text-xs tabular-nums'>
63+
<span className='shrink-0 text-[var(--text-muted)] text-xs tabular-nums'>
7064
{chapter.time}
7165
</span>
7266
)}

apps/docs/components/ui/what-you-will-learn.tsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,22 @@ interface WhatYouWillLearnProps {
1010
className?: string
1111
}
1212

13-
/** A bordered "What you will learn" card listing lesson takeaways. */
13+
/**
14+
* "What you will learn" — a flat callout matching the docs' flat/divider
15+
* language. A quiet muted label (like the TOC heading) sits above the
16+
* takeaways; dividers fall only between items, so the label reads as a marker
17+
* rather than an underlined heading and never competes with the item titles.
18+
*/
1419
export function WhatYouWillLearn({ items, className }: WhatYouWillLearnProps) {
1520
return (
16-
<div
17-
className={cn(
18-
'not-prose rounded-xl border border-[var(--border-1)] bg-[var(--surface-3)] p-6',
19-
className
20-
)}
21-
>
22-
<h2 className='mt-0 mb-5 font-semibold text-[var(--text-primary)] text-xl'>
21+
<div className={cn('not-prose', className)}>
22+
<p className='mb-3 font-medium text-[0.8125rem] text-[var(--text-muted)]'>
2323
What you will learn
24-
</h2>
25-
<div className='flex flex-col gap-5'>
24+
</p>
25+
<div className='divide-y divide-[var(--border)]'>
2626
{items.map((item) => (
27-
<div key={item.title}>
28-
<p className='mb-1 font-semibold text-[var(--text-primary)] text-sm'>{item.title}</p>
27+
<div key={item.title} className='py-3.5 first:pt-0 last:pb-0'>
28+
<p className='mb-1 font-medium text-[var(--text-primary)] text-sm'>{item.title}</p>
2929
<p className='m-0 text-[var(--text-secondary)] text-sm leading-relaxed'>{item.body}</p>
3030
</div>
3131
))}

0 commit comments

Comments
 (0)