- changeEmail validates and refuses an address another account owns (users.email is UNIQUE; a collision was a 500 inside the settings form). - /app/[id] no longer redirects a 'running' row to itself; it renders what exists and says the run was interrupted. - ScoreBar / OptionRow / VerdictBlock survive null numbers from the model instead of throwing and losing the block (seen live: '[openui] runtime/render-error: Component ScoreBar render failed'). - drop the ad-hoc render-debug scripts now that Playwright covers the browser. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
25 lines
1.4 KiB
TypeScript
25 lines
1.4 KiB
TypeScript
import { notFound } from "next/navigation";
|
|
import { requireUser } from "@/lib/auth";
|
|
import { getAnalysis } from "@/lib/db";
|
|
import { ReportView } from "@/components/report-view";
|
|
import { ExportButtons } from "@/components/export-buttons";
|
|
import { VerdictSummary } from "@/components/verdict-summary";
|
|
|
|
export default async function Stored({ params }: { params: Promise<{ id: string }> }) {
|
|
const u = await requireUser();
|
|
const a = getAnalysis((await params).id, u.id);
|
|
if (!a) notFound();
|
|
// Never redirect here: a row left "running" by a crashed process would bounce this page to itself forever.
|
|
const interrupted = a.status === "running";
|
|
return <main style={{ display: "grid", gap: "var(--qai-space-xl)" }}>
|
|
<h1 style={{ fontFamily: "var(--qai-font-display)", fontSize: "var(--qai-text-2xl)", margin: 0 }}>{a.title}</h1>
|
|
{interrupted && <p role="alert" style={{ color: "var(--qai-warn)" }}>
|
|
This run was interrupted before it finished — what is below is everything it managed to produce.
|
|
</p>}
|
|
{a.error && <p role="alert" style={{ color: "var(--qai-danger)" }}>{a.error}</p>}
|
|
{a.verdict && <VerdictSummary verdict={JSON.parse(a.verdict)} />}
|
|
{a.oul ? <><ExportButtons oul={a.oul} title={a.title} /><ReportView oul={a.oul} streaming={false} /></>
|
|
: <p className="label">No report was stored for this run.</p>}
|
|
</main>;
|
|
}
|