Separate settings per generation step; explain Practice and Exam on shares
All checks were successful
Verify and publish V2 container / build-and-push (push) Successful in 29s

- Settings -> AI: Planning, Writing, Python check and Second review each get
  their own model, reasoning effort, temperature and output limit, shown under
  Content generation. Unset choices follow Content generation, then the
  default model.
- Shared quizzes say what Practice and Exam mean under the mode toggle.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Elijah 2026-11-16 11:08:21 -07:00
parent 2454ab6e95
commit 10be5c39da
9 changed files with 128 additions and 36 deletions

View file

@ -12,7 +12,7 @@ import { Badge, Button, Callout, Dialog, EmptyState, Field, IconButton, Input, M
interface Meta {
adapters: AdapterMeta[];
tasks: Record<TaskName, { label: string; description: string }>;
tasks: Record<TaskName, { label: string; description: string; parent?: TaskName }>;
catalogUpdated: string;
}
@ -495,7 +495,27 @@ function ProviderCard({ provider, models, adapter, onEdit, reload }: { provider:
/* ------------------------------ tasks ------------------------------ */
function TaskRow({ name, label, description, config, models, resolved, onChange }: { name: TaskName | 'default'; label: string; description?: string; config: TaskConfig; models: AiModel[]; resolved?: string; onChange: (c: TaskConfig) => void }) {
function TaskRow({
name,
label,
description,
config,
models,
resolved,
inherits,
onChange,
}: {
name: TaskName | 'default';
label: string;
description?: string;
config: TaskConfig;
models: AiModel[];
resolved?: string;
/** A step of another task: unset choices use that task's (e.g. "Content generation"). */
inherits?: string;
onChange: (c: TaskConfig) => void;
}) {
const same = inherits ? `Same as ${inherits.toLowerCase()}` : null;
const model = models.find((m) => m.id === config.modelId);
const hasOverrides = config.temperature !== null || config.reasoningEffort !== null || config.maxOutputTokens !== null;
const byProvider = useMemo(() => {
@ -504,14 +524,14 @@ function TaskRow({ name, label, description, config, models, resolved, onChange
return [...map.entries()];
}, [models]);
return (
<div className="px-4 py-3.5">
<div className={cx('py-3.5 pr-4', inherits ? 'border-l-2 border-line-strong pl-7 sm:pl-9' : 'pl-4')}>
<div className="grid items-center gap-x-4 gap-y-2 sm:grid-cols-[1fr_280px]">
<div>
<div className="text-sm font-semibold">{label}</div>
{description && <div className="text-[13px] text-ink-2">{description}</div>}
</div>
<Select value={config.modelId ?? ''} onChange={(e) => onChange({ ...config, modelId: e.target.value || null })} aria-label={`Model for ${label}`}>
<option value="">{name === 'default' ? 'First available model' : `Same as default${resolved ? ` (${resolved})` : ''}`}</option>
<option value="">{name === 'default' ? 'First available model' : `${same ?? 'Same as default'}${resolved ? ` (${resolved})` : ''}`}</option>
{byProvider.map(([provider, list]) => (
<optgroup key={provider} label={provider}>
{list.map((m) => (
@ -529,7 +549,7 @@ function TaskRow({ name, label, description, config, models, resolved, onChange
<div className="mt-2.5 grid gap-3 sm:grid-cols-3">
<Field label="Reasoning effort" hint={model && !model.capabilities.reasoning ? 'Not supported by this model' : undefined}>
<Select value={config.reasoningEffort ?? ''} onChange={(e) => onChange({ ...config, reasoningEffort: (e.target.value || null) as TaskConfig['reasoningEffort'] })}>
<option value="">Model default</option>
<option value="">{same ?? 'Model default'}</option>
{REASONING_EFFORTS.map((e) => (
<option key={e.value} value={e.value}>
{e.label}
@ -538,10 +558,10 @@ function TaskRow({ name, label, description, config, models, resolved, onChange
</Select>
</Field>
<Field label="Temperature" hint={model && !model.capabilities.temperature ? 'Ignored by this model' : '0 to 2'}>
<Input type="number" min={0} max={2} step={0.1} value={config.temperature ?? ''} placeholder="Model default" onChange={(e) => onChange({ ...config, temperature: e.target.value === '' ? null : Math.max(0, Math.min(2, Number(e.target.value))) })} />
<Input type="number" min={0} max={2} step={0.1} value={config.temperature ?? ''} placeholder={same ?? 'Model default'} onChange={(e) => onChange({ ...config, temperature: e.target.value === '' ? null : Math.max(0, Math.min(2, Number(e.target.value))) })} />
</Field>
<Field label="Output limit" hint="Tokens per response">
<Input type="number" min={256} step={256} value={config.maxOutputTokens ?? ''} placeholder="Automatic" onChange={(e) => onChange({ ...config, maxOutputTokens: e.target.value === '' ? null : Math.max(256, Math.round(Number(e.target.value))) })} />
<Input type="number" min={256} step={256} value={config.maxOutputTokens ?? ''} placeholder={same ?? 'Automatic'} onChange={(e) => onChange({ ...config, maxOutputTokens: e.target.value === '' ? null : Math.max(256, Math.round(Number(e.target.value))) })} />
</Field>
</div>
</details>
@ -726,9 +746,24 @@ export default function AiSettings() {
<Section title="Which model does what">
<div className="card divide-y divide-line">
<TaskRow name="default" label="Default model" config={tasks.data.default} models={usable} onChange={(c) => saveTask('default', c)} />
{(Object.keys(meta.data.tasks) as TaskName[]).map((t) => (
<TaskRow key={t} name={t} label={meta.data!.tasks[t].label} description={meta.data!.tasks[t].description} config={tasks.data![t]} models={usable} resolved={status.data?.resolved[t]?.label} onChange={(c) => saveTask(t, c)} />
))}
{(Object.keys(meta.data.tasks) as TaskName[])
.filter((t) => tasks.data![t])
.map((t) => {
const parent = meta.data!.tasks[t].parent;
return (
<TaskRow
key={t}
name={t}
label={meta.data!.tasks[t].label}
description={meta.data!.tasks[t].description}
config={tasks.data![t]}
models={usable}
resolved={status.data?.resolved[t]?.label}
inherits={parent ? meta.data!.tasks[parent].label : undefined}
onChange={(c) => saveTask(t, c)}
/>
);
})}
</div>
</Section>
)}

View file

@ -447,7 +447,8 @@ export interface AiModel {
/** USD per million cached input tokens; null = the provider's usual cache discount. */
priceCachedIn: number | null;
}
export type TaskName = 'chat' | 'generate' | 'vision' | 'quick';
/** Tasks, and the steps of content generation (plan, write, check, review). */
export type TaskName = 'chat' | 'generate' | 'plan' | 'write' | 'check' | 'review' | 'vision' | 'quick';
/** Reasoning effort levels, lowest to highest. Each provider maps them onto what it accepts. */
export const REASONING_EFFORTS = [
{ value: 'none', label: 'Off' },

View file

@ -263,6 +263,9 @@ function SharedQuiz({ quiz, storageKey, back, explainUrl, onImmersive }: { quiz:
]}
className="w-full"
/>
<p className="mt-2 text-[13px] text-ink-2" aria-live="polite">
{prefs.mode === 'practice' ? 'Practice: see the answer and rationale right after each question.' : 'Exam: no answers along the way; submit at the end for your score and every rationale.'}
</p>
<div className="mt-4 space-y-3.5">
<Switch checked={prefs.shuffleQ} onChange={(v) => setPrefs((p) => ({ ...p, shuffleQ: v }))} label="Shuffle questions" />
<Switch checked={prefs.shuffleO} onChange={(v) => setPrefs((p) => ({ ...p, shuffleO: v }))} label="Shuffle answer choices" />