First revision: DeepSeek, numeric questions, background assistant, UI fixes
All checks were successful
Verify and publish V2 container / build-and-push (push) Successful in 1m2s

Providers and pricing
- Add a DeepSeek provider: thinking mode with low/high/max effort, reasoning_content
  replayed between tool steps, cache-hit usage, /models discovery and catalog prices.
- Fix "does not support tool calling": a rejected forced tool_choice (DeepSeek thinking
  mode) now asks for the call in the prompt; only a genuine no-tools 400 is "unsupported".
- Seven reasoning-effort levels (Off to Max) mapped per adapter.
- Cached-input price per model, cache-write and DeepSeek off-peak aware cost estimates.
- Built-in bge-small embedding model (transformers.js) as the semantic search default.

Quizzes
- Numeric (type-the-answer) questions: units ignored, optional ± tolerance; editor,
  runner, importer, templates and generation prompts.
- Quiz start screen instead of showing answers; navigator ring no longer clipped and
  key legend removed; clock only for timed exams; 7-point letter grades.

Assistant and generation
- Assistant turns run on the server independently of the browser, with re-attach and
  an explicit stop; drafts tray shows generations in progress.
- Per-chat model switcher, @-tagging of class materials, full-width assistant page and
  a smaller assistant button.
- Editable generation instructions and built-in presets, separate from the chatbot
  import instructions.

Other
- Dialog footer padding, keyboard hints removed, copy buttons work over plain HTTP,
  class and folder shares include documents.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Elijah 2026-11-15 12:48:17 -07:00
parent ccdad9728b
commit f0aabe4d5d
63 changed files with 3892 additions and 488 deletions

View file

@ -8,9 +8,10 @@ import { api, errorMessage } from '@/lib/api';
import { assistant, useAssistantState } from '@/lib/assistantStore';
import { qk, useClasses, useOverview, useRefresh } from '@/lib/queries';
import type { ClassInfo, SearchHit } from '@/lib/types';
import { cx, modKey, useDebounced, useHotkeys, useIsDesktop, useTheme, type ThemeChoice } from '@/lib/util';
import { cx, useDebounced, useHotkeys, useIsDesktop, useTheme, type ThemeChoice } from '@/lib/util';
import { Brand } from '@/pages/Auth';
import { Button, ClassDot, Dialog, Field, IconButton, Input, Kbd, Menu, MenuItem, MenuLabel, MenuSeparator, Spinner, Textarea } from '@/ui';
import { Button, ClassDot, Dialog, Field, IconButton, Input, Menu, MenuItem, MenuLabel, MenuSeparator, Spinner, Textarea, Tooltip } from '@/ui';
import { SidebarDrafts, useDraftNotifications } from '@/features/DraftsTray';
const AssistantPanel = lazy(() => import('@/features/AssistantPanel'));
@ -260,18 +261,6 @@ function CommandPalette({ open, onOpenChange, onNewClass }: { open: boolean; onO
))
)}
</div>
<div className="hidden items-center gap-4 border-t border-line px-5 py-2.5 text-xs text-ink-3 sm:flex">
<span className="flex items-center gap-1.5">
<Kbd>↑</Kbd>
<Kbd>↓</Kbd> to move
</span>
<span className="flex items-center gap-1.5">
<Kbd>Enter</Kbd> to open
</span>
<span className="flex items-center gap-1.5">
<Kbd>Esc</Kbd> to close
</span>
</div>
</div>
</Dialog>
);
@ -350,7 +339,6 @@ function Sidebar({ onSearch, onNewClass }: { onSearch: () => void; onNewClass: (
<button type="button" onClick={onSearch} className="flex h-9 w-full items-center gap-2 rounded-[10px] border border-line-strong bg-surface px-2.5 text-sm text-ink-3 shadow-1 hover:border-ink-3">
<Search className="size-4" aria-hidden />
<span className="flex-1 text-left">Search</span>
<Kbd>{modKey} K</Kbd>
</button>
</div>
<nav aria-label="Main" className="space-y-0.5 px-3">
@ -368,6 +356,8 @@ function Sidebar({ onSearch, onNewClass }: { onSearch: () => void; onNewClass: (
</NavItem>
</nav>
<SidebarDrafts />
<div className="mt-5 flex items-center justify-between px-5 pb-1.5">
<span className="eyebrow">Classes</span>
<IconButton label="New class" size="sm" onClick={onNewClass} className="-mr-2 size-7">
@ -539,6 +529,7 @@ export function Shell() {
const navigate = useNavigate();
const location = useLocation();
const { open: assistantOpen, seed } = useAssistantState();
useDraftNotifications();
const onAssistantPage = location.pathname.startsWith('/assistant');
// Study screens lay themselves out edge to edge and bring their own header and footer.
const immersive = location.pathname === '/review' || /^\/decks\/[^/]+\/cram$/.test(location.pathname);
@ -581,7 +572,8 @@ export function Shell() {
<Sidebar onSearch={() => setPaletteOpen(true)} onNewClass={() => setClassDialog(true)} />
<div className="flex min-w-0 flex-1 flex-col">
{!immersive && <MobileNav onSearch={() => setPaletteOpen(true)} onNewClass={() => setClassDialog(true)} />}
<main id="main" tabIndex={-1} className={cx('w-full flex-1 outline-none', !immersive && 'mx-auto max-w-[1080px] px-4 pt-6 pb-28 sm:px-8 lg:pt-10 lg:pb-16')}>
{/* The assistant page lays itself out edge to edge; other pages sit in the reading column. */}
<main id="main" tabIndex={-1} className={cx('w-full flex-1 outline-none', !immersive && !onAssistantPage && 'mx-auto max-w-[1080px] px-4 pt-6 pb-28 sm:px-8 lg:pt-10 lg:pb-16')}>
<Outlet />
</main>
</div>
@ -600,15 +592,16 @@ export function Shell() {
</aside>
)}
{!showDrawer && !onAssistantPage && !immersive && isDesktop && (
<button
type="button"
onClick={() => assistant.open()}
className="fixed right-6 bottom-6 z-20 flex h-11 items-center gap-2 rounded-full bg-ink pr-4 pl-3.5 text-sm font-medium text-paper shadow-2 transition-transform hover:-translate-y-0.5"
>
<Sparkles className="size-4 text-marker" />
Assistant
<span className="ml-1 rounded border border-paper/25 px-1 py-px font-mono text-[10px] text-paper/70">{modKey} J</span>
</button>
<Tooltip label="Assistant" side="left">
<button
type="button"
aria-label="Open the assistant"
onClick={() => assistant.open()}
className="fixed right-5 bottom-5 z-20 grid size-10 place-items-center rounded-full border border-line-strong bg-surface/90 text-ink-2 shadow-1 backdrop-blur transition-colors hover:border-ink-3 hover:text-ink"
>
<Sparkles className="size-[18px]" />
</button>
</Tooltip>
)}
<CommandPalette open={paletteOpen} onOpenChange={setPaletteOpen} onNewClass={() => setClassDialog(true)} />
<ClassDialog open={classDialog} onOpenChange={setClassDialog} />