Fourth revision: OpenRouter, live tool stages, Explain layout, share sections
All checks were successful
Verify and publish V2 container / build-and-push (push) Successful in 29s
All checks were successful
Verify and publish V2 container / build-and-push (push) Successful in 29s
- Interactive blocks are encouraged by default; Explain gets a reduced library and never writes practice questions. - Assistant tool steps breathe while running, show live stages from generation and the Python check, and read in the past tense when done. - The assistant asks before searching the web when class materials do not cover a question; clarifying questions list every class's exams and never ask about format (always NCLEX). - Explain opens beside the question from 900px wide, moving the question left while open and back on the next one. - Generate dialog drops the practice set/exam switch (presets cover it) and the Generate buttons lose their icon. - Python check notes are green when every check passed, applied fixes neutral. - Share pages group by exam, then Quizzes, Flashcards, Notes, Class Materials, hiding empty groups; the class page uses the same order. "Documents" is now "Class Materials". - OpenRouter provider replaces the Ollama type; migration 6 turns Ollama connections into OpenAI-compatible ones at /v1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
c595e0ff2c
commit
25bc03ea75
45 changed files with 663 additions and 329 deletions
|
|
@ -480,8 +480,13 @@ function SharedDocument({ doc, token, nested, back }: { doc: PublicDocument; tok
|
|||
|
||||
const ITEM_ICON = { quiz: <BookOpen />, deck: <Layers />, note: <NotebookPen />, document: <FileText /> };
|
||||
|
||||
/** The same order and names as the owner's class page; a type with nothing in it is left out. */
|
||||
const KIND_ORDER = ['quiz', 'deck', 'note', 'document'] as const;
|
||||
const KIND_HEADING = { quiz: 'Quizzes', deck: 'Flashcards', note: 'Notes', document: 'Class Materials' } as const;
|
||||
|
||||
function SharedCollection({ data, token }: { data: PublicCollection; token: string }) {
|
||||
const groups = [{ id: null as string | null, name: '' }, ...data.folders].map((f) => ({ ...f, items: data.items.filter((i) => (f.id === null ? !i.folderId || !data.folders.some((x) => x.id === i.folderId) : i.folderId === f.id)) })).filter((g) => g.items.length > 0);
|
||||
// One section per exam in the class's order; material outside any exam comes last.
|
||||
const groups = [...data.folders, { id: null as string | null, name: 'Other' }].map((f) => ({ ...f, items: data.items.filter((i) => (f.id === null ? !i.folderId || !data.folders.some((x) => x.id === i.folderId) : i.folderId === f.id)) })).filter((g) => g.items.length > 0);
|
||||
return (
|
||||
<Frame>
|
||||
<div className={cx('border-l-[5px] border-tab pl-4', `tab-${data.color}`)}>
|
||||
|
|
@ -493,22 +498,36 @@ function SharedCollection({ data, token }: { data: PublicCollection; token: stri
|
|||
<div className="card mt-8 p-6 text-sm text-ink-2">Nothing has been added here yet.</div>
|
||||
) : (
|
||||
groups.map((g) => (
|
||||
<section key={g.id ?? 'none'} className="mt-7">
|
||||
{g.name && <h2 className="eyebrow mb-2.5">{g.name}</h2>}
|
||||
<ul className="card divide-y divide-line overflow-hidden">
|
||||
{g.items.map((i) => (
|
||||
<li key={`${i.kind}:${i.id}`}>
|
||||
<Link to={`/s/${token}/${i.kind}/${i.id}`} className="flex items-center gap-3 px-4 py-3.5 hover:bg-ink/4">
|
||||
<span className={cx('grid size-10 shrink-0 place-items-center rounded-[11px] [&>svg]:size-[18px]', i.kind === 'quiz' ? 'bg-accent-soft text-accent' : i.kind === 'deck' ? 'bg-marker/45 text-ink dark:bg-marker/20 dark:text-marker' : i.kind === 'document' ? 'bg-sunken text-ink-2' : 'bg-good-soft text-good')}>{ITEM_ICON[i.kind]}</span>
|
||||
<span className="min-w-0 flex-1">
|
||||
<span className="block truncate text-[15px] font-medium">{i.title}</span>
|
||||
<span className="text-xs text-ink-3">{i.kind === 'quiz' ? plural(i.count, 'question') : i.kind === 'deck' ? plural(i.count, 'card') : i.kind === 'document' ? `Document${i.count ? ` · ${plural(i.count, 'page')}` : ''}` : 'Note'}</span>
|
||||
</span>
|
||||
<ChevronRight className="size-4 text-ink-3" />
|
||||
</Link>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
<section key={g.id ?? 'none'} className="mt-7" aria-label={g.name || undefined}>
|
||||
{g.name && groups.length > 1 && <h2 className="mb-2.5 text-[17px] font-semibold">{g.name}</h2>}
|
||||
<div className="card overflow-hidden">
|
||||
{KIND_ORDER.filter((k) => g.items.some((i) => i.kind === k)).map((k, n) => {
|
||||
const items = g.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')}>
|
||||
{ITEM_ICON[k]}
|
||||
{KIND_HEADING[k]}
|
||||
<span className="num font-normal">{items.length}</span>
|
||||
</h3>
|
||||
<ul className="divide-y divide-line">
|
||||
{items.map((i) => (
|
||||
<li key={`${i.kind}:${i.id}`}>
|
||||
<Link to={`/s/${token}/${i.kind}/${i.id}`} className="flex items-center gap-3 px-4 py-3.5 hover:bg-ink/4">
|
||||
<span className={cx('grid size-10 shrink-0 place-items-center rounded-[11px] [&>svg]:size-[18px]', i.kind === 'quiz' ? 'bg-accent-soft text-accent' : i.kind === 'deck' ? 'bg-marker/45 text-ink dark:bg-marker/20 dark:text-marker' : i.kind === 'document' ? 'bg-sunken text-ink-2' : 'bg-good-soft text-good')}>{ITEM_ICON[i.kind]}</span>
|
||||
<span className="min-w-0 flex-1">
|
||||
<span className="block truncate text-[15px] font-medium">{i.title}</span>
|
||||
<span className="text-xs text-ink-3">{i.kind === 'quiz' ? plural(i.count, 'question') : i.kind === 'deck' ? plural(i.count, 'card') : i.kind === 'document' ? (i.count ? plural(i.count, 'page') : 'File') : 'Note'}</span>
|
||||
</span>
|
||||
<ChevronRight className="size-4 text-ink-3" />
|
||||
</Link>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</section>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</section>
|
||||
))
|
||||
)}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue