Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

💄 style(goal): open each 验收标准 criterion's check in the side Portal (#21612)

Arvin Xuc96a47a93781
diff --git a/locales/ar/chat.json b/locales/ar/chat.json
index c8e0582787f..ac67f8f09dd 100644
--- a/locales/ar/chat.json
+++ b/locales/ar/chat.json
@@ -1066,7 +1066,6 @@
"goalProcess.result.continueSeed.open": "لا يزال مفتوحًا:",
"goalProcess.result.continueSeed.requirement": "المتطلب الأصلي:",
"goalProcess.result.continueSeed.title": "تابع: {{title}}",
- "goalProcess.result.criteria.document": "وثيقة الأدلة",
"goalProcess.result.criteria.empty": "لا يحتوي هذا الهدف على معايير قبول منظمة.",
"goalProcess.result.criteria.evidenceCount": "{{count}} دليل",
"goalProcess.result.criteria.state.failed": "لم يتم الوفاء به",
diff --git a/locales/bg-BG/chat.json b/locales/bg-BG/chat.json
index eed85e3e0a7..56a980bd0bf 100644
--- a/locales/bg-BG/chat.json
+++ b/locales/bg-BG/chat.json
@@ -1066,7 +1066,6 @@
"goalProcess.result.continueSeed.open": "Все още отворено:",
"goalProcess.result.continueSeed.requirement": "Оригинално изискване:",
"goalProcess.result.continueSeed.title": "Продължи: {{title}}",
- "goalProcess.result.criteria.document": "Документ с доказателства",
"goalProcess.result.criteria.empty": "Тази цел няма структурирани критерии за приемане.",
"goalProcess.result.criteria.evidenceCount": "{{count}} доказателства",
"goalProcess.result.criteria.state.failed": "Не е изпълнено",
diff --git a/locales/de-DE/chat.json b/locales/de-DE/chat.json
index fe9e6cd5475..3a0712420c4 100644
--- a/locales/de-DE/chat.json
+++ b/locales/de-DE/chat.json
@@ -1066,7 +1066,6 @@
"goalProcess.result.continueSeed.open": "Noch offen:",
"goalProcess.result.continueSeed.requirement": "Ursprüngliche Anforderung:",
"goalProcess.result.continueSeed.title": "Fortsetzen: {{title}}",
- "goalProcess.result.criteria.document": "Beweisdokument",
"goalProcess.result.criteria.empty": "Dieses Ziel hat keine strukturierten Akzeptanzkriterien.",
"goalProcess.result.criteria.evidenceCount": "{{count}} Beweise",
"goalProcess.result.criteria.state.failed": "Nicht erfüllt",
diff --git a/locales/en-US/chat.json b/locales/en-US/chat.json
index 1f2547ba35b..4708bd843b2 100644
--- a/locales/en-US/chat.json
+++ b/locales/en-US/chat.json
@@ -1084,7 +1084,6 @@
"goalProcess.result.continueSeed.open": "Still open:",
"goalProcess.result.continueSeed.requirement": "Original requirement:",
"goalProcess.result.continueSeed.title": "Continue: {{title}}",
- "goalProcess.result.criteria.document": "Evidence document",
"goalProcess.result.criteria.empty": "This Goal has no structured acceptance criteria.",
"goalProcess.result.criteria.evidenceCount": "{{count}} evidence",
"goalProcess.result.criteria.state.failed": "Not met",
diff --git a/locales/es-ES/chat.json b/locales/es-ES/chat.json
index 981fdcda882..316e4750af0 100644
--- a/locales/es-ES/chat.json
+++ b/locales/es-ES/chat.json
@@ -1066,7 +1066,6 @@
"goalProcess.result.continueSeed.open": "Aún abierto:",
"goalProcess.result.continueSeed.requirement": "Requisito original:",
"goalProcess.result.continueSeed.title": "Continuar: {{title}}",
- "goalProcess.result.criteria.document": "Documento de evidencia",
"goalProcess.result.criteria.empty": "Este objetivo no tiene criterios de aceptación estructurados.",
"goalProcess.result.criteria.evidenceCount": "{{count}} evidencias",
"goalProcess.result.criteria.state.failed": "No cumplido",
diff --git a/locales/fa-IR/chat.json b/locales/fa-IR/chat.json
index 2030a4e6b4b..e88610033a5 100644
--- a/locales/fa-IR/chat.json
+++ b/locales/fa-IR/chat.json
@@ -1066,7 +1066,6 @@
"goalProcess.result.continueSeed.open": "هنوز باز است:",
"goalProcess.result.continueSeed.requirement": "نیاز اصلی:",
"goalProcess.result.continueSeed.title": "ادامه: {{title}}",
- "goalProcess.result.criteria.document": "سند شواهد",
"goalProcess.result.criteria.empty": "این هدف هیچ معیار پذیرش ساختاری ندارد.",
"goalProcess.result.criteria.evidenceCount": "{{count}} شواهد",
"goalProcess.result.criteria.state.failed": "برآورده نشده",
diff --git a/locales/fr-FR/chat.json b/locales/fr-FR/chat.json
index e4462f172ce..7911c88bac6 100644
--- a/locales/fr-FR/chat.json
+++ b/locales/fr-FR/chat.json
@@ -1066,7 +1066,6 @@
"goalProcess.result.continueSeed.open": "Toujours ouvert :",
"goalProcess.result.continueSeed.requirement": "Exigence initiale :",
"goalProcess.result.continueSeed.title": "Continuer : {{title}}",
- "goalProcess.result.criteria.document": "Document de preuve",
"goalProcess.result.criteria.empty": "Cet objectif n'a pas de critères d'acceptation structurés.",
"goalProcess.result.criteria.evidenceCount": "{{count}} preuve",
"goalProcess.result.criteria.state.failed": "Non atteint",
diff --git a/locales/it-IT/chat.json b/locales/it-IT/chat.json
index 9d9eb109c25..8fb2d23118b 100644
--- a/locales/it-IT/chat.json
+++ b/locales/it-IT/chat.json
@@ -1066,7 +1066,6 @@
"goalProcess.result.continueSeed.open": "Ancora aperto:",
"goalProcess.result.continueSeed.requirement": "Requisito originale:",
"goalProcess.result.continueSeed.title": "Continua: {{title}}",
- "goalProcess.result.criteria.document": "Documento di prova",
"goalProcess.result.criteria.empty": "Questo obiettivo non ha criteri di accettazione strutturati.",
"goalProcess.result.criteria.evidenceCount": "{{count}} prove",
"goalProcess.result.criteria.state.failed": "Non soddisfatto",
diff --git a/locales/ja-JP/chat.json b/locales/ja-JP/chat.json
index d291bb0b5fd..b99709df703 100644
--- a/locales/ja-JP/chat.json
+++ b/locales/ja-JP/chat.json
@@ -1066,7 +1066,6 @@
"goalProcess.result.continueSeed.open": "まだ開いている:",
"goalProcess.result.continueSeed.requirement": "元の要件:",
"goalProcess.result.continueSeed.title": "続行: {{title}}",
- "goalProcess.result.criteria.document": "証拠文書",
"goalProcess.result.criteria.empty": "この目標には構造化された承認基準がありません。",
"goalProcess.result.criteria.evidenceCount": "{{count}} 件の証拠",
"goalProcess.result.criteria.state.failed": "満たされていない",
diff --git a/locales/ko-KR/chat.json b/locales/ko-KR/chat.json
index 5edaf227fcf..1cfac996ebd 100644
--- a/locales/ko-KR/chat.json
+++ b/locales/ko-KR/chat.json
@@ -1066,7 +1066,6 @@
"goalProcess.result.continueSeed.open": "여전히 열려 있음:",
"goalProcess.result.continueSeed.requirement": "원래 요구사항:",
"goalProcess.result.continueSeed.title": "계속: {{title}}",
- "goalProcess.result.criteria.document": "증거 문서",
"goalProcess.result.criteria.empty": "이 목표에는 구조화된 수락 기준이 없습니다.",
"goalProcess.result.criteria.evidenceCount": "{{count}} 증거",
"goalProcess.result.criteria.state.failed": "충족되지 않음",
diff --git a/locales/nl-NL/chat.json b/locales/nl-NL/chat.json
index 4a3b2dc33e1..46e640f0637 100644
--- a/locales/nl-NL/chat.json
+++ b/locales/nl-NL/chat.json
@@ -1066,7 +1066,6 @@
"goalProcess.result.continueSeed.open": "Nog open:",
"goalProcess.result.continueSeed.requirement": "Oorspronkelijke vereiste:",
"goalProcess.result.continueSeed.title": "Doorgaan: {{title}}",
- "goalProcess.result.criteria.document": "Bewijsdocument",
"goalProcess.result.criteria.empty": "Dit doel heeft geen gestructureerde acceptatiecriteria.",
"goalProcess.result.criteria.evidenceCount": "{{count}} bewijs",
"goalProcess.result.criteria.state.failed": "Niet gehaald",
diff --git a/locales/pl-PL/chat.json b/locales/pl-PL/chat.json
index 96a76050567..a60072cab8a 100644
--- a/locales/pl-PL/chat.json
+++ b/locales/pl-PL/chat.json
@@ -1066,7 +1066,6 @@
"goalProcess.result.continueSeed.open": "Wciąż otwarte:",
"goalProcess.result.continueSeed.requirement": "Oryginalne wymaganie:",
"goalProcess.result.continueSeed.title": "Kontynuuj: {{title}}",
- "goalProcess.result.criteria.document": "Dokument dowodowy",
"goalProcess.result.criteria.empty": "Ten Cel nie ma zdefiniowanych kryteriów akceptacji.",
"goalProcess.result.criteria.evidenceCount": "{{count}} dowodów",
"goalProcess.result.criteria.state.failed": "Nie spełnione",
diff --git a/locales/pt-BR/chat.json b/locales/pt-BR/chat.json
index 295332cf7dc..35407646deb 100644
--- a/locales/pt-BR/chat.json
+++ b/locales/pt-BR/chat.json
@@ -1066,7 +1066,6 @@
"goalProcess.result.continueSeed.open": "Ainda aberto:",
"goalProcess.result.continueSeed.requirement": "Requisito original:",
"goalProcess.result.continueSeed.title": "Continuar: {{title}}",
- "goalProcess.result.criteria.document": "Documento de evidências",
"goalProcess.result.criteria.empty": "Este Objetivo não possui critérios de aceitação estruturados.",
"goalProcess.result.criteria.evidenceCount": "{{count}} evidências",
"goalProcess.result.criteria.state.failed": "Não atendido",
diff --git a/locales/ru-RU/chat.json b/locales/ru-RU/chat.json
index 178e842db9a..e8740a2d24a 100644
--- a/locales/ru-RU/chat.json
+++ b/locales/ru-RU/chat.json
@@ -1066,7 +1066,6 @@
"goalProcess.result.continueSeed.open": "Все еще открыто:",
"goalProcess.result.continueSeed.requirement": "Исходное требование:",
"goalProcess.result.continueSeed.title": "Продолжить: {{title}}",
- "goalProcess.result.criteria.document": "Документ доказательств",
"goalProcess.result.criteria.empty": "У этой цели нет структурированных критериев принятия.",
"goalProcess.result.criteria.evidenceCount": "{{count}} доказательств",
"goalProcess.result.criteria.state.failed": "Не выполнено",
diff --git a/locales/tr-TR/chat.json b/locales/tr-TR/chat.json
index 1ce7caf3d16..9e0527d70b1 100644
--- a/locales/tr-TR/chat.json
+++ b/locales/tr-TR/chat.json
@@ -1066,7 +1066,6 @@
"goalProcess.result.continueSeed.open": "Hala açık:",
"goalProcess.result.continueSeed.requirement": "Orijinal gereklilik:",
"goalProcess.result.continueSeed.title": "Devam et: {{title}}",
- "goalProcess.result.criteria.document": "Kanıt belgesi",
"goalProcess.result.criteria.empty": "Bu Hedefin yapılandırılmış kabul kriterleri yok.",
"goalProcess.result.criteria.evidenceCount": "{{count}} kanıt",
"goalProcess.result.criteria.state.failed": "Karşılanmadı",
diff --git a/locales/vi-VN/chat.json b/locales/vi-VN/chat.json
index a568737bbf3..bd70b86639f 100644
--- a/locales/vi-VN/chat.json
+++ b/locales/vi-VN/chat.json
@@ -1066,7 +1066,6 @@
"goalProcess.result.continueSeed.open": "Vẫn mở:",
"goalProcess.result.continueSeed.requirement": "Yêu cầu ban đầu:",
"goalProcess.result.continueSeed.title": "Tiếp tục: {{title}}",
- "goalProcess.result.criteria.document": "Tài liệu bằng chứng",
"goalProcess.result.criteria.empty": "Mục tiêu này không có tiêu chí chấp nhận có cấu trúc.",
"goalProcess.result.criteria.evidenceCount": "{{count}} bằng chứng",
"goalProcess.result.criteria.state.failed": "Không đạt",
diff --git a/locales/zh-CN/chat.json b/locales/zh-CN/chat.json
index 7c9fda42336..4e2494c27cb 100644
--- a/locales/zh-CN/chat.json
+++ b/locales/zh-CN/chat.json
@@ -1084,7 +1084,6 @@
"goalProcess.result.continueSeed.open": "仍未完成:",
"goalProcess.result.continueSeed.requirement": "原始要求:",
"goalProcess.result.continueSeed.title": "继续:{{title}}",
- "goalProcess.result.criteria.document": "证据文档",
"goalProcess.result.criteria.empty": "这个目标没有结构化的验收标准。",
"goalProcess.result.criteria.evidenceCount": "{{count}} 项证据",
"goalProcess.result.criteria.state.failed": "未达成",
diff --git a/locales/zh-TW/chat.json b/locales/zh-TW/chat.json
index e8cf646979d..e0a17ce760b 100644
--- a/locales/zh-TW/chat.json
+++ b/locales/zh-TW/chat.json
@@ -1066,7 +1066,6 @@
"goalProcess.result.continueSeed.open": "仍然開放:",
"goalProcess.result.continueSeed.requirement": "原始需求:",
"goalProcess.result.continueSeed.title": "繼續:{{title}}",
- "goalProcess.result.criteria.document": "證據文件",
"goalProcess.result.criteria.empty": "此目標沒有結構化的接受標準。",
"goalProcess.result.criteria.evidenceCount": "{{count}} 條證據",
"goalProcess.result.criteria.state.failed": "未滿足",
diff --git a/packages/locales/src/default/chat.ts b/packages/locales/src/default/chat.ts
index fceb6404be4..f5bae73f199 100644
--- a/packages/locales/src/default/chat.ts
+++ b/packages/locales/src/default/chat.ts
@@ -2684,7 +2684,6 @@ export default {
'goalProcess.result.continueSeed.open': 'Still open:',
'goalProcess.result.continueSeed.requirement': 'Original requirement:',
'goalProcess.result.continueSeed.title': 'Continue: {{title}}',
- 'goalProcess.result.criteria.document': 'Evidence document',
'goalProcess.result.criteria.empty': 'This Goal has no structured acceptance criteria.',
'goalProcess.result.criteria.evidenceCount': '{{count}} evidence',
'goalProcess.result.criteria.state.failed': 'Not met',
diff --git a/src/features/AgentGoals/ProcessControl/GoalCriteriaResults.tsx b/src/features/AgentGoals/ProcessControl/GoalCriteriaResults.tsx
index bad2e070137..001c8d53540 100644
--- a/src/features/AgentGoals/ProcessControl/GoalCriteriaResults.tsx
+++ b/src/features/AgentGoals/ProcessControl/GoalCriteriaResults.tsx
@@ -1,54 +1,29 @@
'use client';
-import {
- createStaticStyles,
- cssVar,
- cx,
- Flexbox,
- Icon,
- Image,
- Markdown,
- Skeleton,
- Text,
-} from '@lobehub/ui';
-import {
- ChevronRight,
- CircleCheck,
- CircleDashed,
- CircleX,
- FileText,
- Paperclip,
-} from 'lucide-react';
-import { type ReactNode, useState } from 'react';
+import { createStaticStyles, cssVar, cx, Flexbox, Icon, Skeleton, Text } from '@lobehub/ui';
+import { ChevronRight, CircleCheck, CircleDashed, CircleX } from 'lucide-react';
+import { type ReactNode } from 'react';
import { useTranslation } from 'react-i18next';
import AsyncError from '@/components/AsyncError';
-import { useEntityMarkdown } from '@/features/EntityLink';
import { useChatStore } from '@/store/chat';
+import { chatPortalSelectors } from '@/store/chat/selectors';
import { SectionTitle } from './GoalResultFollowUps';
-import type { CriterionOutcome, CriterionOutcomeState, EvidenceLike } from './goalResultState';
+import type { CriterionOutcome, CriterionOutcomeState } from './goalResultState';
/**
* 验收标准 × 结果 — each criterion the Goal was accepted against, next to what
- * the latest acceptance round found: met or not, and why when it was not. A row
- * opens into its evidence — screenshots, written evidence, the documents it
- * cites — in place, without framing the content in another card. The round's own
- * write-up for a met criterion belongs to the acceptance, not to this summary.
+ * the latest round of the Goal-level acceptance found: met or not, and why when
+ * it was not. Every criterion is one check of that acceptance, so a row opens
+ * that check — its evidence, reasoning and review — in the side Portal, the same
+ * view the acceptance page itself opens, rather than a thinner copy inlined here.
*/
const styles = createStaticStyles(({ css }) => ({
arrow: css`
flex: none;
color: ${cssVar.colorTextQuaternary};
- transition: transform 0.2s;
- `,
- arrowOpen: css`
- transform: rotate(90deg);
- `,
- evidence: css`
- padding-block: 0 12px;
- padding-inline: 28px 0;
`,
item: css`
&:not(:last-child) {
@@ -80,19 +55,12 @@ const styles = createStaticStyles(({ css }) => ({
outline-offset: -2px;
}
`,
- docLink: css`
- cursor: pointer;
-
- width: fit-content;
- padding: 0;
- border: none;
-
- color: ${cssVar.colorPrimary};
-
- background: none;
+ /* The criterion whose check the side Portal is showing. */
+ rowActive: css`
+ background: ${cssVar.colorFillTertiary};
&:hover {
- text-decoration: underline;
+ background: ${cssVar.colorFillTertiary};
}
`,
}));
@@ -109,86 +77,17 @@ const STATE_COLOR: Record<CriterionOutcomeState, string> = {
unjudged: cssVar.colorTextQuaternary,
};
-const IMAGE_TYPES = new Set(['screenshot', 'gif']);
-
-const EvidenceItem = ({ item }: { item: EvidenceLike }) => {
- const { t } = useTranslation('chat');
- const openDocument = useChatStore((s) => s.openDocument);
- const markdownProps = useEntityMarkdown();
- const caption = item.description || item.fileName;
-
- if (IMAGE_TYPES.has(item.type) && item.fileUrl)
- return (
- <Flexbox gap={4}>
- <Image
- preview
- alt={caption ?? item.type}
- loading={'lazy'}
- src={item.fileUrl}
- style={{ maxHeight: 360, objectFit: 'contain', width: '100%' }}
- variant={'borderless'}
- />
- {caption && (
- <Text fontSize={12} type={'secondary'}>
- {caption}
- </Text>
- )}
- </Flexbox>
- );
-
- if (item.type === 'video' && item.fileUrl)
- return <video controls src={item.fileUrl} style={{ display: 'block', width: '100%' }} />;
-
- if (item.content)
- return (
- <Flexbox gap={4}>
- {caption && (
- <Text fontSize={12} type={'secondary'}>
- {caption}
- </Text>
- )}
- <Markdown fontSize={13} variant={'chat'} {...markdownProps}>
- {item.content}
- </Markdown>
- </Flexbox>
- );
-
- if (item.documentId)
- return (
- <Flexbox horizontal align={'center'} gap={6}>
- <Icon color={cssVar.colorTextTertiary} icon={FileText} size={14} />
- <button
- className={styles.docLink}
- type={'button'}
- onClick={() => openDocument(item.documentId!)}
- >
- {caption || t('goalProcess.result.criteria.document')}
- </button>
- </Flexbox>
- );
-
- if (item.fileUrl)
- return (
- <Flexbox horizontal align={'center'} gap={6}>
- <Icon color={cssVar.colorTextTertiary} icon={Paperclip} size={14} />
- <a href={item.fileUrl} rel={'noopener noreferrer'} target={'_blank'}>
- {caption || item.type}
- </a>
- </Flexbox>
- );
-
- return caption ? (
- <Text fontSize={13} type={'secondary'}>
- {caption}
- </Text>
- ) : null;
-};
+interface CriterionRowProps {
+ active: boolean;
+ index: number;
+ /** Opens the criterion's check in the side Portal; absent when no round judged it. */
+ onOpen?: () => void;
+ outcome: CriterionOutcome;
+}
-const CriterionRow = ({ index, outcome }: { index: number; outcome: CriterionOutcome }) => {
+const CriterionRow = ({ active, index, onOpen, outcome }: CriterionRowProps) => {
const { t } = useTranslation('chat');
- const [open, setOpen] = useState(false);
const { criterion, evidence, reason, state } = outcome;
- const openable = evidence.length > 0;
const color = STATE_COLOR[state];
return (
@@ -196,10 +95,10 @@ const CriterionRow = ({ index, outcome }: { index: number; outcome: CriterionOut
<Flexbox
horizontal
align={'flex-start'}
- as={openable ? 'button' : 'div'}
- className={cx(styles.row, openable && styles.rowOpenable)}
+ as={onOpen ? 'button' : 'div'}
+ className={cx(styles.row, onOpen && styles.rowOpenable, active && styles.rowActive)}
gap={10}
- {...(openable ? { onClick: () => setOpen(!open), type: 'button' as const } : {})}
+ {...(onOpen ? { onClick: onOpen, type: 'button' as const } : {})}
>
<Icon
color={color}
@@ -227,36 +126,29 @@ const CriterionRow = ({ index, outcome }: { index: number; outcome: CriterionOut
</Text>
)}
</Flexbox>
- {openable && (
+ {onOpen && (
<Flexbox
horizontal
align={'center'}
gap={4}
style={{ flex: 'none', marginBlockStart: 2 }}
>
- <Text fontSize={12} type={'secondary'}>
- {t('goalProcess.result.criteria.evidenceCount', { count: evidence.length })}
- </Text>
- <Icon
- className={cx(styles.arrow, open && styles.arrowOpen)}
- icon={ChevronRight}
- size={14}
- />
+ {evidence.length > 0 && (
+ <Text fontSize={12} type={'secondary'}>
+ {t('goalProcess.result.criteria.evidenceCount', { count: evidence.length })}
+ </Text>
+ )}
+ <Icon className={styles.arrow} icon={ChevronRight} size={14} />
</Flexbox>
)}
</Flexbox>
- {open && (
- <Flexbox className={styles.evidence} gap={12}>
- {evidence.map((item) => (
- <EvidenceItem item={item} key={item.id} />
- ))}
- </Flexbox>
- )}
</div>
);
};
interface GoalCriteriaResultsProps {
+ /** The Goal-level acceptance the criteria were judged in. */
+ acceptanceId?: string;
/** The per-task acceptance group, rendered as this section's continuation. */
children?: ReactNode;
/** The acceptance or criteria read failed: its outcomes are not a result. */
@@ -267,6 +159,7 @@ interface GoalCriteriaResultsProps {
}
const GoalCriteriaResults = ({
+ acceptanceId,
children,
error,
loading,
@@ -274,6 +167,12 @@ const GoalCriteriaResults = ({
outcomes,
}: GoalCriteriaResultsProps) => {
const { t } = useTranslation('chat');
+ const openAcceptanceCheck = useChatStore((state) => state.openAcceptanceCheck);
+ const openedCheck = useChatStore((state) =>
+ chatPortalSelectors.showPortal(state)
+ ? chatPortalSelectors.acceptanceCheckPortal(state)
+ : undefined,
+ );
const met = outcomes.filter((outcome) => outcome.state === 'passed').length;
return (
@@ -304,9 +203,26 @@ const GoalCriteriaResults = ({
</Text>
) : (
<Flexbox>
- {outcomes.map((outcome, index) => (
- <CriterionRow index={index} key={outcome.criterion.id} outcome={outcome} />
- ))}
+ {outcomes.map((outcome, index) => {
+ const { checkId } = outcome;
+ return (
+ <CriterionRow
+ index={index}
+ key={outcome.criterion.id}
+ outcome={outcome}
+ active={
+ !!checkId &&
+ openedCheck?.acceptanceId === acceptanceId &&
+ openedCheck?.checkId === checkId
+ }
+ onOpen={
+ acceptanceId && checkId
+ ? () => openAcceptanceCheck(acceptanceId, checkId)
+ : undefined
+ }
+ />
+ );
+ })}
</Flexbox>
)}
{children}
diff --git a/src/features/AgentGoals/ProcessControl/GoalResult.tsx b/src/features/AgentGoals/ProcessControl/GoalResult.tsx
index 4eda2af11db..6dbe2a2b106 100644
--- a/src/features/AgentGoals/ProcessControl/GoalResult.tsx
+++ b/src/features/AgentGoals/ProcessControl/GoalResult.tsx
@@ -112,6 +112,7 @@ const GoalResult = ({ graph, onSelect }: GoalResultProps) => {
</div>
<div {...anchorProps('criteria', t('goalProcess.result.criteria.title'))}>
<GoalCriteriaResults
+ acceptanceId={data.acceptanceId}
error={data.error}
loading={data.isLoading}
outcomes={data.outcomes}
diff --git a/src/features/AgentGoals/ProcessControl/goalResultState.test.ts b/src/features/AgentGoals/ProcessControl/goalResultState.test.ts
index b1a3ea5928b..7980ed1fba5 100644
--- a/src/features/AgentGoals/ProcessControl/goalResultState.test.ts
+++ b/src/features/AgentGoals/ProcessControl/goalResultState.test.ts
@@ -445,6 +445,9 @@ describe('buildCriterionOutcomes', () => {
expect(outcomes[1].summary).toBe('Two claims have no source');
expect(outcomes[1].reason).toBe('Sources are missing');
expect(outcomes[2].evidence).toEqual([]);
+ // The Portal's check view finds a criterion by its bundle row id.
+ expect(outcomes[0].checkId).toBe('c1');
+ expect(outcomes[2].checkId).toBeUndefined();
});
it('ignores results from earlier rounds', () => {
diff --git a/src/features/AgentGoals/ProcessControl/goalResultState.ts b/src/features/AgentGoals/ProcessControl/goalResultState.ts
index e2b4a1a4620..628df8d9203 100644
--- a/src/features/AgentGoals/ProcessControl/goalResultState.ts
+++ b/src/features/AgentGoals/ProcessControl/goalResultState.ts
@@ -225,6 +225,11 @@ export interface CheckLike {
export type CriterionOutcomeState = 'failed' | 'passed' | 'unjudged';
export interface CriterionOutcome {
+ /**
+ * The acceptance bundle's row for the latest round's check — the id the
+ * Portal's check view looks the criterion up by. Absent when no round judged it.
+ */
+ checkId?: string;
criterion: CriterionLike;
evidence: EvidenceLike[];
/** Why it is unmet (or undecided); absent for a met criterion. */
@@ -302,6 +307,7 @@ export const buildCriterionOutcomes = ({
return [
{
+ checkId: check.id,
criterion,
evidence: check.evidence,
...(reason ? { reason } : {}),