diff --git a/app/page.jsx b/app/page.jsx index 5d55f07..125bb98 100644 --- a/app/page.jsx +++ b/app/page.jsx @@ -3,10 +3,12 @@ import React from "react"; import { loadInvestigation, clearInvestigation } from "@/lib/storage/investigation-storage"; import Link from "next/link"; +import { useRouter } from "next/navigation"; const INVESTIGATION_ID = "case-1"; function Portfolio() { + const router = useRouter(); const [existing, setExisting] = React.useState(null); const [showRestartConfirm, setShowRestartConfirm] = React.useState(false); @@ -132,12 +134,16 @@ function Portfolio() { )} - { + e.preventDefault(); + const id = crypto.randomUUID(); + router.push(`/investigations/${id}`); + }} className="rounded-lg border-[2.5px] border-dashed border-teal-400 px-6 py-3 text-sm font-medium text-teal-700 hover:bg-teal-50 transition" > + Create new investigation - + ); } diff --git a/docs/current-handoff.md b/docs/current-handoff.md index 792c9da..e516463 100644 --- a/docs/current-handoff.md +++ b/docs/current-handoff.md @@ -418,6 +418,49 @@ Not migrated. `app/investigations/[id]/report/page.jsx` untouched. Remains a lat Untouched in this increment. All `clearInvestigation()` calls remain without an id argument (legacy singleton path). If identity-aware restart is needed, the next increment should pass `investigationId` through those clear calls. +## v0.60f — Allocate Investigation Identity on Create New + +**Purpose:** Replace the Portfolio's "+ Create new investigation" static link (`/investigations/case-1`) with an application-owned durable ID allocation that navigates to `/investigations/{id}` without persisting any empty Investigation. + +### What was implemented + +| File | Change | +|---|---| +| `app/page.jsx` | Changed "+ Create new investigation" from `` to a `