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.

🐛 fix(verify): polish recovered acceptance changes (#17484)

Arvin Xud1c8d3026c55
diff --git a/.agents/acceptance/probe-mock-patterns.md b/.agents/acceptance/probe-mock-patterns.md
index 81c0c076c03..4a5d1b07590 100644
--- a/.agents/acceptance/probe-mock-patterns.md
+++ b/.agents/acceptance/probe-mock-patterns.md
@@ -1276,3 +1276,18 @@ active: true, remoteServerUrl: 'http://localhost:<port>', storageMode: 'selfHost
- **Works:** Close only the exact session names created by the current run,
wait for the competing daemon restart to settle, then create one fresh,
uniquely named session and reload the seeded auth state.
+
+### E42. A dev server launched as a SANDBOXED background task gets SIGTERM-reaped \~1–2 min in — launch it unsandboxed
+
+- **Situation**: starting `init-dev-env.sh dev` / bare `bun run dev` as a background task from an
+ agent harness whose Bash tool sandboxes commands by default. The server boots, serves a few
+ requests, then dies with exit 143; bun logs `terminated by signal SIGTERM (Polite quit request)`.
+ Reproduced 3× in one run (recorded-PID path, bare unrecorded launch — both die), which
+ masquerades as "another session keeps killing my server" when a parallel run is also active.
+- **Doesn't work**: escaping the shared PID bookkeeping (bare `bun run dev` instead of the script)
+ — the killer is not `stop-dev`; the sandbox supervisor reaps the background task's process tree
+ shortly after the spawning tool call returns. Also note the kill can land mid-write and corrupt
+ `.next` (E20 follows: /signin 307 ping-pong, auth POST without set-cookie).
+- **Works**: launch the long-lived dev server with sandboxing disabled for that one command
+ (e.g. the harness's dangerously-disable-sandbox flag). Measured: the same command that died
+ at \~1–2 min three times survived 60s+ probes and the whole run once unsandboxed.
diff --git a/.agents/skills/design-prototype/assets/entry.mjs b/.agents/skills/design-prototype/assets/entry.mjs
index c82c8f131f8..998d9036797 100644
--- a/.agents/skills/design-prototype/assets/entry.mjs
+++ b/.agents/skills/design-prototype/assets/entry.mjs
@@ -4,6 +4,7 @@
// single IIFE global. Bundled from THIS repo's node_modules, so versions match
// production exactly. Missing a component? Add it below and rebuild (~2s):
// bash .agents/skills/design-prototype/scripts/build-runtime.sh
+import { Amp, ClaudeCode, Codex, HermesAgent, OpenClaw, OpenCode } from '@lobehub/icons';
import {
ActionIcon,
Alert,
@@ -98,6 +99,7 @@ export default {
ThemeProvider,
Tooltip,
},
+ '@lobehub/icons': { Amp, ClaudeCode, Codex, HermesAgent, OpenClaw, OpenCode },
'@lobehub/ui/base-ui': baseUI,
'antd': { App, Badge, Checkbox, Divider, Dropdown, Progress, Radio, Slider, Space, Steps, Table },
'antd-style': antdStyle,
diff --git a/locales/en-US/verify.json b/locales/en-US/verify.json
index 7aa56f71d91..c53c9ad4080 100644
--- a/locales/en-US/verify.json
+++ b/locales/en-US/verify.json
@@ -68,7 +68,9 @@
"acceptance.filter.needsFix": "Needs fix {{count}}",
"acceptance.filter.pending": "To review {{count}}",
"acceptance.filter.roundAll": "All rounds",
+ "acceptance.goalCollapse": "Collapse the acceptance goal",
"acceptance.goalEdit": "Edit the acceptance goal",
+ "acceptance.goalExpand": "Expand the acceptance goal",
"acceptance.group.acceptedRatio": "{{accepted}}/{{total}} accepted",
"acceptance.group.allVerified": "{{passed}}/{{total}} all verified & accepted",
"acceptance.group.collapse": "Collapse {{label}}",
@@ -201,6 +203,14 @@
"acceptance.workspace.deleteSuccess": "Acceptance deleted",
"acceptance.workspace.emptyDetail.description": "Pick an acceptance on the left to review its checks, rounds and evidence.",
"acceptance.workspace.emptyDetail.title": "Select an acceptance",
+ "acceptance.workspace.filters.active": "In progress",
+ "acceptance.workspace.filters.all": "All acceptances",
+ "acceptance.workspace.filters.completed": "Completed",
+ "acceptance.workspace.filters.empty.active": "No acceptances in progress.",
+ "acceptance.workspace.filters.empty.completed": "No completed acceptances.",
+ "acceptance.workspace.filters.noSearchResults": "No acceptances match “{{query}}”.",
+ "acceptance.workspace.filters.showAll": "Show all acceptances",
+ "acceptance.workspace.filters.title": "Filter acceptances",
"acceptance.workspace.listEmpty": "Ingest a verification report with the CLI and its acceptance will show up here.",
"acceptance.workspace.listEmptyTitle": "No acceptances yet",
"acceptance.workspace.renameEmpty": "The title cannot be empty",
diff --git a/locales/zh-CN/verify.json b/locales/zh-CN/verify.json
index 73190f152a3..e9c7bb4a4f1 100644
--- a/locales/zh-CN/verify.json
+++ b/locales/zh-CN/verify.json
@@ -68,7 +68,9 @@
"acceptance.filter.needsFix": "待修复 {{count}}",
"acceptance.filter.pending": "未验收 {{count}}",
"acceptance.filter.roundAll": "全部轮次",
+ "acceptance.goalCollapse": "收起验收目标",
"acceptance.goalEdit": "编辑验收目标",
+ "acceptance.goalExpand": "展开验收目标",
"acceptance.group.acceptedRatio": "{{accepted}}/{{total}} 已验收",
"acceptance.group.allVerified": "{{passed}}/{{total}} 已全部验证通过",
"acceptance.group.collapse": "收起{{label}}",
@@ -201,6 +203,14 @@
"acceptance.workspace.deleteSuccess": "验收已删除",
"acceptance.workspace.emptyDetail.description": "在左侧选择一条验收记录,查看它的检查项、轮次与证据。",
"acceptance.workspace.emptyDetail.title": "选择一条验收",
+ "acceptance.workspace.filters.active": "进行中",
+ "acceptance.workspace.filters.all": "全部验收",
+ "acceptance.workspace.filters.completed": "已完成",
+ "acceptance.workspace.filters.empty.active": "暂无进行中的验收。",
+ "acceptance.workspace.filters.empty.completed": "暂无已完成的验收。",
+ "acceptance.workspace.filters.noSearchResults": "没有与「{{query}}」匹配的验收。",
+ "acceptance.workspace.filters.showAll": "显示全部验收",
+ "acceptance.workspace.filters.title": "筛选验收",
"acceptance.workspace.listEmpty": "用 CLI ingest 一份验证报告后,对应的验收会出现在这里。",
"acceptance.workspace.listEmptyTitle": "还没有验收记录",
"acceptance.workspace.renameEmpty": "标题不能为空",
diff --git a/packages/locales/src/default/verify.ts b/packages/locales/src/default/verify.ts
index abe9b0f54a9..668e8532a53 100644
--- a/packages/locales/src/default/verify.ts
+++ b/packages/locales/src/default/verify.ts
@@ -80,7 +80,9 @@ export default {
'acceptance.filter.needsFix': 'Needs fix {{count}}',
'acceptance.filter.pending': 'To review {{count}}',
'acceptance.filter.roundAll': 'All rounds',
+ 'acceptance.goalCollapse': 'Collapse the acceptance goal',
'acceptance.goalEdit': 'Edit the acceptance goal',
+ 'acceptance.goalExpand': 'Expand the acceptance goal',
'acceptance.group.acceptedRatio': '{{accepted}}/{{total}} accepted',
'acceptance.group.allVerified': '{{passed}}/{{total}} all verified & accepted',
'acceptance.group.collapse': 'Collapse {{label}}',
@@ -225,6 +227,14 @@ export default {
'acceptance.workspace.emptyDetail.description':
'Pick an acceptance on the left to review its checks, rounds and evidence.',
'acceptance.workspace.emptyDetail.title': 'Select an acceptance',
+ 'acceptance.workspace.filters.active': 'In progress',
+ 'acceptance.workspace.filters.all': 'All acceptances',
+ 'acceptance.workspace.filters.completed': 'Completed',
+ 'acceptance.workspace.filters.empty.active': 'No acceptances in progress.',
+ 'acceptance.workspace.filters.empty.completed': 'No completed acceptances.',
+ 'acceptance.workspace.filters.noSearchResults': 'No acceptances match “{{query}}”.',
+ 'acceptance.workspace.filters.showAll': 'Show all acceptances',
+ 'acceptance.workspace.filters.title': 'Filter acceptances',
'acceptance.workspace.listEmpty':
'Ingest a verification report with the CLI and its acceptance will show up here.',
'acceptance.workspace.listEmptyTitle': 'No acceptances yet',
diff --git a/src/features/Verify/Acceptance/CheckList.tsx b/src/features/Verify/Acceptance/CheckList.tsx
index b2512bcd1c0..c49db941e54 100644
--- a/src/features/Verify/Acceptance/CheckList.tsx
+++ b/src/features/Verify/Acceptance/CheckList.tsx
@@ -40,6 +40,7 @@ import type { AcceptanceBundle } from '@/services/verify';
import {
EvidenceComparisonCard,
+ meaningfulEvidenceCaption,
readEvidenceComparison,
} from '../components/EvidenceComparisonCard';
import {
@@ -317,11 +318,6 @@ const EVIDENCE_BADGES = [
{ icon: FileText, key: 'file', labelKey: 'acceptance.evidence.file' },
] as const;
-/** A filename is not a caption — only descriptive text renders under the artifact. */
-const isFilename = (value: string | null | undefined) =>
- !value ||
- /^[\w.-]+\.(?:gif|html?|jpe?g|json|log|markdown|md|mp4|png|txt|webm|webp)$/i.test(value);
-
/**
* Reserve the image's box before it loads — with the stored intrinsic size the
* layout never jumps when a row expands and its screenshots stream in.
@@ -369,7 +365,8 @@ const EvidenceList = memo<{ evidence: AcceptanceEvidence[] }>(({ evidence }) =>
const comparisonSide = (item: AcceptanceEvidence) => ({
caption:
readEvidenceComparison(item.metadata)?.label ??
- (isFilename(item.description) ? undefined : (item.description ?? undefined)),
+ meaningfulEvidenceCaption(item.description) ??
+ undefined,
content: comparisonContent(item),
});
@@ -391,9 +388,8 @@ const EvidenceList = memo<{ evidence: AcceptanceEvidence[] }>(({ evidence }) =>
);
}
- const caption = !isFilename(item.description) && (
- <span className={styles.caption}>{item.description}</span>
- );
+ const description = meaningfulEvidenceCaption(item.description);
+ const caption = description && <span className={styles.caption}>{description}</span>;
if (item.fileUrl && item.type === 'video')
return (
<Flexbox gap={4} key={item.id} style={{ maxWidth: '100%', width: 'fit-content' }}>
diff --git a/src/features/Verify/Acceptance/Workspace/AcceptanceListPanel.tsx b/src/features/Verify/Acceptance/Workspace/AcceptanceListPanel.tsx
index 4f0d99370c2..b6ff20c3651 100644
--- a/src/features/Verify/Acceptance/Workspace/AcceptanceListPanel.tsx
+++ b/src/features/Verify/Acceptance/Workspace/AcceptanceListPanel.tsx
@@ -20,10 +20,12 @@ import dayjs from 'dayjs';
import isEqual from 'fast-deep-equal';
import {
BadgeCheck,
+ Check,
CircleCheck,
CircleDashed,
CircleHelp,
CircleX,
+ ListFilter,
LoaderCircle,
MoreHorizontal,
PanelLeftClose,
@@ -41,6 +43,7 @@ import { useNavigate, useParams } from 'react-router';
import NavItem from '@/features/NavPanel/components/NavItem';
import { SkeletonList } from '@/features/NavPanel/components/SkeletonList';
+import { useLocalStorageState } from '@/hooks/useLocalStorageState';
import { mutate as globalMutate } from '@/libs/swr';
import { verifyKeys } from '@/libs/swr/keys';
import type { AcceptanceListItem } from '@/services/verify';
@@ -50,9 +53,16 @@ import { systemStatusSelectors } from '@/store/global/selectors';
import { useAcceptanceList } from '../../hooks';
import type { ReportPanelExpand } from '../../Workspace/useReportPanelExpand';
+import {
+ type AcceptanceListFilter,
+ DEFAULT_ACCEPTANCE_LIST_FILTER,
+ filterAcceptanceList,
+ normalizeAcceptanceListFilter,
+} from './acceptanceListFilter';
const PANEL_MIN = 260;
const PANEL_MAX = 420;
+const ACCEPTANCE_LIST_FILTER_STORAGE_KEY = 'lobehub-acceptance-list-filter';
const styles = createStaticStyles(({ css }) => ({
panel: css`
@@ -97,8 +107,6 @@ const styles = createStaticStyles(({ css }) => ({
align-items: center;
height: 32px;
- margin-block: 8px 4px;
- margin-inline: 4px;
padding-inline: 10px;
border: 1px solid ${cssVar.colorBorderSecondary};
border-radius: ${cssVar.borderRadius};
@@ -126,6 +134,22 @@ const styles = createStaticStyles(({ css }) => ({
}
}
`,
+ searchRow: css`
+ display: flex;
+ gap: 4px;
+ align-items: center;
+
+ margin-block: 8px 4px;
+ margin-inline: 4px;
+
+ > label {
+ flex: 1;
+ min-width: 0;
+ }
+ `,
+ filterButton: css`
+ flex: none;
+ `,
searchEmpty: css`
display: flex;
flex-direction: column;
@@ -141,11 +165,6 @@ const styles = createStaticStyles(({ css }) => ({
color: ${cssVar.colorTextTertiary};
word-break: break-word;
`,
- queryHl: css`
- font-weight: 600;
- color: ${cssVar.colorTextSecondary};
- word-break: break-all;
- `,
list: css`
display: flex;
flex-direction: column;
@@ -498,12 +517,26 @@ const AcceptanceListPanel = memo<ReportPanelExpand>(({ expand, isNarrow, setExpa
// Client-side filter: the list endpoint returns the caller's full recent set
// (bounded, no pagination), so filtering the loaded rows IS filtering the set.
const [query, setQuery] = useState('');
- const trimmedQuery = query.trim().toLowerCase();
- const filtered = trimmedQuery
- ? (data ?? []).filter((item) =>
- (item.subject.title || item.subjectId).toLowerCase().includes(trimmedQuery),
- )
- : (data ?? []);
+ const [storedFilter, setStoredFilter] = useLocalStorageState<AcceptanceListFilter>(
+ ACCEPTANCE_LIST_FILTER_STORAGE_KEY,
+ DEFAULT_ACCEPTANCE_LIST_FILTER,
+ );
+ const filter = normalizeAcceptanceListFilter(storedFilter);
+ const filtered = filterAcceptanceList(data ?? [], filter, query);
+ const trimmedQuery = query.trim();
+
+ const filterItems: DropdownItem[] = (
+ [
+ ['active', t('acceptance.workspace.filters.active')],
+ ['all', t('acceptance.workspace.filters.all')],
+ ['completed', t('acceptance.workspace.filters.completed')],
+ ] as const
+ ).map(([key, label]) => ({
+ icon: <Icon icon={Check} style={{ opacity: filter === key ? 1 : 0 }} />,
+ key,
+ label,
+ onClick: () => setStoredFilter(key),
+ }));
const [panelWidth, updateSystemStatus] = useGlobalStore((s) => [
systemStatusSelectors.verifyReportPanelWidth(s),
@@ -546,15 +579,26 @@ const AcceptanceListPanel = memo<ReportPanelExpand>(({ expand, isNarrow, setExpa
<Icon icon={PanelLeftClose} size={16} />
</button>
</div>
- <label className={styles.search}>
- <Icon icon={Search} size={13} />
- <input
- placeholder={t('workspace.search')}
- type={'search'}
- value={query}
- onChange={(e) => setQuery(e.target.value)}
- />
- </label>
+ <div className={styles.searchRow}>
+ <label className={styles.search}>
+ <Icon icon={Search} size={13} />
+ <input
+ placeholder={t('workspace.search')}
+ type={'search'}
+ value={query}
+ onChange={(e) => setQuery(e.target.value)}
+ />
+ </label>
+ <DropdownMenu items={filterItems} placement={'bottomRight'}>
+ <ActionIcon
+ active={filter !== 'all'}
+ className={styles.filterButton}
+ icon={ListFilter}
+ size={'small'}
+ title={t('acceptance.workspace.filters.title')}
+ />
+ </DropdownMenu>
+ </div>
</div>
<Flexbox flex={1} style={{ minHeight: 0, overflowX: 'hidden', overflowY: 'auto' }}>
@@ -574,17 +618,24 @@ const AcceptanceListPanel = memo<ReportPanelExpand>(({ expand, isNarrow, setExpa
) : isLoading ? (
<SkeletonList rows={6} style={{ paddingBlock: 6, paddingInline: 8 }} />
) : filtered.length === 0 ? (
- trimmedQuery ? (
+ trimmedQuery || filter !== 'all' ? (
// A zero-result FILTER must read as "no match for this query",
// never as the first-run empty state.
<div className={styles.searchEmpty}>
<span className={styles.searchEmptyMsg}>
- {t('workspace.searchEmptyPrefix')}
- <b className={styles.queryHl}>{query.trim()}</b>
- {t('workspace.searchEmptySuffix')}
+ {trimmedQuery
+ ? t('acceptance.workspace.filters.noSearchResults', { query: trimmedQuery })
+ : t(`acceptance.workspace.filters.empty.${filter}`)}
</span>
- <button className={styles.retryBtn} type={'button'} onClick={() => setQuery('')}>
- {t('workspace.clearSearch')}
+ <button
+ className={styles.retryBtn}
+ type={'button'}
+ onClick={() => {
+ setQuery('');
+ setStoredFilter('all');
+ }}
+ >
+ {t('acceptance.workspace.filters.showAll')}
</button>
</div>
) : (
diff --git a/src/features/Verify/Acceptance/Workspace/acceptanceListFilter.test.ts b/src/features/Verify/Acceptance/Workspace/acceptanceListFilter.test.ts
new file mode 100644
index 00000000000..3a5de181178
--- /dev/null
+++ b/src/features/Verify/Acceptance/Workspace/acceptanceListFilter.test.ts
@@ -0,0 +1,52 @@
+import { describe, expect, it } from 'vitest';
+
+import type { AcceptanceListItem } from '@/services/verify';
+
+import { filterAcceptanceList, normalizeAcceptanceListFilter } from './acceptanceListFilter';
+
+const item = (
+ id: string,
+ status: AcceptanceListItem['status'],
+ title: string,
+): AcceptanceListItem =>
+ ({
+ id,
+ status,
+ subject: { title },
+ subjectId: id,
+ }) as AcceptanceListItem;
+
+const acceptances = [
+ item('active', 'delivered', 'Needs review'),
+ item('completed', 'accepted', 'Signed off'),
+ item('failed', 'rejected', 'Needs repair'),
+];
+
+describe('filterAcceptanceList', () => {
+ it('hides completed acceptances by default', () => {
+ expect(filterAcceptanceList(acceptances, 'active', '').map(({ id }) => id)).toEqual([
+ 'active',
+ 'failed',
+ ]);
+ });
+
+ it('can show only completed acceptances', () => {
+ expect(filterAcceptanceList(acceptances, 'completed', '').map(({ id }) => id)).toEqual([
+ 'completed',
+ ]);
+ });
+
+ it('combines status filtering with title search', () => {
+ expect(filterAcceptanceList(acceptances, 'all', 'signed').map(({ id }) => id)).toEqual([
+ 'completed',
+ ]);
+ expect(filterAcceptanceList(acceptances, 'active', 'signed')).toEqual([]);
+ });
+});
+
+describe('normalizeAcceptanceListFilter', () => {
+ it('falls back to the active filter for malformed persisted values', () => {
+ expect(normalizeAcceptanceListFilter('unknown')).toBe('active');
+ expect(normalizeAcceptanceListFilter(null)).toBe('active');
+ });
+});
diff --git a/src/features/Verify/Acceptance/Workspace/acceptanceListFilter.ts b/src/features/Verify/Acceptance/Workspace/acceptanceListFilter.ts
new file mode 100644
index 00000000000..fcfffa3bd08
--- /dev/null
+++ b/src/features/Verify/Acceptance/Workspace/acceptanceListFilter.ts
@@ -0,0 +1,29 @@
+import type { AcceptanceStatus } from '@lobechat/types';
+
+import type { AcceptanceListItem } from '@/services/verify';
+
+export type AcceptanceListFilter = 'active' | 'all' | 'completed';
+
+export const DEFAULT_ACCEPTANCE_LIST_FILTER: AcceptanceListFilter = 'active';
+
+export const normalizeAcceptanceListFilter = (value: unknown): AcceptanceListFilter =>
+ value === 'all' || value === 'completed' ? value : DEFAULT_ACCEPTANCE_LIST_FILTER;
+
+export const filterAcceptanceList = (
+ items: AcceptanceListItem[],
+ filter: AcceptanceListFilter,
+ query: string,
+) => {
+ const normalizedQuery = query.trim().toLowerCase();
+
+ return items.filter((item) => {
+ const completed = (item.status as AcceptanceStatus) === 'accepted';
+ if (filter === 'active' && completed) return false;
+ if (filter === 'completed' && !completed) return false;
+
+ return (
+ !normalizedQuery ||
+ (item.subject.title || item.subjectId).toLowerCase().includes(normalizedQuery)
+ );
+ });
+};
diff --git a/src/features/Verify/Acceptance/index.tsx b/src/features/Verify/Acceptance/index.tsx
index 8d51bb60c08..68d1fc51c1e 100644
--- a/src/features/Verify/Acceptance/index.tsx
+++ b/src/features/Verify/Acceptance/index.tsx
@@ -41,6 +41,7 @@ import { useParams, useSearchParams } from 'react-router';
import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import AgentProfilePopup from '@/features/AgentProfileCard/AgentProfilePopup';
import { openGoalModal } from '@/features/Conversation/ChatInput/VerifyTray/GoalModal';
+import { useLocalStorageState } from '@/hooks/useLocalStorageState';
// The workspace-scoped mutate — a bare `import { mutate } from 'swr'` misses
// every `useClientDataSWR` subscriber (augmented keys + custom cache provider).
import { mutate as globalMutate } from '@/libs/swr';
@@ -89,6 +90,11 @@ const styles = createStaticStyles(({ css }) => ({
border: 1px solid ${cssVar.colorBorderSecondary};
border-radius: ${cssVar.borderRadiusLG};
background: ${cssVar.colorBgContainer};
+
+ &:hover [data-goal-toggle='true'] {
+ pointer-events: auto;
+ opacity: 1;
+ }
`,
countBadge: css`
padding-block: 1px;
@@ -116,6 +122,21 @@ const styles = createStaticStyles(({ css }) => ({
border-color: ${cssVar.colorBorder};
}
`,
+ goalToggle: css`
+ pointer-events: none;
+ opacity: 0;
+ transition: opacity ${cssVar.motionDurationMid};
+
+ &:focus-visible {
+ pointer-events: auto;
+ opacity: 1;
+ }
+
+ @media (hover: none) {
+ pointer-events: auto;
+ opacity: 1;
+ }
+ `,
page: css`
position: relative;
@@ -179,6 +200,7 @@ const styles = createStaticStyles(({ css }) => ({
/** Aggregate states in which the round chain is still executing. */
const LIVE_STATUSES = new Set(['pending', 'planned', 'verifying', 'repairing']);
+const GOAL_COLLAPSED_STORAGE_KEY = 'lobehub-acceptance-goal-collapsed';
interface AcceptancePageProps {
/**
@@ -241,6 +263,10 @@ const AcceptancePage = memo<AcceptancePageProps>(
);
};
const [roundFilter, setRoundFilter] = useState<number | null>(null);
+ const [goalCollapsed, setGoalCollapsed] = useLocalStorageState(
+ GOAL_COLLAPSED_STORAGE_KEY,
+ false,
+ );
// Expand/collapse state is kept PER aggregate: the portal embed swaps
// `acceptanceId` without remounting, so a single shared set would bleed one
// aggregate's toggles onto the next (and revisiting would show the wrong
@@ -878,22 +904,56 @@ const AcceptancePage = memo<AcceptancePageProps>(
one prominent card. The latest report summary (and the chips
describing what that round verified) is supporting context inside
it, never the headline. */}
- <Flexbox className={styles.card} gap={12} padding={16}>
- <Flexbox gap={4}>
- <Flexbox horizontal align={'center'} gap={4}>
- <Text className={styles.requirementLabel}>
- {t('acceptance.requirementLabel')}
+ <Flexbox
+ className={styles.card}
+ gap={goalCollapsed ? 0 : 12}
+ paddingBlock={goalCollapsed ? 8 : 12}
+ paddingInline={goalCollapsed ? 12 : 16}
+ >
+ <Flexbox horizontal align={'center'} gap={4}>
+ <Text className={styles.requirementLabel}>{t('acceptance.requirementLabel')}</Text>
+ {isOwner && !goalCollapsed && (
+ <ActionIcon
+ icon={PencilLine}
+ size={'small'}
+ title={t('acceptance.goalEdit')}
+ onClick={handleEditGoal}
+ />
+ )}
+ {goalCollapsed && (
+ <Text
+ ellipsis
+ fontSize={13}
+ style={{ flex: 1, minWidth: 0 }}
+ title={
+ acceptance.requirement ??
+ t(
+ isOwner
+ ? 'acceptance.requirementEmptyEditable'
+ : 'acceptance.requirementEmpty',
+ )
+ }
+ >
+ {acceptance.requirement ??
+ t(
+ isOwner
+ ? 'acceptance.requirementEmptyEditable'
+ : 'acceptance.requirementEmpty',
+ )}
</Text>
- {isOwner && (
- <ActionIcon
- icon={PencilLine}
- size={'small'}
- title={t('acceptance.goalEdit')}
- onClick={handleEditGoal}
- />
- )}
- </Flexbox>
- {acceptance.requirement ? (
+ )}
+ {!goalCollapsed && <Flexbox flex={1} />}
+ <ActionIcon
+ data-goal-toggle
+ className={styles.goalToggle}
+ icon={goalCollapsed ? ChevronsUpDown : ChevronsDownUp}
+ size={'small'}
+ title={t(goalCollapsed ? 'acceptance.goalExpand' : 'acceptance.goalCollapse')}
+ onClick={() => setGoalCollapsed((collapsed) => !collapsed)}
+ />
+ </Flexbox>
+ {!goalCollapsed &&
+ (acceptance.requirement ? (
<Text style={{ fontSize: 15, lineHeight: 1.7 }}>{acceptance.requirement}</Text>
) : isOwner ? (
// The empty state is itself the entry: the whole line invites
@@ -909,9 +969,8 @@ const AcceptancePage = memo<AcceptancePageProps>(
<Text style={{ fontSize: 15, lineHeight: 1.7 }}>
{t('acceptance.requirementEmpty')}
</Text>
- )}
- </Flexbox>
- {(latestReport?.summary || scope) && (
+ ))}
+ {!goalCollapsed && (latestReport?.summary || scope) && (
<Flexbox
gap={8}
paddingBlock={'12px 0'}
diff --git a/src/features/Verify/ReportViewer.tsx b/src/features/Verify/ReportViewer.tsx
index 60dd53ba525..2e68e03680e 100644
--- a/src/features/Verify/ReportViewer.tsx
+++ b/src/features/Verify/ReportViewer.tsx
@@ -52,6 +52,7 @@ import {
EvidenceComparisonCard,
type EvidenceComparisonMeta,
isFilenameLike,
+ meaningfulEvidenceCaption,
readEvidenceComparison,
} from './components/EvidenceComparisonCard';
import {
@@ -1212,13 +1213,13 @@ const EvidenceItem = memo<{
}>(({ evidence: e, flat, index }) => {
const { t } = useTranslation('verify');
const label = evidenceDisplayName(e, t, index);
- const description = e.description && e.description !== label ? e.description : null;
+ const description = meaningfulEvidenceCaption(e.description, label);
// Inline media (image/gif/video) speaks for itself — the raw filename header
// is visual noise, so only keep a meaningful caption (description) for it.
- // Prose evidence gets the same treatment: a "root-cause.txt" header above a
- // rendered markdown body would re-introduce the attachment look.
const isMedia = isInlineVisualEvidence(e);
- const hideLabel = isMedia || (markdownTextEvidenceTypes.has(e.type) && isFilenameLike(label));
+ const isInlineProse = Boolean(e.content) && markdownTextEvidenceTypes.has(e.type);
+ const hideLabel =
+ isMedia || (markdownTextEvidenceTypes.has(e.type) && isFilenameLike(label)) || isInlineProse;
return (
<Flexbox gap={6}>
diff --git a/src/features/Verify/components/EvidenceComparisonCard.tsx b/src/features/Verify/components/EvidenceComparisonCard.tsx
index 5a76f089949..ffa458a0bbe 100644
--- a/src/features/Verify/components/EvidenceComparisonCard.tsx
+++ b/src/features/Verify/components/EvidenceComparisonCard.tsx
@@ -30,6 +30,13 @@ export const isFilenameLike = (value?: string | null) =>
!value ||
/^[\w.-]+\.(?:gif|html?|jpe?g|json|log|markdown|md|mp4|png|txt|webm|webp)$/i.test(value);
+/** Keep authored context, but suppress generated filenames and duplicated labels. */
+export const meaningfulEvidenceCaption = (
+ description?: string | null,
+ label?: string | null,
+): string | null =>
+ description && description !== label && !isFilenameLike(description) ? description : null;
+
/** Parse an evidence row's `metadata.comparison`, or null when it carries none. */
export const readEvidenceComparison = (metadata: unknown): EvidenceComparisonMeta | null => {
const record = toRecord(metadata);
diff --git a/src/features/Verify/components/MarkdownEvidence.tsx b/src/features/Verify/components/MarkdownEvidence.tsx
index fc30c2c476f..980ddc8ade9 100644
--- a/src/features/Verify/components/MarkdownEvidence.tsx
+++ b/src/features/Verify/components/MarkdownEvidence.tsx
@@ -41,7 +41,7 @@ const COLLAPSED_MAX_HEIGHT = 180;
const styles = createStaticStyles(({ css }) => ({
expandLink: css`
- border: 1px solid ${cssVar.colorFillTertiary} !important;
+ align-self: center;
font-size: 12px;
color: ${cssVar.colorTextDescription};
`,
@@ -139,12 +139,11 @@ export const CollapsibleMarkdownEvidence = memo<{ children: string }>(({ childre
{isOverflow && (
<Button
- block
className={styles.expandLink}
icon={expanded ? ChevronsDownUpIcon : ChevronsUpDownIcon}
iconPosition={'end'}
size={'small'}
- type={'text'}
+ type={'fill'}
onClick={() => setExpanded(!expanded)}
>
{expanded ? t('report.evidence.collapse') : t('report.evidence.expand')}
diff --git a/src/features/Verify/utils.test.ts b/src/features/Verify/utils.test.ts
index 01e2c522fc1..b0fea5558a6 100644
--- a/src/features/Verify/utils.test.ts
+++ b/src/features/Verify/utils.test.ts
@@ -3,6 +3,7 @@ import { describe, expect, it } from 'vitest';
import type { VerifyResultWithEvidence } from '@/services/verify';
+import { meaningfulEvidenceCaption } from './components/EvidenceComparisonCard';
import {
buildCheckRows,
countResults,
@@ -14,6 +15,19 @@ import {
resolveRoundParam,
} from './utils';
+describe('meaningfulEvidenceCaption', () => {
+ it('keeps authored context for inline prose evidence', () => {
+ expect(meaningfulEvidenceCaption('Console output after retry', 'console.log')).toBe(
+ 'Console output after retry',
+ );
+ });
+
+ it('suppresses generated filenames and descriptions duplicated by the label', () => {
+ expect(meaningfulEvidenceCaption('console.log', 'Evidence 1')).toBeNull();
+ expect(meaningfulEvidenceCaption('Observed output', 'Observed output')).toBeNull();
+ });
+});
+
const planItem = (id: string, overrides: Partial<VerifyCheckItem> = {}): VerifyCheckItem => ({
id,
index: 0,
diff --git a/src/hooks/useLocalStorageState.test.ts b/src/hooks/useLocalStorageState.test.ts
new file mode 100644
index 00000000000..21375b12e46
--- /dev/null
+++ b/src/hooks/useLocalStorageState.test.ts
@@ -0,0 +1,30 @@
+import { act, renderHook, waitFor } from '@testing-library/react';
+import { beforeEach, describe, expect, it } from 'vitest';
+
+import { useLocalStorageState } from './useLocalStorageState';
+
+const STORAGE_KEY = 'test-collapsed-preference';
+
+beforeEach(() => {
+ window.localStorage.clear();
+});
+
+describe('useLocalStorageState', () => {
+ it('uses the expanded default when no preference has been stored', () => {
+ const { result } = renderHook(() => useLocalStorageState(STORAGE_KEY, false));
+
+ expect(result.current[0]).toBe(false);
+ });
+
+ it('restores and updates a persisted collapsed preference', async () => {
+ window.localStorage.setItem(STORAGE_KEY, JSON.stringify(true));
+ const { result } = renderHook(() => useLocalStorageState(STORAGE_KEY, false));
+
+ await waitFor(() => expect(result.current[0]).toBe(true));
+
+ act(() => result.current[1](false));
+
+ expect(result.current[0]).toBe(false);
+ expect(window.localStorage.getItem(STORAGE_KEY)).toBe(JSON.stringify(false));
+ });
+});