Skip to content

Commit f64f8df

Browse files
feat(design): auto-mode shows just the chosen hypothesis; per-section Edit made visible
Auto-mode #2 and #13, per the product decisions taken this session. #2 - Designs produced by the hands-free pipeline now read as finished output: only the hypothesis it selected is listed (the other candidates are noise once it has decided), and the choices panel is not shown. A persisted `autoGenerated` flag on the design content drives this, so a reload keeps the simplified view. #13 - Per-section editing already existed (DesignSectionContent -> onEditSection) but its Edit button was opacity-0 until you hovered that exact section, so it was effectively undiscoverable - hence "we only have the chat option". It is now a permanently visible bordered control on every section, giving the same section-scoped free-text editing the report has. Note on #2: in auto mode nobody answered any questions, so the values behind the protocol are entirely the model's and are now not surfaced anywhere on the design step. Flagged at decision time; recorded here so it's a known trade. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent fd16314 commit f64f8df

3 files changed

Lines changed: 19 additions & 4 deletions

File tree

app/[locale]/[workspaceid]/designs/[designId]/page.tsx

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,10 @@ export default function DesignDetailPage() {
524524
// Which design version the user is READING. null = the live design. This is a
525525
// view pointer only - browsing history never mutates or renumbers it.
526526
const [viewingVersionId, setViewingVersionId] = useState<string | null>(null)
527+
// True when THIS design was produced by the hands-free auto pipeline. Auto
528+
// runs surface a finished design: only the hypothesis it picked, and no
529+
// choices panel to review.
530+
const [autoGenerated, setAutoGenerated] = useState(false)
527531
const [clarifications, setClarifications] = useState<{
528532
problem?: ClarifyAnswer[]
529533
hypothesis?: ClarifyAnswer[]
@@ -771,6 +775,7 @@ export default function DesignDetailPage() {
771775
// page (the progress-event stream resets on remount).
772776
setPersistedLitTotalCandidates(content?.literatureStats?.totalCandidates)
773777
setPersistedLitRawCandidates(content?.literatureStats?.rawCandidates)
778+
setAutoGenerated(Boolean(content?.autoGenerated))
774779
if (content?.hypotheses) setHypotheses(content.hypotheses)
775780
if (content?.designs) {
776781
setGeneratedDesigns(content.designs)
@@ -1393,12 +1398,14 @@ export default function DesignDetailPage() {
13931398
}
13941399
// Persist (awaited) before simulating - the simulate route reads the
13951400
// design back from Firestore, so it must be written first.
1401+
setAutoGenerated(true)
13961402
await persistContent({
13971403
papers: autoPapers,
13981404
hypotheses: autoHyps,
13991405
designs: curDesigns,
14001406
approvedPhases: designApproved,
1401-
problem: curProblem
1407+
problem: curProblem,
1408+
autoGenerated: true
14021409
})
14031410

14041411
// 4 — Simulate + iterate until the success criteria is met (or a cap).
@@ -3547,7 +3554,11 @@ Rules:
35473554
onEdit={() => setRefineCheckpoint("hypothesis")}
35483555
/>
35493556
<HypothesesTab
3550-
hypotheses={hypotheses}
3557+
hypotheses={
3558+
autoGenerated && hypotheses.some(h => h.selected)
3559+
? hypotheses.filter(h => h.selected)
3560+
: hypotheses
3561+
}
35513562
papers={papers}
35523563
onToggle={handleToggleHypothesis}
35533564
onEdit={handleEditHypothesis}
@@ -3614,7 +3625,9 @@ Rules:
36143625
onRestoreVersion={handleRestoreDesignVersion}
36153626
viewingVersionId={viewingVersionId}
36163627
onViewVersion={handleViewDesignVersion}
3617-
onResolveAssumptions={handleResolveAssumptions}
3628+
onResolveAssumptions={
3629+
autoGenerated ? undefined : handleResolveAssumptions
3630+
}
36183631
onEditSection={handleEditSection}
36193632
/>
36203633
</>
@@ -7262,7 +7275,7 @@ function DesignSectionContent(props: {
72627275
<button
72637276
type="button"
72647277
onClick={enterEdit}
7265-
className="text-ink-3 hover:text-ink hover:bg-paper-2 ml-auto inline-flex h-7 items-center gap-1.5 rounded-md px-2 text-[12.5px] opacity-0 transition-opacity focus:opacity-100 group-hover/section:opacity-100"
7278+
className="text-ink-3 hover:text-ink hover:bg-paper-2 border-line ml-auto inline-flex h-7 shrink-0 items-center gap-1.5 rounded-md border px-2 text-[12.5px] transition-colors"
72667279
title="Edit section"
72677280
>
72687281
<IconPencil size={13} /> Edit

lib/design-agent.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -662,6 +662,8 @@ export interface DesignContentV2 {
662662
* that number lived only on the in-memory progress stream and vanished
663663
* on remount.
664664
*/
665+
/** Set when the hands-free auto pipeline produced this design. */
666+
autoGenerated?: boolean
665667
literatureStats?: {
666668
totalCandidates?: number
667669
/** Pre-dedup hits across all sources; what "N examined" reports. */

0 commit comments

Comments
 (0)