diff --git a/components/answered-card.tsx b/components/answered-card.tsx index a3f039a..bf859d7 100644 --- a/components/answered-card.tsx +++ b/components/answered-card.tsx @@ -58,7 +58,17 @@ export function AnsweredCard({ answer }: { answer: QuestionAnswerData }) { )} > {isQuiz && ( - + {sel && key && "✓"} {sel && !key && "✗"} {!sel && key && "✓"} @@ -84,7 +94,7 @@ export function AnsweredCard({ answer }: { answer: QuestionAnswerData }) { )} - {answer.text &&
“{answer.text}”
} + {answer.text &&
“{answer.text}”
} {answer.dontKnow && isQuiz &&
Answered “I don't know”.
} {answer.note && ( @@ -92,14 +102,16 @@ export function AnsweredCard({ answer }: { answer: QuestionAnswerData }) { Your thinking - {answer.note} + {answer.note} )} {isQuiz && answer.explanation && (
Why: - {answer.explanation} + {/* The markdown wrapper must go truly inline — a block

after the + "Why:" label created the oversized leading gap (owner's fix list). */} + {answer.explanation}

)} diff --git a/components/composer.tsx b/components/composer.tsx index 1736f42..d940e0f 100644 --- a/components/composer.tsx +++ b/components/composer.tsx @@ -59,7 +59,7 @@ export function Composer({ placeholder="Ask, answer, or steer the lesson…" autoFocus={autoFocus} rows={1} - className="field-sizing-content max-h-48 min-h-10 flex-1 resize-none bg-transparent px-2.5 py-2 text-sm outline-none placeholder:text-muted-foreground" + className="field-sizing-content font-prose max-h-48 min-h-10 flex-1 resize-none bg-transparent px-2.5 py-2 text-sm outline-none placeholder:text-muted-foreground" /> {verdict && !busy ? ( // The plan verdict (docs/probe-teach-split.md §4): accept diff --git a/components/home.tsx b/components/home.tsx index 510e7f7..24ba138 100644 --- a/components/home.tsx +++ b/components/home.tsx @@ -5,6 +5,8 @@ import { useRouter } from "next/navigation"; import { CornerDownLeftIcon } from "lucide-react"; import { GraphView } from "@/components/graph-view"; import { SidebarToggle } from "@/components/sidebar"; +import { StatsBar } from "@/components/stats-bar"; +import type { ChatSettings, TurnUsage } from "@/src/core"; /** * Home — the knowledge graph is the main view (placeholder until the graph @@ -15,6 +17,10 @@ export function Home() { const router = useRouter(); const [topic, setTopic] = useState(""); const [busy, setBusy] = useState(false); + // The model+thinking selection made pre-chat — lifted from the StatsBar's + // ModelControl, carried to the chat POST then PUT-on-create (the model + // picker defers its save when chatId is empty; see components/model-picker). + const [settings, setSettings] = useState(undefined); const start = async () => { const t = topic.trim(); @@ -27,6 +33,14 @@ export function Home() { body: JSON.stringify({ title: t }), }); const { id } = (await res.json()) as { id: string }; + if (settings) { + // Best-effort persist — the selection was made pre-chat. + await fetch(`/api/chats/${id}/settings`, { + method: "PUT", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify(settings), + }).catch(() => {}); + } router.push(`/chat/${id}?prompt=${encodeURIComponent(t)}`); } catch { setBusy(false); @@ -46,7 +60,9 @@ export function Home() { {/* New session — same floating blob as the chat composer. */}
-
+ {/* Matches chat.tsx's DOCK geometry (max-w-[46rem] px-4) so nothing + shifts when a session starts (owner). */} +
{ @@ -77,6 +93,15 @@ export function Home() { + {/* Same as the chat view's under-composer stats bar (owner) — no + session yet, so money/context fold as "—"; the model + + thinking control still works (deferred save). */} +
diff --git a/components/model-picker.tsx b/components/model-picker.tsx index 64c6d21..d34efdb 100644 --- a/components/model-picker.tsx +++ b/components/model-picker.tsx @@ -117,6 +117,13 @@ export function ModelControl({ const save = useCallback( async (next: ChatSettings) => { setError(null); + // Home view (pre-chat): defer — the selection rides along on the + // chat POST and is PUT after creation (onSaved is still lifted). + if (!chatId) { + onSaved(next); + setOpen(null); + return; + } try { const res = await fetch(`/api/chats/${chatId}/settings`, { method: "PUT", diff --git a/components/question-dock.tsx b/components/question-dock.tsx index 65ef187..bb15320 100644 --- a/components/question-dock.tsx +++ b/components/question-dock.tsx @@ -387,7 +387,7 @@ function QuestionDockForm({ setSel((prev) => (prev.otherSelected ? prev : toggleOther(selectMode, prev))); }} placeholder="Type your own answer…" - className="w-full min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground" + className="font-prose w-full min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground" onClick={(e) => e.stopPropagation()} /> @@ -429,7 +429,7 @@ function QuestionDockForm({ }} placeholder="Type your answer…" rows={1} - className="field-sizing-content max-h-48 min-h-10 w-full resize-none bg-transparent px-2.5 py-2 text-sm outline-none placeholder:text-muted-foreground" + className="field-sizing-content font-prose max-h-48 min-h-10 w-full resize-none bg-transparent px-2.5 py-2 text-sm outline-none placeholder:text-muted-foreground" /> ) : (