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.

✨ feat(verify): public acceptance pages, verify-style workspace and page polish (#17250)

Arvin Xubd0338b39232
diff --git a/.agents/skills/agent-testing/references/common-mistakes.md b/.agents/skills/agent-testing/references/common-mistakes.md
index b80091b97cc..bd041ed72aa 100644
--- a/.agents/skills/agent-testing/references/common-mistakes.md
+++ b/.agents/skills/agent-testing/references/common-mistakes.md
@@ -7,6 +7,32 @@
---
+## Case 25 — Building a surface's "twin" without walking the sibling implementation feature-by-feature
+
+**Wrong approach**: when asked to make surface B "consistent with" an existing surface A (a list
+panel, an evidence renderer, a link chip), skimming A for its visual language (colors, spacing,
+component choices) and rebuilding B from that impression — instead of walking A's implementation
+feature-by-feature and porting each one deliberately. In one round this dropped: A's search box,
+A's before/after comparison rendering, and A's authored-report field conventions (title / verdict /
+comparison labels), while a hover state contradicted the intended text-emphasis semantics.
+
+**Why it's wrong**: "consistency" is a checklist over the sibling's FEATURES, not a style match.
+Every capability the sibling has that the twin lacks is a bug the user will find one screenshot
+later. The ux skill's own line — "compose the canonical surface component, don't re-derive it" —
+covers exactly this, but it only bites if the sibling is actually enumerated before building.
+
+**What it breaks**: the user gets a surface that looks 90% right and is missing load-bearing
+features; a round of "为什么这里缺 X / 丢了 Y" feedback that a 10-minute sibling walk would have
+prevented; trust that "对齐" means aligned.
+
+**Correct approach**: before building a twin surface, enumerate the sibling's implementation —
+grep its component for every rendered affordance (search, empty states, comparison views, hover
+behaviors, drawer wiring) and its data conventions (which fields the author must supply) — and
+turn that list into the build checklist. After building, diff the two surfaces side by side in
+screenshots before publishing. For authored artifacts (result.json), re-read the field spec in
+references/report.md instead of writing from memory: `title` and `summary.verdict` are identity
+fields, and comparison pairs need per-side `label`s.
+
## Case 20 — Publishing a replacement as a second Acceptance row and passing UI from text-only evidence
**Wrong approach**: giving a refined check a new id without declaring `supersedes`, then marking
diff --git a/.agents/skills/agent-testing/references/report.md b/.agents/skills/agent-testing/references/report.md
index 51fdeec49c7..98f35ea1975 100644
--- a/.agents/skills/agent-testing/references/report.md
+++ b/.agents/skills/agent-testing/references/report.md
@@ -225,6 +225,17 @@ missing; a blocked case is not a pass).
## result.json schema
+**Two fields are the report's identity in every list surface — treat them as
+REQUIRED on every ingest:**
+
+- `title` (top level) — without it the run lists as "未命名验证" forever.
+- `summary.verdict` (`pass` / `fail` / `partial`) — without it the list glyph is
+ a permanent amber "?" instead of the green pass. The CLI now derives a
+ fallback from the cases, but an explicit verdict is still the author's job.
+- Every `comparison` pair side should carry a `label` — the role band renders
+ it as the explanation ("优化前:清单头部被挤压…"); a pair without labels shows
+ two bare role words and reads as unexplained.
+
```json
{
"branch": "feat/task-tree",
diff --git a/apps/cli/src/commands/verify.test.ts b/apps/cli/src/commands/verify.test.ts
index fb81394f7a0..22138bc0f10 100644
--- a/apps/cli/src/commands/verify.test.ts
+++ b/apps/cli/src/commands/verify.test.ts
@@ -6,6 +6,7 @@ import { Command } from 'commander';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import {
+ deriveReportVerdict,
originFromEnv,
parseSubjectRef,
planFromResult,
@@ -610,6 +611,24 @@ describe('originFromEnv — in-app provenance', () => {
});
});
+describe('deriveReportVerdict — headline fallback when summary.verdict is absent', () => {
+ it('derives passed when every case passed', () => {
+ expect(deriveReportVerdict([{ result: 'passed' }, { result: 'ok' }])).toBe('passed');
+ });
+
+ it('any failed case fails the report', () => {
+ expect(deriveReportVerdict([{ result: 'passed' }, { result: 'failed' }])).toBe('failed');
+ });
+
+ it('a non-passed, non-failed case makes the report uncertain', () => {
+ expect(deriveReportVerdict([{ result: 'passed' }, { result: 'blocked' }])).toBe('uncertain');
+ });
+
+ it('no cases → no derived verdict', () => {
+ expect(deriveReportVerdict([])).toBeUndefined();
+ });
+});
+
describe('subjectFromEnv — default topic acceptance', () => {
const saved = { ...process.env };
diff --git a/apps/cli/src/commands/verify.ts b/apps/cli/src/commands/verify.ts
index 4ebcd6e669e..c8741a0ce04 100644
--- a/apps/cli/src/commands/verify.ts
+++ b/apps/cli/src/commands/verify.ts
@@ -61,6 +61,19 @@ function toVerdict(raw: unknown): Verdict {
return 'uncertain'; // partial / blocked / skipped / pending / unknown
}
+/**
+ * The report's headline verdict when the author didn't set `summary.verdict`:
+ * derived from the ingested cases, so a report can never ship verdict-less and
+ * render as a permanent "?" in every list surface.
+ */
+export function deriveReportVerdict(cases: unknown[]): Verdict | undefined {
+ const verdicts = cases.map((c) => toVerdict((c as any)?.result ?? (c as any)?.verdict));
+ if (verdicts.length === 0) return undefined;
+ if (verdicts.includes('failed')) return 'failed';
+ if (verdicts.includes('uncertain')) return 'uncertain';
+ return 'passed';
+}
+
/** Pick an evidence medium from a file extension. */
function evidenceTypeForFile(file: string): EvidenceType {
const ext = path.extname(file).toLowerCase().slice(1);
@@ -1422,6 +1435,13 @@ export function registerVerifyCommand(program: Command) {
const client = await getTrpcClient();
const goal = options.goal ?? (typeof result.focus === 'string' ? result.focus : undefined);
const title = options.title ?? result.title;
+ // The title is the run's identity in every list surface — an untitled
+ // run renders as a placeholder forever, so say so before it ships.
+ if (!title) {
+ log.warn(
+ 'result.json has no "title" — the run will list as untitled; set result.title (or pass --title)',
+ );
+ }
// The in-app conversation that ran this harness, if any (env-supplied).
// Strictly the authoring conversation. `--operation` names the Agent Run
// under test and is passed to `createRun` below — a different relation.
@@ -1536,7 +1556,10 @@ export function registerVerifyCommand(program: Command) {
summary: conclusion,
totalChecks: summary.total ?? cases.length,
uncertainChecks: (summary.blocked ?? 0) + (summary.uncertain ?? 0) || undefined,
- verdict: summary.verdict ? toVerdict(summary.verdict) : undefined,
+ // An explicit summary.verdict wins; otherwise the headline is derived
+ // from the ingested cases (deriveReportVerdict) so no report ships
+ // verdict-less and lists as a permanent "?".
+ verdict: summary.verdict ? toVerdict(summary.verdict) : deriveReportVerdict(cases),
verifyRunId: runId,
});
diff --git a/apps/server/src/routers/lambda/acceptance.ts b/apps/server/src/routers/lambda/acceptance.ts
index 0c8b9d5f9ec..3ca5b9b3249 100644
--- a/apps/server/src/routers/lambda/acceptance.ts
+++ b/apps/server/src/routers/lambda/acceptance.ts
@@ -1,5 +1,6 @@
import { acceptanceSubjectTypes } from '@lobechat/const/verify';
import { TRPCError } from '@trpc/server';
+import { eq } from 'drizzle-orm';
import { z } from 'zod';
import {
@@ -8,7 +9,8 @@ import {
} from '@/business/server/trpc-middlewares/workspaceAuth';
import { VerifyRunModel } from '@/database/models/verifyRun';
import type { AcceptanceItem } from '@/database/schemas/verify';
-import { router } from '@/libs/trpc/lambda';
+import { acceptances } from '@/database/schemas/verify';
+import { publicProcedure, router } from '@/libs/trpc/lambda';
import { serverDatabase } from '@/libs/trpc/lambda/middleware';
import {
AcceptanceService,
@@ -20,6 +22,9 @@ import { assertWorkspaceRowManageable } from './_helpers/assertWorkspaceRowManag
const subjectTypeSchema = z.enum(acceptanceSubjectTypes);
+/** Reads addressed purely by acceptance id — the id is the read capability. */
+const publicAcceptanceProcedure = publicProcedure.use(serverDatabase);
+
const acceptanceProcedure = wsCompatProcedure.use(serverDatabase).use(async (opts) => {
const { ctx } = opts;
return opts.next({
@@ -139,15 +144,37 @@ export const acceptanceRouter = router({
* subject header, the round ledger (each round's run + report), and the
* cross-round check union — every check ever planned, with its final verdict,
* final evidence (file-URL enriched) and round provenance.
+ *
+ * Public like the verify report viewer: the acceptance URL is meant to be
+ * linked from PRs/reports, so anyone holding the id can read it — no session
+ * required. `isOwner` gates what only the author may see (the origin
+ * conversation, redacted for everyone else). A per-aggregate `visibility`
+ * override is planned but not shipped yet.
*/
- getBundle: acceptanceProcedure
+ getBundle: publicAcceptanceProcedure
.input(z.object({ id: z.string() }))
.query(async ({ ctx, input }) => {
- const acceptance = await resolveAcceptance(ctx, input.id);
+ const acceptance = await ctx.serverDB.query.acceptances.findFirst({
+ where: eq(acceptances.id, input.id),
+ });
+ if (!acceptance) {
+ throw new TRPCError({ code: 'NOT_FOUND', message: 'Acceptance not found' });
+ }
+
+ const isOwner = Boolean(ctx.userId) && ctx.userId === acceptance.userId;
+
+ // Sub-reads (rounds / results / evidence) are ownership-scoped models, so
+ // read them AS the aggregate's owner — same pattern as the evidence file
+ // resolver. The visibility gate above is the actual access decision.
+ const ownerService = new AcceptanceService(
+ ctx.serverDB,
+ acceptance.userId,
+ acceptance.workspaceId ?? undefined,
+ );
const [subject, { evidence, reports, results, runs }] = await Promise.all([
- ctx.acceptanceService.resolveSubject(acceptance),
- ctx.acceptanceService.loadRounds(acceptance.id),
+ ownerService.resolveSubject(acceptance),
+ ownerService.loadRounds(acceptance.id),
]);
const resultsByRun = new Map<string, typeof results>();
@@ -186,14 +213,21 @@ export const acceptanceRouter = router({
}
const reportsByRun = new Map(reports.map((r) => [r.verifyRunId!, r]));
- const rounds = runs.map((run) => ({
- report: reportsByRun.get(run.id) ?? null,
- run,
- }));
+ const rounds = runs.map((run) => {
+ // `origin` points at the author's private topic/agent — never hand it
+ // to a visitor holding nothing but the shared link.
+ let publicRun = run;
+ if (!isOwner && run.metadata?.origin) {
+ const { origin: _origin, ...publicMetadata } = run.metadata;
+ publicRun = { ...run, metadata: publicMetadata };
+ }
+ return { report: reportsByRun.get(run.id) ?? null, run: publicRun };
+ });
const latestReport = [...rounds].reverse().find((r) => r.report)?.report ?? null;
return {
acceptance,
+ isOwner,
checks: checks.map((check) => ({
...check,
evidence: check.result ? (evidenceByResult.get(check.result.id) ?? []) : [],
@@ -208,8 +242,8 @@ export const acceptanceRouter = router({
};
}),
- /** Recent acceptances, newest first — the CLI list surface. */
- list: acceptanceProcedure.query(async ({ ctx }) => ctx.acceptanceService.acceptanceModel.query()),
+ /** Recent acceptances (with subject headers), newest first — list panel + CLI. */
+ list: acceptanceProcedure.query(async ({ ctx }) => ctx.acceptanceService.listWithSubjects()),
/**
* The user rejects the delivery. The comment is a re-tasking input: it is
diff --git a/apps/server/src/services/verify/acceptanceService.ts b/apps/server/src/services/verify/acceptanceService.ts
index c6dd85f0de1..e47468b0c48 100644
--- a/apps/server/src/services/verify/acceptanceService.ts
+++ b/apps/server/src/services/verify/acceptanceService.ts
@@ -505,6 +505,18 @@ export class AcceptanceService {
};
};
+ /**
+ * Recent aggregates with their subject headers — the list-panel payload.
+ * Titles resolve in parallel per row (bounded by the list limit); a deleted
+ * subject degrades to a null title instead of dropping the row.
+ */
+ listWithSubjects = async (limit = 50) => {
+ const rows = await this.acceptanceModel.query(limit);
+ return Promise.all(
+ rows.map(async (row) => ({ ...row, subject: await this.resolveSubject(row) })),
+ );
+ };
+
/** The rounds + their per-round data the bundle and the union both read. */
loadRounds = async (acceptanceId: string) => {
const runs = await this.runModel.listByAcceptance(acceptanceId);
diff --git a/locales/en-US/verify.json b/locales/en-US/verify.json
index a01d8eac597..be700d5f5aa 100644
--- a/locales/en-US/verify.json
+++ b/locales/en-US/verify.json
@@ -40,6 +40,7 @@
"acceptance.filter.all": "All {{count}}",
"acceptance.filter.exception": "Exceptions {{count}}",
"acceptance.filter.fixed": "Fixed {{count}}",
+ "acceptance.group.collapse": "Collapse {{label}}",
"acceptance.group.collapseAll": "Collapse groups",
"acceptance.group.collapseItems": "Collapse checks in this group",
"acceptance.group.expandAll": "Expand groups",
@@ -58,7 +59,7 @@
"acceptance.ledger.viewReport": "View round report",
"acceptance.reject.description": "Your reason becomes input for the next repair round; this is not a passive comment.",
"acceptance.reject.placeholder": "Describe what must change before this delivery can be accepted.",
- "acceptance.reportDrawer.title": "Round {{round}} · verification report",
+ "acceptance.reportDrawer.close": "Close the round report",
"acceptance.requirementLabel": "Acceptance bar",
"acceptance.round": "Round {{round}}",
"acceptance.roundCount": "{{count}} verification round(s)",
@@ -86,7 +87,15 @@
"acceptance.subject.topic": "Topic",
"acceptance.surface.other": "Other",
"acceptance.titleFallback": "Delivery acceptance",
+ "acceptance.verdict.exceptions": "{{count}} exception(s) need your judgment",
+ "acceptance.verdict.latestAt": "last verified {{time}}",
+ "acceptance.verdict.passed": "All checks passed",
"acceptance.viewFullReport": "View full report",
+ "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.listEmpty": "Ingest a verification report with the CLI and its acceptance will show up here.",
+ "acceptance.workspace.listEmptyTitle": "No acceptances yet",
+ "acceptance.workspace.title": "Acceptances",
"badge.errored": "Check could not run",
"badge.failed": "Check failed",
"badge.passed": "Check passed",
diff --git a/locales/zh-CN/verify.json b/locales/zh-CN/verify.json
index 52285092c57..8838c9335b3 100644
--- a/locales/zh-CN/verify.json
+++ b/locales/zh-CN/verify.json
@@ -40,6 +40,7 @@
"acceptance.filter.all": "全部 {{count}}",
"acceptance.filter.exception": "例外 {{count}}",
"acceptance.filter.fixed": "已修复 {{count}}",
+ "acceptance.group.collapse": "收起{{label}}",
"acceptance.group.collapseAll": "收起分组",
"acceptance.group.collapseItems": "收起本组检查项",
"acceptance.group.expandAll": "展开分组",
@@ -58,7 +59,7 @@
"acceptance.ledger.viewReport": "查看该轮报告",
"acceptance.reject.description": "打回不是留言:你的意见将作为输入,发起新一轮修复,完成后回到「待验收」。",
"acceptance.reject.placeholder": "说明打回原因,例如:深色模式需补截图证据……",
- "acceptance.reportDrawer.title": "第 {{round}} 轮 · 交付验证报告",
+ "acceptance.reportDrawer.close": "关闭该轮报告",
"acceptance.requirementLabel": "验收要求",
"acceptance.round": "第 {{round}} 轮",
"acceptance.roundCount": "{{count}} 轮验证",
@@ -86,7 +87,15 @@
"acceptance.subject.topic": "话题",
"acceptance.surface.other": "其他",
"acceptance.titleFallback": "交付验收",
+ "acceptance.verdict.exceptions": "{{count}} 项例外待你判断",
+ "acceptance.verdict.latestAt": "最近验证 {{time}}",
+ "acceptance.verdict.passed": "检查全部通过",
"acceptance.viewFullReport": "查看完整报告",
+ "acceptance.workspace.emptyDetail.description": "在左侧选择一条验收记录,查看它的检查项、轮次与证据。",
+ "acceptance.workspace.emptyDetail.title": "选择一条验收",
+ "acceptance.workspace.listEmpty": "用 CLI ingest 一份验证报告后,对应的验收会出现在这里。",
+ "acceptance.workspace.listEmptyTitle": "还没有验收记录",
+ "acceptance.workspace.title": "验收",
"badge.errored": "检查无法运行",
"badge.failed": "检查未通过",
"badge.passed": "检查通过",
diff --git a/packages/locales/src/default/verify.ts b/packages/locales/src/default/verify.ts
index 3e3164e1438..90351a882df 100644
--- a/packages/locales/src/default/verify.ts
+++ b/packages/locales/src/default/verify.ts
@@ -50,6 +50,7 @@ export default {
'acceptance.filter.all': 'All {{count}}',
'acceptance.filter.exception': 'Exceptions {{count}}',
'acceptance.filter.fixed': 'Fixed {{count}}',
+ 'acceptance.group.collapse': 'Collapse {{label}}',
'acceptance.group.collapseAll': 'Collapse groups',
'acceptance.group.collapseItems': 'Collapse checks in this group',
'acceptance.group.expandAll': 'Expand groups',
@@ -71,7 +72,7 @@ export default {
'Your reason becomes input for the next repair round; this is not a passive comment.',
'acceptance.reject.placeholder':
'Describe what must change before this delivery can be accepted.',
- 'acceptance.reportDrawer.title': 'Round {{round}} · verification report',
+ 'acceptance.reportDrawer.close': 'Close the round report',
'acceptance.requirementLabel': 'Acceptance bar',
'acceptance.round': 'Round {{round}}',
'acceptance.roundCount': '{{count}} verification round(s)',
@@ -99,7 +100,17 @@ export default {
'acceptance.subject.topic': 'Topic',
'acceptance.surface.other': 'Other',
'acceptance.titleFallback': 'Delivery acceptance',
+ 'acceptance.verdict.exceptions': '{{count}} exception(s) need your judgment',
+ 'acceptance.verdict.latestAt': 'last verified {{time}}',
+ 'acceptance.verdict.passed': 'All checks passed',
'acceptance.viewFullReport': 'View full report',
+ '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.listEmpty':
+ 'Ingest a verification report with the CLI and its acceptance will show up here.',
+ 'acceptance.workspace.listEmptyTitle': 'No acceptances yet',
+ 'acceptance.workspace.title': 'Acceptances',
'report.actions.copyLink': 'Copy link',
'report.actions.copyLinkSuccess': 'Link copied',
'report.actions.openInBrowser': 'Open in browser',
diff --git a/src/features/Conversation/Markdown/plugins/Link/Render/InternalEntityLink.tsx b/src/features/Conversation/Markdown/plugins/Link/Render/InternalEntityLink.tsx
index fb414f0b075..b5b8b7b9c0f 100644
--- a/src/features/Conversation/Markdown/plugins/Link/Render/InternalEntityLink.tsx
+++ b/src/features/Conversation/Markdown/plugins/Link/Render/InternalEntityLink.tsx
@@ -74,12 +74,14 @@ interface InternalEntityLinkProps {
export const InternalEntityLink = memo<InternalEntityLinkProps>(({ href, label, reference }) => {
const navigate = useWorkspaceAwareNavigate();
const activeAgentId = useAgentStore((s) => s.activeAgentId);
- const [openAgentDetail, openDocument, openTaskDetail, openVerifyReport] = useChatStore((s) => [
- s.openAgentDetail,
- s.openDocument,
- s.openTaskDetail,
- s.openVerifyReport,
- ]);
+ const [openAcceptance, openAgentDetail, openDocument, openTaskDetail, openVerifyReport] =
+ useChatStore((s) => [
+ s.openAcceptance,
+ s.openAgentDetail,
+ s.openDocument,
+ s.openTaskDetail,
+ s.openVerifyReport,
+ ]);
const linkedAgentId = reference.type === 'document' ? reference.agentId : undefined;
const shouldResolveAgentDocument = !!linkedAgentId && linkedAgentId === activeAgentId;
const { data: agentDocuments, mutate: resolveAgentDocuments } = useClientDataSWR(
@@ -99,7 +101,14 @@ export const InternalEntityLink = memo<InternalEntityLinkProps>(({ href, label,
event.preventDefault();
- if ('workspaceSlug' in reference && reference.workspaceSlug && reference.type !== 'verify') {
+ // Portal-backed entities (verify / acceptance) open in-context regardless
+ // of workspace scope — their reads are id-addressed and scope-independent.
+ if (
+ 'workspaceSlug' in reference &&
+ reference.workspaceSlug &&
+ reference.type !== 'verify' &&
+ reference.type !== 'acceptance'
+ ) {
navigate(reference.pathname, { escape: true });
return;
}
@@ -115,7 +124,10 @@ export const InternalEntityLink = memo<InternalEntityLinkProps>(({ href, label,
switch (reference.type) {
case 'acceptance': {
- navigate(reference.pathname);
+ // The conversation is the working surface — the acceptance opens
+ // beside it in the portal, same as a verify report, never a
+ // full-page navigation away from the chat.
+ openAcceptance(reference.acceptanceId);
break;
}
case 'agent': {
@@ -151,6 +163,7 @@ export const InternalEntityLink = memo<InternalEntityLinkProps>(({ href, label,
activeAgentId,
agentDocuments,
navigate,
+ openAcceptance,
openAgentDetail,
openDocument,
openTaskDetail,
diff --git a/src/features/Conversation/Markdown/plugins/Link/Render/index.test.tsx b/src/features/Conversation/Markdown/plugins/Link/Render/index.test.tsx
index dfed5c3db8a..247201c7b18 100644
--- a/src/features/Conversation/Markdown/plugins/Link/Render/index.test.tsx
+++ b/src/features/Conversation/Markdown/plugins/Link/Render/index.test.tsx
@@ -23,6 +23,7 @@ let mockShowIcon = true;
let mockEnableInAppBrowser = false;
const mockOpenInBrowserTab = vi.fn();
const mockNavigate = vi.fn();
+const mockOpenAcceptance = vi.fn();
const mockOpenAgentDetail = vi.fn();
const mockOpenDocument = vi.fn();
const mockOpenTaskDetail = vi.fn();
@@ -55,6 +56,7 @@ vi.mock('@/store/agent', () => ({
vi.mock('@/store/chat', () => ({
useChatStore: (selector: (state: unknown) => unknown) =>
selector({
+ openAcceptance: mockOpenAcceptance,
openAgentDetail: mockOpenAgentDetail,
openDocument: mockOpenDocument,
openTaskDetail: mockOpenTaskDetail,
@@ -169,7 +171,7 @@ describe('Link Render — message link icon toggle', () => {
});
describe('Link Render — internal entities', () => {
- it('renders acceptance links as dedicated entities and navigates in-app', () => {
+ it('opens acceptance links in the conversation portal, never a full-page navigation', () => {
const { getByRole } = renderLink({
linkHref: '/acceptance/acceptance-1',
linkKind: 'generic',
@@ -178,7 +180,8 @@ describe('Link Render — internal entities', () => {
fireEvent.click(getByRole('link', { name: 'Acceptance' }));
- expect(mockNavigate).toHaveBeenCalledWith('/acceptance/acceptance-1');
+ expect(mockOpenAcceptance).toHaveBeenCalledWith('acceptance-1');
+ expect(mockNavigate).not.toHaveBeenCalled();
});
it('opens official document links in the conversation portal', () => {
diff --git a/src/features/Portal/Acceptance/Body.tsx b/src/features/Portal/Acceptance/Body.tsx
new file mode 100644
index 00000000000..1be88c70d13
--- /dev/null
+++ b/src/features/Portal/Acceptance/Body.tsx
@@ -0,0 +1,13 @@
+import { memo } from 'react';
+
+import { AcceptanceViewer } from '@/features/Verify';
+import { useChatStore } from '@/store/chat';
+import { chatPortalSelectors } from '@/store/chat/selectors';
+
+const Body = memo(() => {
+ const acceptanceId = useChatStore(chatPortalSelectors.acceptancePortalId);
+
+ return <AcceptanceViewer acceptanceId={acceptanceId} />;
+});
+
+export default Body;
diff --git a/src/features/Portal/Acceptance/Header.tsx b/src/features/Portal/Acceptance/Header.tsx
new file mode 100644
index 00000000000..8c830e13500
--- /dev/null
+++ b/src/features/Portal/Acceptance/Header.tsx
@@ -0,0 +1,69 @@
+import { DESKTOP_HEADER_ICON_SMALL_SIZE, isDesktop } from '@lobechat/const';
+import { ActionIcon, copyToClipboard, Flexbox } from '@lobehub/ui';
+import { App } from 'antd';
+import { Copy, ExternalLink } from 'lucide-react';
+import { memo } from 'react';
+import { useTranslation } from 'react-i18next';
+
+import { useActiveWorkspaceSlug } from '@/business/client/hooks/useActiveWorkspaceSlug';
+import { buildWorkspaceAwarePath } from '@/features/Workspace/workspaceAwarePath';
+import { useAppOrigin } from '@/hooks/useAppOrigin';
+import { electronSystemService } from '@/services/electron/system';
+import { useChatStore } from '@/store/chat';
+import { chatPortalSelectors } from '@/store/chat/selectors';
+
+import Header from '../components/Header';
+import Title from './Title';
+
+const AcceptanceHeader = memo(() => {
+ const { message } = App.useApp();
+ const { t } = useTranslation('verify');
+ const appOrigin = useAppOrigin();
+ const activeWorkspaceSlug = useActiveWorkspaceSlug();
+ const acceptanceId = useChatStore(chatPortalSelectors.acceptancePortalId);
+ const pagePath = acceptanceId
+ ? buildWorkspaceAwarePath(`/acceptance/${acceptanceId}`, activeWorkspaceSlug)
+ : undefined;
+ const pageUrl = pagePath ? `${appOrigin}${pagePath}` : undefined;
+ // Without an origin the URL is relative — the system browser has nothing to resolve it against.
+ const externalUrl = appOrigin && pageUrl ? pageUrl : undefined;
+
+ return (
+ <Header
+ title={<Title />}
+ rightExtra={
+ <Flexbox horizontal gap={4}>
+ <ActionIcon
+ disabled={!pageUrl}
+ icon={Copy}
+ size={DESKTOP_HEADER_ICON_SMALL_SIZE}
+ title={t('report.actions.copyLink')}
+ onClick={async () => {
+ if (!pageUrl) return;
+ await copyToClipboard(pageUrl);
+ message.success(t('report.actions.copyLinkSuccess'));
+ }}
+ />
+ <ActionIcon
+ disabled={!externalUrl}
+ icon={ExternalLink}
+ size={DESKTOP_HEADER_ICON_SMALL_SIZE}
+ title={t('report.actions.openInBrowser')}
+ onClick={() => {
+ if (!externalUrl) return;
+ // In Electron a `window.open` is denied by the window-open handler,
+ // so hand the URL to the system browser through the main process.
+ if (isDesktop) {
+ void electronSystemService.openExternalLink(externalUrl);
+ return;
+ }
+ window.open(externalUrl, '_blank', 'noopener,noreferrer');
+ }}
+ />
+ </Flexbox>
+ }
+ />
+ );
+});
+
+export default AcceptanceHeader;
diff --git a/src/features/Portal/Acceptance/Title.tsx b/src/features/Portal/Acceptance/Title.tsx
new file mode 100644
index 00000000000..247f309a55e
--- /dev/null
+++ b/src/features/Portal/Acceptance/Title.tsx
@@ -0,0 +1,16 @@
+import { memo } from 'react';
+import { useTranslation } from 'react-i18next';
+
+import { useAcceptanceBundle } from '@/features/Verify/hooks';
+import { useChatStore } from '@/store/chat';
+import { chatPortalSelectors } from '@/store/chat/selectors';
+
+const Title = memo(() => {
+ const { t } = useTranslation('verify');
+ const acceptanceId = useChatStore(chatPortalSelectors.acceptancePortalId);
+ const { data } = useAcceptanceBundle(acceptanceId ?? null);
+
+ return data?.subject.title || t('acceptance.titleFallback');
+});
+
+export default Title;
diff --git a/src/features/Portal/Acceptance/index.ts b/src/features/Portal/Acceptance/index.ts
new file mode 100644
index 00000000000..5194ef96571
--- /dev/null
+++ b/src/features/Portal/Acceptance/index.ts
@@ -0,0 +1,6 @@
+import type { PortalImpl } from '../type';
+import Body from './Body';
+import Header from './Header';
+import Title from './Title';
+
+export const Acceptance: PortalImpl = { Body, Header, Title };
diff --git a/src/features/Portal/router.tsx b/src/features/Portal/router.tsx
index 09470c8e30d..4694fcac6f8 100644
--- a/src/features/Portal/router.tsx
+++ b/src/features/Portal/router.tsx
@@ -6,6 +6,7 @@ import { useChatStore } from '@/store/chat';
import { chatPortalSelectors } from '@/store/chat/selectors';
import { PortalViewType } from '@/store/chat/slices/portal/initialState';
+import { Acceptance } from './Acceptance';
import { AgentDetail } from './AgentDetail';
import { Artifacts } from './Artifacts';
import Header from './components/Header';
@@ -25,6 +26,7 @@ import { VerifyResult } from './VerifyResult';
// View type to component mapping
const VIEW_COMPONENTS: Record<PortalViewType, PortalImpl> = {
+ [PortalViewType.Acceptance]: Acceptance,
[PortalViewType.AgentDetail]: AgentDetail,
[PortalViewType.Home]: {
Body: HomeBody,
diff --git a/src/features/Verify/Acceptance/CheckList.tsx b/src/features/Verify/Acceptance/CheckList.tsx
index f500d155189..c43516e4840 100644
--- a/src/features/Verify/Acceptance/CheckList.tsx
+++ b/src/features/Verify/Acceptance/CheckList.tsx
@@ -21,6 +21,11 @@ import { useTranslation } from 'react-i18next';
import type { AcceptanceBundle } from '@/services/verify';
+import {
+ EvidenceComparisonCard,
+ readEvidenceComparison,
+} from '../components/EvidenceComparisonCard';
+
export type AcceptanceCheck = AcceptanceBundle['checks'][number];
export type AcceptanceCheckState = AcceptanceCheck['state'];
type AcceptanceEvidence = AcceptanceCheck['evidence'][number];
@@ -109,6 +114,25 @@ const styles = createStaticStyles(({ css }) => ({
border-radius: ${cssVar.borderRadiusLG};
background: ${cssVar.colorBgContainer};
`,
+ groupFooter: css`
+ cursor: pointer;
+
+ display: flex;
+ gap: 4px;
+ align-items: center;
+ justify-content: center;
+
+ padding-block: 6px;
+ border-block-start: 1px solid ${cssVar.colorBorderSecondary};
+
+ font-size: 12px;
+ color: ${cssVar.colorTextQuaternary};
+
+ &:hover {
+ color: ${cssVar.colorTextSecondary};
+ background: ${cssVar.colorFillQuaternary};
+ }
+ `,
groupHeader: css`
cursor: pointer;
padding-block: 10px;
@@ -188,13 +212,68 @@ const EVIDENCE_BADGES = [
const isFilename = (value: string | null | undefined) =>
!value || /^[\w.-]+\.(?:gif|jpe?g|mp4|png|webm|webp)$/i.test(value);
+/** Flat media for a comparison side — the card frames it, so no own border/radius. */
+const comparisonContent = (item: AcceptanceEvidence) =>
+ item.type === 'video' ? (
+ <video controls src={item.fileUrl!} style={{ display: 'block', width: '100%' }} />
+ ) : (
+ <Image
+ preview
+ alt={item.description ?? item.fileName ?? item.type}
+ loading={'lazy'}
+ src={item.fileUrl!}
+ style={{ borderRadius: 0, width: '100%' }}
+ variant={'borderless'}
+ />
+ );
+
const EvidenceList = memo<{ evidence: AcceptanceEvidence[] }>(({ evidence }) => {
const sorted = [...evidence].sort((a, b) => (isVisual(b) ? 1 : 0) - (isVisual(a) ? 1 : 0));
if (sorted.length === 0) return null;
+ // Before/after pairs render as one fused comparison card (same component as
+ // the verify report). Only complete pairs fuse; a lone half stays a plain
+ // artifact, matching the ingest CLI's warning semantics.
+ const groups = new Map<string, Partial<Record<'after' | 'before', AcceptanceEvidence>>>();
+ for (const item of sorted) {
+ if (!isVisual(item)) continue;
+ const comparison = readEvidenceComparison(item.metadata);
+ if (!comparison) continue;
+ const group = groups.get(comparison.id) ?? {};
+ group[comparison.role] = item;
+ groups.set(comparison.id, group);
+ }
+ const pairedIds = new Set(
+ [...groups.values()]
+ .filter((group) => group.before && group.after)
+ .flatMap((group) => [group.before!.id, group.after!.id]),
+ );
+
+ const comparisonSide = (item: AcceptanceEvidence) => ({
+ caption:
+ readEvidenceComparison(item.metadata)?.label ??
+ (isFilename(item.description) ? undefined : (item.description ?? undefined)),
+ content: comparisonContent(item),
+ });
+
return (
<Flexbox gap={12}>
{sorted.map((item) => {
+ if (pairedIds.has(item.id)) {
+ const comparison = readEvidenceComparison(item.metadata)!;
+ // The pair renders once, anchored at its `before` half.
+ if (comparison.role !== 'before') return null;
+ const group = groups.get(comparison.id)!;
+ return (
+ <EvidenceComparisonCard
+ after={comparisonSide(group.after!)}
+ before={comparisonSide(group.before!)}
+ key={comparison.id}
+ layout={comparison.layout}
+ />
+ );
+ }
+
const caption = !isFilename(item.description) && (
<span className={styles.caption}>{item.description}</span>
);
@@ -611,6 +690,14 @@ const CheckList = memo<CheckListProps>(
onToggle={() => onToggleItem(check.id)}
/>
))}
+ {/* Bottom escape hatch — after scrolling through the group's rows,
+ collapse it without travelling back to the header. */}
+ {!collapsed && (
+ <div className={styles.groupFooter} onClick={() => onToggleGroup(key)}>
+ <Icon icon={ChevronsDownUp} size={12} />
+ {t('acceptance.group.collapse', { label })}
+ </div>
+ )}
</Fragment>
);
})}
diff --git a/src/features/Verify/Acceptance/LedgerPanel.tsx b/src/features/Verify/Acceptance/LedgerPanel.tsx
index 6a532c95fda..83e14cdba21 100644
--- a/src/features/Verify/Acceptance/LedgerPanel.tsx
+++ b/src/features/Verify/Acceptance/LedgerPanel.tsx
@@ -1,14 +1,13 @@
'use client';
import { ActionIcon, Flexbox, Icon, Text } from '@lobehub/ui';
-import { Button } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar, cx } from 'antd-style';
import dayjs from 'dayjs';
import {
CheckCircle2,
+ ChevronRight,
CircleAlert,
FileClock,
- FileText,
HelpCircle,
Loader2,
PanelRightClose,
@@ -29,12 +28,32 @@ const styles = createStaticStyles(({ css }) => ({
border: 1px solid ${cssVar.colorBorderSecondary};
border-radius: ${cssVar.borderRadius};
- transition: box-shadow 0.2s ease;
+ transition:
+ box-shadow 0.2s ease,
+ border-color 0.2s ease;
`,
roundActive: css`
border-color: ${cssVar.colorPrimary};
box-shadow: 0 0 0 2px ${cssVar.colorPrimaryBg};
`,
+ /* The whole card is the report affordance — no inner button. */
+ roundClickable: css`
+ cursor: pointer;
+
+ .acceptance-round-open-hint {
+ opacity: 0;
+ transition: opacity 0.2s ease;
+ }
+
+ &:hover {
+ border-color: ${cssVar.colorBorder};
+ background: ${cssVar.colorFillQuaternary};
+
+ .acceptance-round-open-hint {
+ opacity: 1;
+ }
+ }
+ `,
}));
const STATUS_META: Record<string, { color: string; icon: typeof CheckCircle2 }> = {
@@ -103,11 +122,20 @@ const LedgerPanel = memo<LedgerPanelProps>(({ highlight, onCollapse, onOpenRepor
: null;
const commit = (round.run.context as { commit?: string } | null)?.commit;
+ const openable = Boolean(round.report);
+
return (
<Flexbox
- className={cx(styles.round, highlight === round.run.roundIndex && styles.roundActive)}
+ aria-label={openable ? t('acceptance.ledger.viewReport') : undefined}
gap={6}
key={round.run.id}
+ role={openable ? 'button' : undefined}
+ className={cx(
+ styles.round,
+ openable && styles.roundClickable,
+ highlight === round.run.roundIndex && styles.roundActive,
+ )}
+ onClick={openable ? () => onOpenReport(round) : undefined}
>
<Flexbox horizontal align={'center'} gap={8}>
<Text strong style={{ fontSize: 13 }}>
@@ -131,6 +159,14 @@ const LedgerPanel = memo<LedgerPanelProps>(({ highlight, onCollapse, onOpenRepor
<Text fontSize={12} type={'secondary'}>
{dayjs(round.run.createdAt).format('MM-DD HH:mm')}
</Text>
+ {openable && (
+ <Icon
+ className={'acceptance-round-open-hint'}
+ color={cssVar.colorTextTertiary}
+ icon={ChevronRight}
+ size={14}
+ />
+ )}
</Flexbox>
{round.run.title && (
<Text fontSize={12} style={{ lineHeight: 1.5 }} type={'secondary'}>
@@ -142,13 +178,6 @@ const LedgerPanel = memo<LedgerPanelProps>(({ highlight, onCollapse, onOpenRepor
{[stats, commit?.slice(0, 10)].filter(Boolean).join(' · ')}
</Text>
)}
- {round.report && (
- <Flexbox horizontal>
- <Button size={'small'} type={'text'} onClick={() => onOpenReport(round)}>
- <Icon icon={FileText} size={13} /> {t('acceptance.ledger.viewReport')}
- </Button>
- </Flexbox>
- )}
</Flexbox>
);
})}
diff --git a/src/features/Verify/Acceptance/Workspace/AcceptanceListPanel.tsx b/src/features/Verify/Acceptance/Workspace/AcceptanceListPanel.tsx
new file mode 100644
index 00000000000..f3cd878fcce
--- /dev/null
+++ b/src/features/Verify/Acceptance/Workspace/AcceptanceListPanel.tsx
@@ -0,0 +1,372 @@
+'use client';
+
+import type { AcceptanceStatus } from '@lobechat/types';
+import {
+ Center,
+ DraggablePanel,
+ DraggablePanelContainer,
+ type DraggablePanelProps,
+ Empty,
+ Flexbox,
+ Icon,
+ Text,
+} from '@lobehub/ui';
+import { createStaticStyles, cssVar } from 'antd-style';
+import dayjs from 'dayjs';
+import isEqual from 'fast-deep-equal';
+import {
+ BadgeCheck,
+ CircleCheck,
+ CircleHelp,
+ CircleX,
+ LoaderCircle,
+ PanelLeftClose,
+ ScrollText,
+ Search,
+ TriangleAlert,
+} from 'lucide-react';
+import { memo, useState } from 'react';
+import { useTranslation } from 'react-i18next';
+import { useNavigate, useParams } from 'react-router';
+
+import NavItem from '@/features/NavPanel/components/NavItem';
+import { SkeletonList } from '@/features/NavPanel/components/SkeletonList';
+import { useGlobalStore } from '@/store/global';
+import { systemStatusSelectors } from '@/store/global/selectors';
+
+import { useAcceptanceList } from '../../hooks';
+import type { ReportPanelExpand } from '../../Workspace/useReportPanelExpand';
+
+const PANEL_MIN = 260;
+const PANEL_MAX = 420;
+
+const styles = createStaticStyles(({ css }) => ({
+ panel: css`
+ height: 100%;
+ background: ${cssVar.colorBgLayout};
+ `,
+ head: css`
+ flex: none;
+ padding-block: 14px 6px;
+ padding-inline: 12px;
+ `,
+ titleRow: css`
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ padding-inline: 4px;
+ `,
+ collapseBtn: css`
+ cursor: pointer;
+
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+
+ width: 26px;
+ height: 26px;
+ border: none;
+ border-radius: 4px;
+
+ color: ${cssVar.colorTextTertiary};
+
+ background: none;
+
+ &:hover {
+ color: ${cssVar.colorText};
+ background: ${cssVar.colorFillTertiary};
+ }
+ `,
+ search: css`
+ display: flex;
+ gap: 7px;
+ align-items: center;
+
+ height: 32px;
+ margin-block: 8px 4px;
+ margin-inline: 4px;
+ padding-inline: 10px;
+ border: 1px solid ${cssVar.colorBorderSecondary};
+ border-radius: ${cssVar.borderRadius};
+
+ background: ${cssVar.colorBgContainer};
+
+ svg {
+ flex: none;
+ color: ${cssVar.colorTextQuaternary};
+ }
+
+ input {
+ width: 100%;
+ min-width: 0;
+ border: none;
+
+ font-size: 13px;
+ color: ${cssVar.colorText};
+
+ background: none;
+ outline: none;
+
+ &::placeholder {
+ color: ${cssVar.colorTextQuaternary};
+ }
+ }
+ `,
+ searchEmpty: css`
+ display: flex;
+ flex-direction: column;
+ gap: 10px;
+ align-items: flex-start;
+
+ padding-block: 24px;
+ padding-inline: 12px;
+ `,
+ searchEmptyMsg: css`
+ font-size: 12px;
+ line-height: 1.6;
+ 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;
+ gap: 2px;
+
+ padding-block: 6px 16px;
+ padding-inline: 8px;
+ `,
+ spin: css`
+ animation: acceptance-spin 1.1s linear infinite;
+
+ @keyframes acceptance-spin {
+ to {
+ transform: rotate(360deg);
+ }
+ }
+ `,
+ itemSub: css`
+ display: flex;
+ gap: 8px;
+
+ margin-block-start: 2px;
+
+ font-size: 12px;
+ color: ${cssVar.colorTextTertiary};
+ `,
+ emptyState: css`
+ height: 100%;
+ min-height: 240px;
+ padding-block: 24px;
+ padding-inline: 16px;
+ `,
+ retryBtn: css`
+ cursor: pointer;
+
+ padding-block: 4px;
+ padding-inline: 10px;
+ border: 1px solid ${cssVar.colorBorder};
+ border-radius: 4px;
+
+ font-size: 12px;
+ color: ${cssVar.colorTextSecondary};
+
+ background: ${cssVar.colorBgContainer};
+
+ &:hover {
+ border-color: ${cssVar.colorTextTertiary};
+ color: ${cssVar.colorText};
+ }
+ `,
+}));
+
+type Glyph = 'ok' | 'bad' | 'unsure' | 'running' | 'accepted';
+
+const RUNNING_STATUSES = new Set<AcceptanceStatus>([
+ 'pending',
+ 'planned',
+ 'verifying',
+ 'repairing',
+]);
+
+const glyphOf = (status: AcceptanceStatus): Glyph => {
+ if (RUNNING_STATUSES.has(status)) return 'running';
+ if (status === 'accepted') return 'accepted';
+ if (status === 'rejected') return 'bad';
+ if (status === 'errored') return 'unsure';
+ return 'ok';
+};
+
+const glyphMeta: Record<Glyph, { color: string; icon: typeof CircleCheck }> = {
+ accepted: { color: cssVar.colorSuccess, icon: BadgeCheck },
+ bad: { color: cssVar.colorError, icon: CircleX },
+ ok: { color: cssVar.colorSuccess, icon: CircleCheck },
+ running: { color: cssVar.colorInfo, icon: LoaderCircle },
+ unsure: { color: cssVar.colorWarning, icon: CircleHelp },
+};
+
+const relativeTime = (value?: Date | string | null) => {
+ if (!value) return '';
+ const d = dayjs(value);
+ return dayjs().diff(d, 'day') < 7 ? d.fromNow() : d.format('MMM D');
+};
+
+/**
+ * Master list of the caller's acceptance aggregates — the acceptance twin of
+ * the verify workspace's ReportListPanel, sharing its visual language and the
+ * same persisted panel-width preference so the two surfaces read as one family.
+ */
+const AcceptanceListPanel = memo<ReportPanelExpand>(({ expand, isNarrow, setExpand }) => {
+ const { t } = useTranslation('verify');
+ const navigate = useNavigate();
+ const { acceptanceId } = useParams<{ acceptanceId: string }>();
+
+ const { data, error, isLoading, mutate } = useAcceptanceList(true);
+
+ // 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 [panelWidth, updateSystemStatus] = useGlobalStore((s) => [
+ systemStatusSelectors.verifyReportPanelWidth(s),
+ s.updateSystemStatus,
+ ]);
+
+ const handleSizeChange: DraggablePanelProps['onSizeChange'] = (_, size) => {
+ if (!size) return;
+ const w = typeof size.width === 'string' ? Number.parseInt(size.width) : size.width;
+ if (!w || isEqual(w, panelWidth)) return;
+ updateSystemStatus({ verifyReportPanelWidth: w });
+ };
+
+ return (
+ <DraggablePanel
+ className={styles.panel}
+ defaultSize={{ width: panelWidth }}
+ expand={expand}
+ maxWidth={PANEL_MAX}
+ minWidth={PANEL_MIN}
+ mode={isNarrow ? 'float' : 'fixed'}
+ placement={'left'}
+ size={{ height: '100%', width: panelWidth }}
+ onExpandChange={setExpand}
+ onSizeChange={handleSizeChange}
+ >
+ <DraggablePanelContainer style={{ flex: 'none', height: '100%', minWidth: PANEL_MIN }}>
+ <div className={styles.head}>
+ <div className={styles.titleRow}>
+ <Text strong style={{ fontSize: 15 }}>
+ {t('acceptance.workspace.title')}
+ </Text>
+ <button
+ aria-label={t('workspace.collapse')}
+ className={styles.collapseBtn}
+ title={t('workspace.collapse')}
+ type={'button'}
+ onClick={() => setExpand(false)}
+ >
+ <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>
+
+ <Flexbox flex={1} style={{ minHeight: 0, overflowX: 'hidden', overflowY: 'auto' }}>
+ {error ? (
+ // A failed fetch must read as an error with a retry — never as an
+ // empty "no acceptances" page.
+ <Center className={styles.emptyState} gap={12}>
+ <Empty
+ description={t('workspace.loadError')}
+ icon={TriangleAlert}
+ title={t('workspace.loadErrorTitle')}
+ />
+ <button className={styles.retryBtn} type={'button'} onClick={() => void mutate()}>
+ {t('workspace.retry')}
+ </button>
+ </Center>
+ ) : isLoading ? (
+ <SkeletonList rows={6} style={{ paddingBlock: 6, paddingInline: 8 }} />
+ ) : filtered.length === 0 ? (
+ trimmedQuery ? (
+ // 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')}
+ </span>
+ <button className={styles.retryBtn} type={'button'} onClick={() => setQuery('')}>
+ {t('workspace.clearSearch')}
+ </button>
+ </div>
+ ) : (
+ <Center className={styles.emptyState}>
+ <Empty
+ description={t('acceptance.workspace.listEmpty')}
+ icon={ScrollText}
+ title={t('acceptance.workspace.listEmptyTitle')}
+ />
+ </Center>
+ )
+ ) : (
+ <div className={styles.list}>
+ {filtered.map((item) => {
+ const glyph = glyphOf(item.status as AcceptanceStatus);
+ const meta = glyphMeta[glyph];
+ const title = item.subject.title || item.subjectId;
+
+ return (
+ <NavItem
+ active={item.id === acceptanceId}
+ key={item.id}
+ title={title}
+ titleColor={cssVar.colorText}
+ description={
+ <Flexbox horizontal className={styles.itemSub} gap={8}>
+ <span>{t(`acceptance.status.${item.status}` as any)}</span>
+ <span>{relativeTime(item.updatedAt ?? item.createdAt)}</span>
+ </Flexbox>
+ }
+ icon={
+ <Icon
+ className={glyph === 'running' ? styles.spin : undefined}
+ icon={meta.icon}
+ size={16}
+ style={{ color: meta.color }}
+ />
+ }
+ onClick={() => navigate(`/acceptance/${item.id}`)}
+ />
+ );
+ })}
+ </div>
+ )}
+ </Flexbox>
+ </DraggablePanelContainer>
+ </DraggablePanel>
+ );
+});
+
+AcceptanceListPanel.displayName = 'AcceptanceListPanel';
+
+export default AcceptanceListPanel;
diff --git a/src/features/Verify/Acceptance/Workspace/EmptyDetail.tsx b/src/features/Verify/Acceptance/Workspace/EmptyDetail.tsx
new file mode 100644
index 00000000000..9cbca3995dc
--- /dev/null
+++ b/src/features/Verify/Acceptance/Workspace/EmptyDetail.tsx
@@ -0,0 +1,24 @@
+'use client';
+
+import { Center, Empty } from '@lobehub/ui';
+import { ScrollText } from 'lucide-react';
+import { memo } from 'react';
+import { useTranslation } from 'react-i18next';
+
+/** Right-pane placeholder shown at `/acceptance` when no aggregate is selected yet. */
+const AcceptanceEmptyDetail = memo(() => {
+ const { t } = useTranslation('verify');
+ return (
+ <Center height={'100%'} width={'100%'}>
+ <Empty
+ description={t('acceptance.workspace.emptyDetail.description')}
+ icon={ScrollText}
+ title={t('acceptance.workspace.emptyDetail.title')}
+ />
+ </Center>
+ );
+});
+
+AcceptanceEmptyDetail.displayName = 'AcceptanceEmptyDetail';
+
+export default AcceptanceEmptyDetail;
diff --git a/src/features/Verify/Acceptance/Workspace/index.tsx b/src/features/Verify/Acceptance/Workspace/index.tsx
new file mode 100644
index 00000000000..5c144d53946
--- /dev/null
+++ b/src/features/Verify/Acceptance/Workspace/index.tsx
@@ -0,0 +1,95 @@
+'use client';
+
+import { Flexbox, Icon } from '@lobehub/ui';
+import { createStaticStyles, cssVar } from 'antd-style';
+import { PanelLeftOpen } from 'lucide-react';
+import { memo } from 'react';
+import { useTranslation } from 'react-i18next';
+import { Outlet } from 'react-router';
+
+import { RouteMetaBridge } from '@/features/RouteMeta';
+import { useUserStore } from '@/store/user';
+import { authSelectors } from '@/store/user/slices/auth/selectors';
+
+import { useReportPanelExpand } from '../../Workspace/useReportPanelExpand';
+import AcceptanceListPanel from './AcceptanceListPanel';
+
+const styles = createStaticStyles(({ css }) => ({
+ expandBtn: css`
+ cursor: pointer;
+
+ position: absolute;
+ z-index: 20;
+ inset-block-start: 12px;
+ inset-inline-start: 12px;
+
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+
+ width: 28px;
+ height: 28px;
+ border: 1px solid ${cssVar.colorBorderSecondary};
+ border-radius: 6px;
+
+ color: ${cssVar.colorTextTertiary};
+
+ background: ${cssVar.colorBgContainer};
+
+ &:hover {
+ border-color: ${cssVar.colorBorder};
+ color: ${cssVar.colorText};
+ }
+ `,
+ main: css`
+ position: relative;
+
+ flex: 1;
+
+ min-width: 0;
+ height: 100%;
+
+ background: ${cssVar.colorBgContainer};
+ `,
+}));
+
+/**
+ * Acceptance workspace shell — the acceptance twin of {@link VerifyWorkspace}:
+ * a persistent, collapsible acceptance-list panel on the left and the selected
+ * aggregate (or the empty placeholder) rendered through the router `Outlet`.
+ * An anonymous visitor holding a public acceptance link gets only the detail —
+ * the list is the owner's, so it renders for signed-in users alone.
+ */
+const AcceptanceWorkspace = memo(() => {
+ const { t } = useTranslation('verify');
+ const panel = useReportPanelExpand();
+ const isAuthLoaded = useUserStore(authSelectors.isLoaded);
+ const isLogin = useUserStore(authSelectors.isLogin);
+ const canShowList = Boolean(isAuthLoaded && isLogin);
+
+ return (
+ <Flexbox horizontal height={'100dvh'} style={{ overflow: 'hidden' }} width={'100%'}>
+ {/* Standalone route (outside the app main layout): drive the tab title here. */}
+ <RouteMetaBridge />
+ {canShowList && <AcceptanceListPanel {...panel} />}
+ <div className={styles.main}>
+ {canShowList && !panel.expand && (
+ <button
+ aria-label={t('workspace.expand')}
+ className={styles.expandBtn}
+ title={t('workspace.expand')}
+ type={'button'}
+ onClick={() => panel.setExpand(true)}
+ >
+ <Icon icon={PanelLeftOpen} size={16} />
+ </button>
+ )}
+ <Outlet />
+ </div>
+ </Flexbox>
+ );
+});
+
+AcceptanceWorkspace.displayName = 'AcceptanceWorkspace';
+
+export default AcceptanceWorkspace;
diff --git a/src/features/Verify/Acceptance/index.tsx b/src/features/Verify/Acceptance/index.tsx
index ea4893a2d7a..305b39dd88a 100644
--- a/src/features/Verify/Acceptance/index.tsx
+++ b/src/features/Verify/Acceptance/index.tsx
@@ -8,19 +8,17 @@ import {
Empty,
Flexbox,
Icon,
- Markdown,
Tag,
Text,
} from '@lobehub/ui';
import { Button, Segmented } from '@lobehub/ui/base-ui';
-import { createStaticStyles, cssVar } from 'antd-style';
+import { createStaticStyles, cssVar, cx } from 'antd-style';
import dayjs from 'dayjs';
import {
BadgeCheck,
CheckCircle2,
ChevronsDownUp,
ChevronsUpDown,
- FileClock,
FileText,
GitBranch,
GitCommitHorizontal,
@@ -29,6 +27,7 @@ import {
Loader2,
PanelRightOpen,
RotateCcw,
+ X,
} from 'lucide-react';
import { memo, useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
@@ -38,6 +37,7 @@ import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import { verifyService } from '@/services/verify';
import { useAcceptanceBundle } from '../hooks';
+import ReportViewer from '../ReportViewer';
import CheckList, {
type CheckFilter,
groupChecks,
@@ -59,10 +59,31 @@ const styles = createStaticStyles(({ css }) => ({
border-radius: ${cssVar.borderRadiusLG};
background: ${cssVar.colorBgContainer};
`,
+ /* Floats over the headerless report drawer — the report hero is the header. */
+ drawerClose: css`
+ position: absolute;
+ z-index: 10;
+ inset-block-start: 16px;
+ inset-inline-end: 20px;
+
+ border: 1px solid ${cssVar.colorBorderSecondary};
+
+ background: ${cssVar.colorBgContainer};
+
+ &:hover {
+ border-color: ${cssVar.colorBorder};
+ }
+ `,
page: css`
position: relative;
+
overflow: hidden;
+
+ /* AppTheme's root is a centered flex column — without an explicit width the page
+ shrinks to content width and the ledger hugs the shrunken edge, not the viewport */
+ width: 100%;
height: 100%;
+
background: ${cssVar.colorBgLayout};
`,
requirementLabel: css`
@@ -73,13 +94,33 @@ const styles = createStaticStyles(({ css }) => ({
`,
scopeChip: css`
font-size: 12px;
- color: ${cssVar.colorTextSecondary};
+ color: ${cssVar.colorTextTertiary};
+ `,
+ scopeLink: css`
+ cursor: pointer;
+ color: ${cssVar.colorTextTertiary};
+
+ &:hover {
+ color: ${cssVar.colorText};
+ }
`,
summaryClamp: css`
overflow: hidden;
display: -webkit-box;
-webkit-box-orient: vertical;
- -webkit-line-clamp: 5;
+ -webkit-line-clamp: 3;
+ `,
+ verdictPill: css`
+ display: inline-flex;
+ gap: 5px;
+ align-items: center;
+
+ padding-block: 2px;
+ padding-inline: 10px;
+ border-radius: 99px;
+
+ font-size: 12px;
+ font-weight: 500;
`,
}));
@@ -92,8 +133,19 @@ const LIVE_STATUSES = new Set(['pending', 'planned', 'verifying', 'repairing']);
*/
const ENABLE_DECISION_BAR = false;
-const AcceptancePage = memo(() => {
- const { acceptanceId } = useParams<{ acceptanceId: string }>();
+interface AcceptancePageProps {
+ /**
+ * Render for a specific aggregate instead of the route param — the portal
+ * embed path. Embedded surfaces are narrow, so the round ledger starts
+ * collapsed there.
+ */
+ acceptanceId?: string;
+}
+
+const AcceptancePage = memo<AcceptancePageProps>(({ acceptanceId: explicitAcceptanceId }) => {
+ const params = useParams<{ acceptanceId: string }>();
+ const acceptanceId = explicitAcceptanceId ?? params.acceptanceId;
+ const isEmbedded = Boolean(explicitAcceptanceId);
const { t } = useTranslation('verify');
const { data, error, isLoading, mutate } = useAcceptanceBundle(acceptanceId ?? null);
@@ -102,7 +154,7 @@ const AcceptancePage = memo(() => {
const [collapsedGroups, setCollapsedGroups] = useState<Set<string>>(() => new Set());
const [seeded, setSeeded] = useState(false);
const [highlightRound, setHighlightRound] = useState<number | null>(null);
- const [ledgerExpand, setLedgerExpand] = useState(true);
+ const [ledgerExpand, setLedgerExpand] = useState(!isEmbedded);
const [reportRound, setReportRound] = useState<AcceptanceRound | null>(null);
const [pending, setPending] = useState(false);
const [actionError, setActionError] = useState<string>();
@@ -181,6 +233,57 @@ const AcceptancePage = memo(() => {
.filter(Boolean)
.join(' · ');
+ // The header's one-glance verdict: lifecycle state wins; a settled chain
+ // falls back to whether any exception is left for the user to judge.
+ const verdictMeta: {
+ bg: string;
+ color: string;
+ icon: typeof CheckCircle2;
+ label: string;
+ spin?: boolean;
+ } = LIVE_STATUSES.has(acceptance.status)
+ ? {
+ bg: cssVar.colorInfoBg,
+ color: cssVar.colorInfo,
+ icon: Loader2,
+ label: t(`acceptance.status.${acceptance.status}`),
+ spin: true,
+ }
+ : acceptance.status === 'accepted'
+ ? {
+ bg: cssVar.colorSuccessBg,
+ color: cssVar.colorSuccess,
+ icon: BadgeCheck,
+ label: t('acceptance.status.accepted'),
+ }
+ : acceptance.status === 'rejected'
+ ? {
+ bg: cssVar.colorErrorBg,
+ color: cssVar.colorError,
+ icon: RotateCcw,
+ label: t('acceptance.status.rejected'),
+ }
+ : acceptance.status === 'errored'
+ ? {
+ bg: cssVar.colorWarningBg,
+ color: cssVar.colorWarning,
+ icon: HelpCircle,
+ label: t('acceptance.status.errored'),
+ }
+ : counts.exceptions > 0
+ ? {
+ bg: cssVar.colorWarningBg,
+ color: cssVar.colorWarning,
+ icon: HelpCircle,
+ label: t('acceptance.verdict.exceptions', { count: counts.exceptions }),
+ }
+ : {
+ bg: cssVar.colorSuccessBg,
+ color: cssVar.colorSuccess,
+ icon: CheckCircle2,
+ label: t('acceptance.verdict.passed'),
+ };
+
const runAction = async (action: () => Promise<unknown>) => {
try {
setPending(true);
@@ -332,8 +435,10 @@ const AcceptancePage = memo(() => {
paddingInline={24}
style={{ margin: '0 auto', maxWidth: 920, width: '100%' }}
>
- {/* Header — the accepted object and its scope */}
- <Flexbox gap={8}>
+ {/* Header — identity, then the at-a-glance verdict, then provenance.
+ Three separate lines because they answer three different
+ questions: what is this / how did it end / where did it run. */}
+ <Flexbox gap={10}>
<Flexbox horizontal align={'center'} gap={10}>
<Text as={'h1'} style={{ fontSize: 18, margin: 0 }}>
{subject.title ?? subject.id}
@@ -349,6 +454,32 @@ const AcceptancePage = memo(() => {
/>
)}
</Flexbox>
+
+ {/* Verdict line — the page's answer, readable without scrolling */}
+ <Flexbox horizontal align={'center'} gap={10} wrap={'wrap'}>
+ <span
+ className={styles.verdictPill}
+ style={{ background: verdictMeta.bg, color: verdictMeta.color }}
+ >
+ <Icon icon={verdictMeta.icon} size={13} spin={verdictMeta.spin} />
+ {verdictMeta.label}
+ </span>
+ <Text fontSize={12} type={'secondary'}>
+ {[
+ countsText,
+ t('acceptance.roundCount', { count: rounds.length }),
+ currentRound
+ ? t('acceptance.verdict.latestAt', {
+ time: dayjs(currentRound.run.createdAt).format('MM-DD HH:mm'),
+ })
+ : null,
+ ]
+ .filter(Boolean)
+ .join(' · ')}
+ </Text>
+ </Flexbox>
+
+ {/* Provenance — where the verified code came from */}
<Flexbox horizontal align={'center'} gap={16} wrap={'wrap'}>
{scope?.branch && (
<Flexbox horizontal align={'center'} className={styles.scopeChip} gap={4}>
@@ -360,15 +491,23 @@ const AcceptancePage = memo(() => {
<Icon icon={GitCommitHorizontal} size={13} /> {scope.commit.slice(0, 10)}
</Flexbox>
)}
- {scope?.pullRequest?.number && (
- <Flexbox horizontal align={'center'} className={styles.scopeChip} gap={4}>
- <Icon icon={GitPullRequest} size={13} /> #{scope.pullRequest.number}
- </Flexbox>
- )}
- <Flexbox horizontal align={'center'} className={styles.scopeChip} gap={4}>
- <Icon icon={FileClock} size={13} />{' '}
- {t('acceptance.roundCount', { count: rounds.length })}
- </Flexbox>
+ {scope?.pullRequest?.number &&
+ (scope.pullRequest.url ? (
+ <a
+ className={cx(styles.scopeChip, styles.scopeLink)}
+ href={scope.pullRequest.url}
+ rel={'noreferrer'}
+ target={'_blank'}
+ >
+ <Flexbox horizontal align={'center'} gap={4}>
+ <Icon icon={GitPullRequest} size={13} /> #{scope.pullRequest.number}
+ </Flexbox>
+ </a>
+ ) : (
+ <Flexbox horizontal align={'center'} className={styles.scopeChip} gap={4}>
+ <Icon icon={GitPullRequest} size={13} /> #{scope.pullRequest.number}
+ </Flexbox>
+ ))}
</Flexbox>
</Flexbox>
@@ -415,12 +554,14 @@ const AcceptancePage = memo(() => {
</Flexbox>
)}
- {/* Check union — the complete inventory, familiar sections (P-14) */}
- <Flexbox horizontal align={'center'} gap={12}>
- <Text strong style={{ fontSize: 14 }}>
+ {/* Check union — the complete inventory, familiar sections (P-14).
+ The row wraps so narrow embeds (the chat portal) drop the filter
+ controls to a second line instead of crushing the text vertical. */}
+ <Flexbox horizontal align={'center'} gap={12} wrap={'wrap'}>
+ <Text strong style={{ fontSize: 14, whiteSpace: 'nowrap' }}>
{t('acceptance.checks.title')}
</Text>
- <Text fontSize={12} type={'secondary'}>
+ <Text fontSize={12} style={{ whiteSpace: 'nowrap' }} type={'secondary'}>
{t('acceptance.checks.subtitle', { count: counts.total, rounds: rounds.length })}
</Text>
<Flexbox flex={1} />
@@ -508,22 +649,34 @@ const AcceptancePage = memo(() => {
</Flexbox>
</DraggablePanel>
- {/* Per-round report drill-down */}
+ {/* Per-round report drill-down — the full verify run view, not a
+ markdown excerpt: same content as /verify/:runId, opened in place.
+ No drawer header: the report's own hero (title + verdict pill) is the
+ header; a floating close sits over it. */}
<Drawer
+ destroyOnHidden
+ noHeader
+ containerMaxWidth={'100%'}
open={reportRound !== null}
placement={'right'}
- width={640}
- title={
- reportRound
- ? t('acceptance.reportDrawer.title', { round: reportRound.run.roundIndex })
- : ''
- }
+ width={'min(960px, 92vw)'}
+ styles={{
+ body: { height: '100%', padding: 0 },
+ bodyContent: { height: '100%', minHeight: 0, overflow: 'hidden' },
+ }}
onClose={() => setReportRound(null)}
>
- {reportRound?.report?.content ? (
- <Markdown>{reportRound.report.content}</Markdown>
- ) : (
- <Text type={'secondary'}>{reportRound?.report?.summary}</Text>
+ {reportRound && (
+ <Flexbox style={{ height: '100%', position: 'relative' }}>
+ <ActionIcon
+ className={styles.drawerClose}
+ icon={X}
+ size={'small'}
+ title={t('acceptance.reportDrawer.close')}
+ onClick={() => setReportRound(null)}
+ />
+ <ReportViewer runId={reportRound.run.id} />
+ </Flexbox>
)}
</Drawer>
</Flexbox>
diff --git a/src/features/Verify/ReportViewer.tsx b/src/features/Verify/ReportViewer.tsx
index 67b028157ca..f5979583eb1 100644
--- a/src/features/Verify/ReportViewer.tsx
+++ b/src/features/Verify/ReportViewer.tsx
@@ -61,6 +61,12 @@ import { useTextFileLoader } from '@/features/FileViewer/hooks/useTextFileLoader
import type { VerifyEvidenceWithUrl } from '@/services/verify';
import { getLanguageFromFilename } from '@/utils/fileLanguage';
+import {
+ EvidenceComparisonCard,
+ type EvidenceComparisonMeta,
+ isFilenameLike,
+ readEvidenceComparison,
+} from './components/EvidenceComparisonCard';
import { useVerifyReportBundle } from './hooks';
import { buildCheckRows, type CheckRowData, type CheckState, renderableSurfaces } from './utils';
@@ -414,6 +420,14 @@ const styles = createStaticStyles(({ css }) => ({
}
`,
prChip: css`
+ /* Resting: number secondary, title tertiary, icon quaternary — a quiet chip.
+ Hover lifts the WHOLE thing to the primary text color at once (a clearly
+ perceptible emphasis, not a one-gray-step nudge), and never the global
+ link-blue. Vars so number/title/icon rise together. */
+ --pr-number-color: ${cssVar.colorTextSecondary};
+ --pr-title-color: ${cssVar.colorTextTertiary};
+ --pr-icon-color: ${cssVar.colorTextQuaternary};
+
cursor: default;
display: inline-flex;
@@ -426,25 +440,35 @@ const styles = createStaticStyles(({ css }) => ({
max-width: 100%;
font-size: 12px;
- color: ${cssVar.colorTextSecondary};
+ color: var(--pr-number-color);
text-decoration: none;
+ transition: color 0.15s;
+
&[data-link='true'] {
cursor: pointer;
}
&[data-link='true']:hover {
- color: ${cssVar.colorLink};
+ --pr-number-color: ${cssVar.colorText};
+ --pr-title-color: ${cssVar.colorText};
+ --pr-icon-color: ${cssVar.colorTextSecondary};
+
+ /* Re-assert over the global \`a:hover\` link-blue — the chip's hover is a
+ text-emphasis step, never a recolor. */
+ color: var(--pr-number-color);
}
> svg:first-child {
flex: 0 0 auto;
- color: ${cssVar.colorTextQuaternary};
+ color: var(--pr-icon-color);
+ transition: color 0.15s;
}
`,
prNumber: css`
flex: 0 0 auto;
- color: ${cssVar.colorTextSecondary};
+ color: var(--pr-number-color);
+ transition: color 0.15s;
`,
prTitle: css`
overflow: hidden;
@@ -452,9 +476,11 @@ const styles = createStaticStyles(({ css }) => ({
min-width: 0;
- color: ${cssVar.colorTextTertiary};
+ color: var(--pr-title-color);
text-overflow: ellipsis;
white-space: nowrap;
+
+ transition: color 0.15s;
`,
scopeMetaItem: css`
display: inline-flex;
@@ -756,63 +782,6 @@ const styles = createStaticStyles(({ css }) => ({
width: 100%;
`,
- comparison: css`
- display: grid;
- grid-template-columns: repeat(2, minmax(0, 1fr));
- gap: 8px;
- width: 100%;
-
- @media (width <= 640px) {
- grid-template-columns: 1fr;
- }
- `,
- /* Wide, short captures (a toolbar, a one-line footer) get halved into
- illegible slivers by the two-column grid — stack them instead. */
- comparisonVertical: css`
- grid-template-columns: 1fr;
- `,
- comparisonItem: css`
- overflow: hidden;
-
- min-width: 0;
- border: 1px solid ${cssVar.colorBorderSecondary};
- border-radius: ${cssVar.borderRadius};
-
- background: ${cssVar.colorBgContainer};
- `,
- /* The role rides on a tinted band fused to its own screenshot, so which state
- you're looking at survives being read at a glance — a neutral heading above
- the image reads as a caption for the whole pair. */
- comparisonLabel: css`
- display: flex;
- gap: 8px;
- align-items: baseline;
-
- padding-block: 7px;
- padding-inline: 10px;
-
- font-size: 12px;
- `,
- comparisonLabelBefore: css`
- border-block-end: 1px solid ${cssVar.colorErrorBorder};
- color: ${cssVar.colorErrorText};
- background: ${cssVar.colorErrorBg};
- `,
- comparisonLabelAfter: css`
- border-block-end: 1px solid ${cssVar.colorSuccessBorder};
- color: ${cssVar.colorSuccessText};
- background: ${cssVar.colorSuccessBg};
- `,
- comparisonRole: css`
- flex: none;
- font-weight: 600;
- `,
- /* The two captions are themselves a before/after contrast, so they must stay
- readable side by side — wrap rather than ellipsize. */
- comparisonCaption: css`
- min-width: 0;
- opacity: 0.85;
- `,
evidenceFile: css`
cursor: pointer;
@@ -1134,40 +1103,12 @@ const evidenceDisplayName = (
evidence.description ||
t('report.evidence.inlineFallback', { index });
-interface EvidenceComparison {
- id: string;
- label?: string;
- /**
- * How the pair is arranged. Side by side reads best for tall, narrow captures
- * (a sidebar, a form); stacking is the only way a wide, short strip (a toolbar,
- * a one-line footer) stays legible, since two of them side by side halve an
- * already-thin band. Authors pick per pair; defaults to side by side.
- */
- layout: 'horizontal' | 'vertical';
- role: 'after' | 'before';
-}
+type EvidenceComparison = EvidenceComparisonMeta;
const evidenceComparison = (evidence: VerifyEvidenceWithUrl): EvidenceComparison | null => {
- const metadata = toRecord(evidence.metadata);
- if (!metadata) return null;
-
- const comparison = toRecord(metadata.comparison);
- if (!comparison) return null;
-
- const role = comparison.role;
- if (
- typeof comparison.id !== 'string' ||
- (role !== 'before' && role !== 'after') ||
- !isInlineVisualEvidence(evidence)
- )
- return null;
-
- return {
- id: comparison.id,
- label: typeof comparison.label === 'string' ? comparison.label : undefined,
- layout: comparison.layout === 'vertical' ? 'vertical' : 'horizontal',
- role,
- };
+ // Only inline media pairs — a text artifact can't sit in a visual diptych.
+ if (!isInlineVisualEvidence(evidence)) return null;
+ return readEvidenceComparison(evidence.metadata);
};
/** A file-backed text evidence, decoded + syntax highlighted (avoids mojibake). */
@@ -1310,52 +1251,57 @@ const InteractionCostPanel = memo<{ cost: VerifyInteractionCost }>(({ cost }) =>
InteractionCostPanel.displayName = 'InteractionCostPanel';
/** One evidence artifact rendered by its type: zoomable image/gif, video, doc, text. */
-const EvidenceItem = memo<{ evidence: VerifyEvidenceWithUrl; index: number }>(
- ({ evidence: e, index }) => {
- const { t } = useTranslation('verify');
- const label = evidenceDisplayName(e, t, index);
- const description = e.description && e.description !== label ? e.description : null;
- // Inline media (image/gif/video) speaks for itself — the raw filename header
- // is visual noise, so only keep a meaningful caption (description) for it.
- const isMedia = isInlineVisualEvidence(e);
+const EvidenceItem = memo<{
+ evidence: VerifyEvidenceWithUrl;
+ /** Inside a comparison card: the card frames the media, so no own border/radius/captions. */
+ flat?: boolean;
+ index: number;
+}>(({ evidence: e, flat, index }) => {
+ const { t } = useTranslation('verify');
+ const label = evidenceDisplayName(e, t, index);
+ const description = e.description && e.description !== label ? e.description : null;
+ // Inline media (image/gif/video) speaks for itself — the raw filename header
+ // is visual noise, so only keep a meaningful caption (description) for it.
+ const isMedia = isInlineVisualEvidence(e);
- return (
- <Flexbox gap={6}>
- {!isMedia && (
- <Text strong fontSize={13}>
- {label}
- </Text>
- )}
- {description && (
- <Text fontSize={13} type={'secondary'}>
- {description}
- </Text>
- )}
- {e.fileUrl && imageEvidenceTypes.has(e.type) ? (
- <Flexbox align={'flex-start'} style={{ maxWidth: '100%' }}>
- <Image
- preview
- alt={e.description ?? label}
- src={e.fileUrl}
- style={{ maxWidth: '100%' }}
- variant={'outlined'}
- />
- </Flexbox>
- ) : e.fileUrl && e.type === 'video' ? (
- <video controls className={styles.evidenceVideo} src={e.fileUrl} />
- ) : e.fileUrl ? (
- <div className={styles.evidenceDoc}>
- <DocumentViewer fileName={e.fileName} url={e.fileUrl} />
- </div>
- ) : e.content ? (
- <div className={styles.evidenceText}>{e.content}</div>
- ) : (
- <span className={styles.softTag}>{e.type}</span>
- )}
- </Flexbox>
- );
- },
-);
+ return (
+ <Flexbox gap={6}>
+ {!isMedia && (
+ <Text strong fontSize={13}>
+ {label}
+ </Text>
+ )}
+ {description && !flat && (
+ <Text fontSize={13} type={'secondary'}>
+ {description}
+ </Text>
+ )}
+ {e.fileUrl && imageEvidenceTypes.has(e.type) ? (
+ <Flexbox align={flat ? undefined : 'flex-start'} style={{ maxWidth: '100%' }}>
+ <Image
+ preview
+ alt={e.description ?? label}
+ src={e.fileUrl}
+ variant={flat ? 'borderless' : 'outlined'}
+ style={
+ flat ? { borderRadius: 0, maxWidth: '100%', width: '100%' } : { maxWidth: '100%' }
+ }
+ />
+ </Flexbox>
+ ) : e.fileUrl && e.type === 'video' ? (
+ <video controls className={styles.evidenceVideo} src={e.fileUrl} />
+ ) : e.fileUrl ? (
+ <div className={styles.evidenceDoc}>
+ <DocumentViewer fileName={e.fileName} url={e.fileUrl} />
+ </div>
+ ) : e.content ? (
+ <div className={styles.evidenceText}>{e.content}</div>
+ ) : (
+ <span className={styles.softTag}>{e.type}</span>
+ )}
+ </Flexbox>
+ );
+});
const EvidenceFileButton = memo<{
evidence: VerifyEvidenceWithUrl;
@@ -1434,38 +1380,21 @@ const EvidenceComparisonView = memo<{
after: VerifyEvidenceWithUrl;
before: VerifyEvidenceWithUrl;
}>(({ after, before }) => {
- const { t } = useTranslation('verify');
-
// Either half may carry the layout; the `before` one wins so a pair can't
// render as two different arrangements.
const layout = evidenceComparison(before)?.layout ?? evidenceComparison(after)?.layout;
- return (
- <div className={cx(styles.comparison, layout === 'vertical' && styles.comparisonVertical)}>
- {[before, after].map((evidence, index) => {
- const comparison = evidenceComparison(evidence)!;
- const isBefore = comparison.role === 'before';
- return (
- <div className={styles.comparisonItem} key={evidence.id}>
- <div
- className={cx(
- styles.comparisonLabel,
- isBefore ? styles.comparisonLabelBefore : styles.comparisonLabelAfter,
- )}
- >
- <span className={styles.comparisonRole}>
- {t(`report.evidence.comparison.${comparison.role}`)}
- </span>
- {comparison.label && (
- <span className={styles.comparisonCaption}>{comparison.label}</span>
- )}
- </div>
- <EvidenceItem evidence={evidence} index={index + 1} />
- </div>
- );
- })}
- </div>
- );
+ // The band caption: an authored label wins; the evidence's own description is
+ // the natural fallback so a pair never renders as two bare role words — but a
+ // default filename description is noise, not a caption.
+ const side = (evidence: VerifyEvidenceWithUrl, index: number) => ({
+ caption:
+ evidenceComparison(evidence)?.label ??
+ (isFilenameLike(evidence.description) ? undefined : (evidence.description ?? undefined)),
+ content: <EvidenceItem flat evidence={evidence} index={index} />,
+ });
+
+ return <EvidenceComparisonCard after={side(after, 2)} before={side(before, 1)} layout={layout} />;
});
EvidenceComparisonView.displayName = 'EvidenceComparisonView';
diff --git a/src/features/Verify/components/EvidenceComparisonCard.tsx b/src/features/Verify/components/EvidenceComparisonCard.tsx
new file mode 100644
index 00000000000..e774d98614d
--- /dev/null
+++ b/src/features/Verify/components/EvidenceComparisonCard.tsx
@@ -0,0 +1,172 @@
+'use client';
+
+import { createStaticStyles, cssVar, cx } from 'antd-style';
+import type { ReactNode } from 'react';
+import { memo } from 'react';
+import { useTranslation } from 'react-i18next';
+
+/** The `metadata.comparison` an evidence artifact may carry (authored at ingest). */
+export interface EvidenceComparisonMeta {
+ id: string;
+ /** Optional per-side caption shown next to the role. */
+ label?: string;
+ /**
+ * How the pair is arranged. Side by side reads best for tall, narrow captures
+ * (a sidebar, a form); stacking is the only way a wide, short strip (a toolbar,
+ * a one-line footer) stays legible, since two of them side by side halve an
+ * already-thin band. Authors pick per pair; defaults to side by side.
+ */
+ layout: 'horizontal' | 'vertical';
+ role: 'after' | 'before';
+}
+
+const toRecord = (value: unknown): Record<string, unknown> | null =>
+ value && typeof value === 'object' && !Array.isArray(value)
+ ? (value as Record<string, unknown>)
+ : null;
+
+/** A bare filename is not a caption — only descriptive prose reads on the band. */
+export const isFilenameLike = (value?: string | null) =>
+ !value || /^[\w.-]+\.(?:gif|jpe?g|mp4|png|webm|webp)$/i.test(value);
+
+/** Parse an evidence row's `metadata.comparison`, or null when it carries none. */
+export const readEvidenceComparison = (metadata: unknown): EvidenceComparisonMeta | null => {
+ const record = toRecord(metadata);
+ const comparison = toRecord(record?.comparison);
+ if (!comparison) return null;
+
+ const role = comparison.role;
+ if (typeof comparison.id !== 'string' || (role !== 'before' && role !== 'after')) return null;
+
+ return {
+ id: comparison.id,
+ label: typeof comparison.label === 'string' ? comparison.label : undefined,
+ layout: comparison.layout === 'vertical' ? 'vertical' : 'horizontal',
+ role,
+ };
+};
+
+const styles = createStaticStyles(({ css }) => ({
+ /* One fused card: the pair is a single object, so no outer gap between the
+ halves — the 1px background seam is the divider in either direction, which
+ keeps the split correct when the grid collapses to one column. */
+ card: css`
+ overflow: hidden;
+ display: grid;
+ grid-template-columns: repeat(2, minmax(0, 1fr));
+ gap: 1px;
+
+ width: 100%;
+ border: 1px solid ${cssVar.colorBorderSecondary};
+ border-radius: ${cssVar.borderRadius};
+
+ background: ${cssVar.colorBorderSecondary};
+
+ @media (width <= 640px) {
+ grid-template-columns: 1fr;
+ }
+ `,
+ cardVertical: css`
+ grid-template-columns: 1fr;
+ `,
+ side: css`
+ display: flex;
+ flex-direction: column;
+ min-width: 0;
+ background: ${cssVar.colorBgContainer};
+ `,
+ /* The role rides on a tinted band fused to its own capture, so which state
+ you're looking at survives being read at a glance. */
+ label: css`
+ display: flex;
+ gap: 8px;
+ align-items: baseline;
+
+ padding-block: 7px;
+ padding-inline: 10px;
+
+ font-size: 12px;
+ `,
+ labelBefore: css`
+ border-block-end: 1px solid ${cssVar.colorErrorBorder};
+ color: ${cssVar.colorErrorText};
+ background: ${cssVar.colorErrorBg};
+ `,
+ labelAfter: css`
+ border-block-end: 1px solid ${cssVar.colorSuccessBorder};
+ color: ${cssVar.colorSuccessText};
+ background: ${cssVar.colorSuccessBg};
+ `,
+ role: css`
+ flex: none;
+ font-weight: 600;
+ `,
+ /* The two captions are themselves a before/after contrast, so they must stay
+ readable side by side — wrap rather than ellipsize. */
+ caption: css`
+ min-width: 0;
+ opacity: 0.85;
+ `,
+ /* The card frames the capture; an inner border/radius would double the frame,
+ so whatever media the caller renders inside is flattened to the card edge. */
+ content: css`
+ flex: 1;
+ min-width: 0;
+
+ img,
+ video {
+ display: block;
+ width: 100%;
+ border: none !important;
+ border-radius: 0 !important;
+ }
+ `,
+}));
+
+export interface EvidenceComparisonSide {
+ /** Caption next to the role band — the comparison label, or the evidence description. */
+ caption?: string;
+ content: ReactNode;
+}
+
+interface EvidenceComparisonCardProps {
+ after: EvidenceComparisonSide;
+ before: EvidenceComparisonSide;
+ layout?: 'horizontal' | 'vertical';
+}
+
+/**
+ * The fused before/after card shared by the verify report and the acceptance
+ * union — one implementation so the two surfaces can't drift apart.
+ */
+export const EvidenceComparisonCard = memo<EvidenceComparisonCardProps>(
+ ({ after, before, layout = 'horizontal' }) => {
+ const { t } = useTranslation('verify');
+
+ return (
+ <div className={cx(styles.card, layout === 'vertical' && styles.cardVertical)}>
+ {(
+ [
+ ['before', before],
+ ['after', after],
+ ] as const
+ ).map(([role, side]) => (
+ <div className={styles.side} key={role}>
+ <div
+ className={cx(
+ styles.label,
+ role === 'before' ? styles.labelBefore : styles.labelAfter,
+ )}
+ >
+ <span className={styles.role}>{t(`report.evidence.comparison.${role}`)}</span>
+ {side.caption && <span className={styles.caption}>{side.caption}</span>}
+ </div>
+ <div className={styles.content}>{side.content}</div>
+ </div>
+ ))}
+ </div>
+ );
+ },
+);
+
+EvidenceComparisonCard.displayName = 'EvidenceComparisonCard';
diff --git a/src/features/Verify/hooks.ts b/src/features/Verify/hooks.ts
index 532d1e8daeb..13dfe2c0656 100644
--- a/src/features/Verify/hooks.ts
+++ b/src/features/Verify/hooks.ts
@@ -43,6 +43,14 @@ export const useAcceptanceBundle = (acceptanceId: string | null) =>
VERIFY_REPORT_SWR_CONFIG,
);
+/** The caller's recent acceptance aggregates (with subject headers) — the list panel. */
+export const useAcceptanceList = (enabled: boolean) =>
+ useClientDataSWR(
+ enabled ? verifyKeys.acceptances() : null,
+ () => verifyService.listAcceptances(),
+ VERIFY_REPORT_SWR_CONFIG,
+ );
+
/**
* Cursor-paginated, infinite-scrolling report summaries. `q` drives a
* server-side title search (spanning the whole history, not just loaded pages);
diff --git a/src/features/Verify/index.ts b/src/features/Verify/index.ts
index d81fab65201..51d9e118c4e 100644
--- a/src/features/Verify/index.ts
+++ b/src/features/Verify/index.ts
@@ -1,4 +1,6 @@
export { default as AcceptanceViewer } from './Acceptance';
+export { default as AcceptanceWorkspace } from './Acceptance/Workspace';
+export { default as AcceptanceEmptyDetail } from './Acceptance/Workspace/EmptyDetail';
export { default as CheckerDock } from './CheckerDock';
export {
useAcceptanceBundle,
diff --git a/src/libs/next/proxy/define-config.ts b/src/libs/next/proxy/define-config.ts
index 736f0fbf443..2df1f6732bd 100644
--- a/src/libs/next/proxy/define-config.ts
+++ b/src/libs/next/proxy/define-config.ts
@@ -91,7 +91,7 @@ export function defineConfig() {
// These pages are responsive on their own; always serve the desktop bundle
// so mobile UA does not land on mobile-specific routes.
- const desktopOnlyPaths = ['/share', '/verify'];
+ const desktopOnlyPaths = ['/share', '/verify', '/acceptance'];
const isDesktopOnlyPath = desktopOnlyPaths.some(
(path) => url.pathname === path || url.pathname.startsWith(`${path}/`),
);
@@ -223,6 +223,9 @@ export function defineConfig() {
// standalone verification report viewer — the run id in the URL is the
// read-only capability for viewing the report without a signed-in session.
'/verify/(.*)',
+ // acceptance decision page — same shape as /verify/:id: the id in the URL
+ // is the read-only capability, no signed-in session required.
+ '/acceptance/(.*)',
// messenger verify-im — page itself handles unauth (in-page sign-in CTA)
// and the random_id token is the actual capability check; no need for
// session-protected access at the middleware layer.
diff --git a/src/libs/swr/keys.ts b/src/libs/swr/keys.ts
index 008c5976d7e..30232c007cb 100644
--- a/src/libs/swr/keys.ts
+++ b/src/libs/swr/keys.ts
@@ -733,6 +733,7 @@ export const verifyKeys = {
'verify:acceptanceBundle',
acceptanceId,
]),
+ acceptances: def('verify:acceptances', () => ['verify:acceptances']),
criteria: def('verify:criteria', () => ['verify:criteria']),
instruction: def('verify:instruction', (documentId: string) => [
'verify:instruction',
diff --git a/src/routes/(main)/acceptance/empty.tsx b/src/routes/(main)/acceptance/empty.tsx
new file mode 100644
index 00000000000..267e0dc69fa
--- /dev/null
+++ b/src/routes/(main)/acceptance/empty.tsx
@@ -0,0 +1,3 @@
+'use client';
+
+export { AcceptanceEmptyDetail as default } from '@/features/Verify';
diff --git a/src/routes/(main)/acceptance/index.tsx b/src/routes/(main)/acceptance/index.tsx
new file mode 100644
index 00000000000..7e55fd7c5ce
--- /dev/null
+++ b/src/routes/(main)/acceptance/index.tsx
@@ -0,0 +1,3 @@
+'use client';
+
+export { AcceptanceWorkspace as default } from '@/features/Verify';
diff --git a/src/services/verify.ts b/src/services/verify.ts
index 1acf991891b..87274e566ce 100644
--- a/src/services/verify.ts
+++ b/src/services/verify.ts
@@ -18,6 +18,9 @@ import type {
import { lambdaClient } from '@/libs/trpc/client';
export type AcceptanceBundle = Awaited<ReturnType<typeof lambdaClient.acceptance.getBundle.query>>;
+export type AcceptanceListItem = Awaited<
+ ReturnType<typeof lambdaClient.acceptance.list.query>
+>[number];
/** Editable fields of a single delivery-check criterion. */
export interface UpdateCriterionValue {
@@ -136,6 +139,8 @@ export class VerifyService {
getAcceptanceBundle = (id: string): Promise<AcceptanceBundle> =>
lambdaClient.acceptance.getBundle.query({ id });
+ listAcceptances = (): Promise<AcceptanceListItem[]> => lambdaClient.acceptance.list.query();
+
acceptDelivery = (id: string, comment?: string) =>
lambdaClient.acceptance.accept.mutate({ comment, id });
diff --git a/src/spa/router/desktopRouter.config.desktop.tsx b/src/spa/router/desktopRouter.config.desktop.tsx
index ee1771af746..2d1359877b2 100644
--- a/src/spa/router/desktopRouter.config.desktop.tsx
+++ b/src/spa/router/desktopRouter.config.desktop.tsx
@@ -55,6 +55,8 @@ import WorkspaceSlugSettingsSkillPage from '@/routes/(main)/[workspaceSlug]/sett
import WorkspaceSlugSettingsStatsPage from '@/routes/(main)/[workspaceSlug]/settings/stats';
import WorkspaceSlugSettingsStoragePage from '@/routes/(main)/[workspaceSlug]/settings/storage';
import WorkspaceSlugSettingsUsagePage from '@/routes/(main)/[workspaceSlug]/settings/usage';
+import AcceptanceWorkspace from '@/routes/(main)/acceptance';
+import AcceptanceEmptyPage from '@/routes/(main)/acceptance/empty';
// Pages — sync import
import AgentPage from '@/routes/(main)/agent';
import DesktopChatLayout from '@/routes/(main)/agent/_layout';
@@ -814,12 +816,21 @@ export const desktopRoutes: RouteObject[] = [
path: '/verify',
},
- // Subject-level delivery acceptance — separate from single-run verify reports.
+ // Subject-level delivery acceptance — the verify workspace's twin: a
+ // master-detail with the acceptance list on the left.
{
- element: <AcceptanceReportPage />,
+ children: [
+ { element: <AcceptanceEmptyPage />, index: true },
+ {
+ element: <AcceptanceReportPage />,
+ handle: { meta: acceptanceRouteMeta },
+ path: ':acceptanceId',
+ },
+ ],
+ element: <AcceptanceWorkspace />,
errorElement: <ErrorBoundary />,
handle: { meta: acceptanceRouteMeta },
- path: '/acceptance/:acceptanceId',
+ path: '/acceptance',
},
// Devtools route (outside main layout, dev-only)
diff --git a/src/spa/router/desktopRouter.config.tsx b/src/spa/router/desktopRouter.config.tsx
index 51b38456a04..65086f29ab4 100644
--- a/src/spa/router/desktopRouter.config.tsx
+++ b/src/spa/router/desktopRouter.config.tsx
@@ -1054,15 +1054,30 @@ export const desktopRoutes: RouteObject[] = [
path: '/verify',
},
- // Subject-level delivery acceptance — separate from single-run verify reports.
+ // Subject-level delivery acceptance — the verify workspace's twin: a
+ // master-detail with the acceptance list on the left.
{
- element: dynamicElement(
- () => import('@/routes/acceptance/[acceptanceId]'),
- 'Desktop > AcceptanceReport',
- ),
+ children: [
+ {
+ element: dynamicElement(
+ () => import('@/routes/(main)/acceptance/empty'),
+ 'Desktop > Acceptance Empty',
+ ),
+ index: true,
+ },
+ {
+ element: dynamicElement(
+ () => import('@/routes/acceptance/[acceptanceId]'),
+ 'Desktop > AcceptanceReport',
+ ),
+ handle: { meta: acceptanceRouteMeta },
+ path: ':acceptanceId',
+ },
+ ],
+ element: dynamicElement(() => import('@/routes/(main)/acceptance'), 'Desktop > Acceptance'),
errorElement: <ErrorBoundary />,
handle: { meta: acceptanceRouteMeta },
- path: '/acceptance/:acceptanceId',
+ path: '/acceptance',
},
// Devtools route (outside main layout, dev-only)
diff --git a/src/store/chat/slices/portal/action.ts b/src/store/chat/slices/portal/action.ts
index f2bd5d0d715..22ad81f7783 100644
--- a/src/store/chat/slices/portal/action.ts
+++ b/src/store/chat/slices/portal/action.ts
@@ -578,6 +578,10 @@ export class ChatPortalActionImpl {
return buffer;
};
+ openAcceptance = (acceptanceId: string): void => {
+ this.#get().pushPortalView({ acceptanceId, type: PortalViewType.Acceptance });
+ };
+
openMessageDetail = (messageId: string): void => {
this.#get().pushPortalView({ messageId, type: PortalViewType.MessageDetail });
};
diff --git a/src/store/chat/slices/portal/initialState.ts b/src/store/chat/slices/portal/initialState.ts
index 541d95f5a18..0a3c31c48d6 100644
--- a/src/store/chat/slices/portal/initialState.ts
+++ b/src/store/chat/slices/portal/initialState.ts
@@ -8,6 +8,7 @@ export enum ArtifactDisplayMode {
// ============== Portal View Stack Types ==============
export enum PortalViewType {
+ Acceptance = 'acceptance',
AgentDetail = 'agentDetail',
Artifact = 'artifact',
Document = 'document',
@@ -43,6 +44,7 @@ export interface OpenLocalFileEntry extends OpenLocalFileParams {
export type PortalViewData =
| { type: PortalViewType.Home }
+ | { acceptanceId: string; type: PortalViewType.Acceptance }
| { agentId: string; type: PortalViewType.AgentDetail }
| { artifact: PortalArtifact; type: PortalViewType.Artifact }
| { agentDocumentId?: string; documentId: string; type: PortalViewType.Document }
diff --git a/src/store/chat/slices/portal/selectors.ts b/src/store/chat/slices/portal/selectors.ts
index 732df310a5a..6e2b9acb988 100644
--- a/src/store/chat/slices/portal/selectors.ts
+++ b/src/store/chat/slices/portal/selectors.ts
@@ -239,6 +239,8 @@ const currentVerifyResult = (s: ChatStoreState) => getViewData(s, PortalViewType
const verifyResultOperationId = (s: ChatStoreState) => currentVerifyResult(s)?.operationId;
const verifyResultCheckItemId = (s: ChatStoreState) => currentVerifyResult(s)?.checkItemId;
const verifyReportRunId = (s: ChatStoreState) => getViewData(s, PortalViewType.VerifyReport)?.runId;
+const acceptancePortalId = (s: ChatStoreState) =>
+ getViewData(s, PortalViewType.Acceptance)?.acceptanceId;
const isPluginUIOpen = (id: string) => (s: ChatStoreState) =>
toolMessageId(s) === id && showPortal(s);
@@ -312,6 +314,9 @@ export const chatPortalSelectors = {
verifyResultOperationId,
verifyResultCheckItemId,
verifyReportRunId,
+
+ // Acceptance data
+ acceptancePortalId,
};
export * from './selectors/thread';