Address first round of feedback

- Flashcards: whole card flips on click (both sides), 3D turn, swipe-away on grading,
  streak chip and flame bursts, bigger cards on desktop, arrow keys for everything
- Review and browse keep the sidebar on desktop
- Quizzes: live practice score, partial-credit explanation, time limit for shared exams
- Class page: items grouped by type inside each folder
- Import: copyable, editable instructions for outside chatbots
- Assistant: reads notes and links to library items

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
Elijah 2026-11-11 18:30:07 -07:00
parent c59591ccb9
commit aed14cd04f
13 changed files with 769 additions and 216 deletions

View file

@ -377,6 +377,31 @@ export default function ClassPage() {
);
};
// Inside each section, items are grouped under a subheading per type.
const KIND_ORDER = ['quiz', 'deck', 'document', 'note'] as const;
const KIND_HEADING = { quiz: 'Quizzes', deck: 'Flashcards', document: 'Documents', note: 'Notes' } as const;
const KIND_HEADING_ICON = { quiz: <BookOpen />, deck: <Layers />, document: <FileText />, note: <NotebookPen /> } as const;
const section = (items: Item[]) => {
if (filter !== 'all') return <ul className="card divide-y divide-line overflow-hidden">{items.map(row)}</ul>;
return (
<div className="card overflow-hidden">
{KIND_ORDER.filter((k) => items.some((i) => i.kind === k)).map((k, n) => {
const list = items.filter((i) => i.kind === k);
return (
<section key={k} aria-label={KIND_HEADING[k]}>
<h3 className={cx('eyebrow flex items-center gap-2 border-b border-line bg-sunken/60 px-4 py-2 [&>svg]:size-3.5', n > 0 && 'border-t')}>
{KIND_HEADING_ICON[k]}
{KIND_HEADING[k]}
<span className="num font-normal">{list.length}</span>
</h3>
<ul className="divide-y divide-line">{list.map(row)}</ul>
</section>
);
})}
</div>
);
};
const loose = visible.filter((i) => !i.folderId || !data.folders.some((f) => f.id === i.folderId));
const searching = query.trim().length > 0 || filter !== 'all';
const isEmpty = data.items.length === 0 && uploads.length === 0;
@ -593,7 +618,7 @@ export default function ClassPage() {
</div>
) : (
<div className="space-y-4">
{loose.length > 0 && <ul className="card divide-y divide-line overflow-hidden">{loose.map(row)}</ul>}
{loose.length > 0 && section(loose)}
{data.folders.map((f) => {
const items = visible.filter((i) => i.folderId === f.id);
if (items.length === 0 && searching) return null;
@ -640,7 +665,7 @@ export default function ClassPage() {
</div>
{!isCollapsed &&
(items.length > 0 ? (
<ul className="card divide-y divide-line overflow-hidden">{items.map(row)}</ul>
section(items)
) : (
<div className="rounded-[14px] border border-dashed border-line-strong px-4 py-4 text-[13px] text-ink-3">Empty. Use "Move" on any item to put it here.</div>
))}