fix: harden phase summary open questions
This commit is contained in:
@@ -1,7 +1,14 @@
|
||||
import { Badge } from "../components/ui/badge";
|
||||
import { MarkdownView } from "./MarkdownView";
|
||||
import { statusBadgeClass } from "./statusBadge";
|
||||
import type { PhaseCheck, PhaseSection, PhaseSectionItem, PhaseSummaryV2, PhaseTable } from "./artifactV2";
|
||||
import {
|
||||
phaseOpenQuestionText,
|
||||
type PhaseCheck,
|
||||
type PhaseSection,
|
||||
type PhaseSectionItem,
|
||||
type PhaseSummaryV2,
|
||||
type PhaseTable,
|
||||
} from "./artifactV2";
|
||||
|
||||
const CODE_CHIP = "rounded-md bg-muted px-1.5 py-0.5 font-mono text-xs text-foreground/90";
|
||||
|
||||
@@ -69,6 +76,12 @@ function TableRecap({ table }: { table: PhaseTable }) {
|
||||
}
|
||||
|
||||
export function PhaseSummaryViewer({ phase }: { phase: PhaseSummaryV2 }) {
|
||||
const openQuestions = Array.isArray(phase.open_questions)
|
||||
? (phase.open_questions as unknown[])
|
||||
.map(phaseOpenQuestionText)
|
||||
.filter((question): question is string => question !== null)
|
||||
: [];
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-4">
|
||||
<h3 className="thot-label">
|
||||
@@ -101,11 +114,11 @@ export function PhaseSummaryViewer({ phase }: { phase: PhaseSummaryV2 }) {
|
||||
</div>
|
||||
)}
|
||||
|
||||
{phase.open_questions && phase.open_questions.length > 0 && (
|
||||
{openQuestions.length > 0 && (
|
||||
<div>
|
||||
<h4 className="thot-label mb-1">Open questions</h4>
|
||||
<ul className="list-disc space-y-1 pl-5 text-sm text-foreground/90 marker:text-muted-foreground">
|
||||
{phase.open_questions.map((q, i) => (
|
||||
{openQuestions.map((q, i) => (
|
||||
<li key={i}>{q}</li>
|
||||
))}
|
||||
</ul>
|
||||
|
||||
Reference in New Issue
Block a user