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(acceptance): group-scoped feedback, zoomable annotation stage & review-feedback fixes (#17291)

Arvin Xu6cb0973cc0b2
diff --git a/.agents/skills/agent-testing/SKILL.md b/.agents/skills/agent-testing/SKILL.md
index 95db73a5e86..54bd3cbf931 100644
--- a/.agents/skills/agent-testing/SKILL.md
+++ b/.agents/skills/agent-testing/SKILL.md
@@ -691,6 +691,14 @@ env -u LOBEHUB_SERVER -u LOBE_API_KEY -u LOBEHUB_CLI_API_KEY -u LOBEHUB_CLI_HOME
`"subject": "task:<id>"` / `{ "type", "id", "requirement" }` in `result.json`).
Outside a LobeHub topic, one of those explicit forms is required; publishing
without a resolvable subject fails instead of creating an orphan verify report.
+
+**Always supply the acceptance `requirement` (验收目标) with the subject** —
+the object form `{ "type", "id", "requirement": "<one-sentence goal>" }` or
+`--requirement`. It is NOT auto-generated: an aggregate created without one
+renders "尚未记录该对象的验收目标" at the top of the decision page. Write it as
+the one-sentence business goal the whole acceptance is judged against (not this
+round's scope). A recorded requirement is immutable; an empty one is backfilled
+by the first later round that supplies it.
The first ingest creates the acceptance and every ingest creates its next
immutable round. The user closes the loop on `/acceptance/<acceptanceId>` (also
printed by `--open`) — accept / reject with a comment; inspect or decide from the
diff --git a/.agents/skills/agent-testing/references/common-mistakes.md b/.agents/skills/agent-testing/references/common-mistakes.md
index f1e39fdb7ba..d2289c12b85 100644
--- a/.agents/skills/agent-testing/references/common-mistakes.md
+++ b/.agents/skills/agent-testing/references/common-mistakes.md
@@ -753,3 +753,24 @@ deliverable.
(`env -u LOBEHUB_SERVER -u LOBE_API_KEY -u LOBEHUB_CLI_API_KEY -u LOBEHUB_CLI_HOME` + the branch's
own CLI for the canary `--subject` contract). Gotcha hit on the way: bare `--json` on `task create`
crashes (`fields.split is not a function`) — omit it or pass explicit fields.
+
+---
+
+## Case 29 — Publishing an acceptance without its `requirement` (验收目标), assuming it is auto-generated
+
+**Wrong approach**: authoring `result.json` with the bare-string subject form
+(`"subject": "topic:<id>"`) and no `--requirement`, assuming the system derives the acceptance
+goal on its own.
+
+**Why it's wrong**: `acceptances.requirement` is author-supplied only — the CLI passes it to
+`acceptance.ensure` solely from the subject OBJECT form (`{ type, id, requirement }`) or the
+`--requirement` flag. Nothing generates it. Worse, it is set at aggregate creation: a first
+ingest that omits it leaves the decision page reading "尚未记录该对象的验收目标" (a model-side
+backfill for the empty case ships later; a recorded value stays immutable either way).
+
+**What it breaks**: the decision page's headline card — the one thing the whole acceptance is
+judged against — renders a placeholder, and the user has to ask why.
+
+**Correct approach**: every FIRST ingest for a subject uses the object subject form with a
+one-sentence business goal: `"subject": { "type": "topic", "id": "<id>", "requirement": "<该主体
+整体要达成什么>" }`. Phrase it as the cross-round goal, not the current round's scope.
diff --git a/apps/server/src/routers/lambda/acceptance.ts b/apps/server/src/routers/lambda/acceptance.ts
index 26967713f6b..095fc284cca 100644
--- a/apps/server/src/routers/lambda/acceptance.ts
+++ b/apps/server/src/routers/lambda/acceptance.ts
@@ -281,6 +281,51 @@ export const acceptanceRouter = router({
/** Recent acceptances (with subject headers), newest first — list panel + CLI. */
list: acceptanceProcedure.query(async ({ ctx }) => ctx.acceptanceService.listWithSubjects()),
+ /**
+ * Feedback addressed to a check GROUP (business category) rather than any
+ * single check — for concerns that don't invalidate an individual check
+ * (which may well be accepted) but still need to reach the next round.
+ * Append-only, stamped with the current round for the same staleness rule
+ * as check-level rejects.
+ */
+ addGroupFeedback: acceptanceWriteProcedure
+ .input(
+ z.object({
+ category: z.string().max(200),
+ comment: z.string().trim().min(1).max(2000),
+ id: z.string(),
+ }),
+ )
+ .mutation(async ({ ctx, input }) => {
+ const acceptance = await resolveAcceptance(ctx, input.id);
+ assertWorkspaceRowManageable(ctx, acceptance.userId, 'acceptance');
+
+ // The feedback is addressed to the CURRENT round and lives on its run's
+ // decision detail — the same home as the round's terminal accept/reject
+ // note, so staleness falls out of the round chain and a deleted round
+ // takes its feedback along.
+ const { runs } = await ctx.acceptanceService.loadRounds(acceptance.id);
+ const currentRun = runs.at(-1);
+ if (!currentRun) {
+ throw new TRPCError({
+ code: 'BAD_REQUEST',
+ message: 'No verification round to address feedback to',
+ });
+ }
+
+ const entry = {
+ category: input.category,
+ comment: input.comment,
+ createdAt: new Date().toISOString(),
+ };
+ await new VerifyRunModel(
+ ctx.serverDB,
+ acceptance.userId,
+ acceptance.workspaceId ?? undefined,
+ ).appendGroupFeedback(currentRun.id, entry);
+ return { entry: { ...entry, roundIndex: currentRun.roundIndex }, success: true };
+ }),
+
/**
* The user's verdict on individual union checks — `accept` settles a check
* for good ("已验收,不用再管"); `reject` records feedback the next verify
diff --git a/locales/en-US/verify.json b/locales/en-US/verify.json
index 9168b93f7b8..3c0079ff096 100644
--- a/locales/en-US/verify.json
+++ b/locales/en-US/verify.json
@@ -17,6 +17,7 @@
"acceptance.banner.rejected": "Rejected",
"acceptance.banner.rejectedHint": "The next verification round re-opens this acceptance when it lands.",
"acceptance.banner.rejectedReason": "Reason: {{reason}}",
+ "acceptance.bar.feedback": "Feedback {{count}}",
"acceptance.checks.copied": "Copied",
"acceptance.checks.copySeq": "Copy the check label",
"acceptance.checks.finalRoundHint": "The final result and evidence come from this round — click to locate it.",
@@ -37,18 +38,34 @@
"acceptance.evidence.file": "{{count}} text evidence item(s)",
"acceptance.evidence.image": "{{count}} image evidence item(s)",
"acceptance.evidence.video": "{{count}} video evidence item(s)",
+ "acceptance.feedback.annotations": "{{count}} region(s)",
+ "acceptance.feedback.current": "Queued for the next round ({{count}})",
+ "acceptance.feedback.empty": "No feedback recorded this round yet.",
+ "acceptance.feedback.global": "Overall feedback",
+ "acceptance.feedback.group": "Group · {{label}}",
+ "acceptance.feedback.history": "Consumed by earlier rounds ({{count}})",
+ "acceptance.feedback.title": "Feedback",
"acceptance.filter.accepted": "Accepted {{count}}",
"acceptance.filter.all": "All {{count}}",
"acceptance.filter.needsFix": "Needs fix {{count}}",
"acceptance.filter.pending": "To review {{count}}",
"acceptance.filter.roundAll": "All rounds",
+ "acceptance.group.acceptedRatio": "{{accepted}}/{{total}} accepted",
"acceptance.group.allVerified": "{{passed}}/{{total}} all verified & accepted",
"acceptance.group.collapse": "Collapse {{label}}",
"acceptance.group.collapseAll": "Collapse groups",
"acceptance.group.collapseItems": "Collapse checks in this group",
"acceptance.group.expandAll": "Expand groups",
"acceptance.group.expandItems": "Expand checks in this group",
+ "acceptance.group.failedCount": "{{count}} failing",
+ "acceptance.group.feedbackAction": "Add group feedback",
+ "acceptance.group.feedbackDescription": "Feedback on “{{label}}” as a whole — for concerns no single check covers. The next verification round reads it.",
+ "acceptance.group.feedbackLabel": "Group feedback · round {{round}}",
+ "acceptance.group.feedbackPlaceholder": "What should change about this area, and what do you expect…",
+ "acceptance.group.feedbackSubmit": "Submit feedback",
+ "acceptance.group.feedbackTitle": "Group feedback",
"acceptance.group.passRatio": "{{passed}}/{{total}} passed",
+ "acceptance.group.rejectedCount": "{{count}} sent back",
"acceptance.group.uncategorized": "Other requirements",
"acceptance.history.jump": "Round {{round}} — click to locate it in the ledger",
"acceptance.latestSummary": "Latest report summary",
@@ -76,19 +93,25 @@
"acceptance.review.annotationPlaceholder": "What is wrong in region {{index}}…",
"acceptance.review.confirmReject": "Submit feedback",
"acceptance.review.feedbackLabel": "Your feedback · round {{round}}",
+ "acceptance.review.fullscreen": "Annotate fullscreen",
+ "acceptance.review.regionComments": "Region comments",
+ "acceptance.review.regionCommentsEmpty": "Drag on the image to circle a region — its comment lands here.",
"acceptance.review.reject": "Reject with comment",
"acceptance.review.rejectDescription": "Reject \"{{title}}\" — your feedback is what the next verification round acts on.",
"acceptance.review.rejectPlaceholder": "What is wrong, and what do you expect instead…",
"acceptance.review.rejectedHint": "You rejected this check — the next round reads your feedback.",
+ "acceptance.review.removeRegion": "Remove this region",
"acceptance.review.revertToReject": "Change to reject with comment",
"acceptance.review.supplement": "Additional notes (optional)",
+ "acceptance.review.zoomIn": "Zoom in",
+ "acceptance.review.zoomOut": "Zoom out",
"acceptance.round": "Round {{round}}",
"acceptance.roundCount": "{{count}} verification round(s)",
"acceptance.roundStatus.errored": "Errored",
- "acceptance.roundStatus.failed": "Failed",
- "acceptance.roundStatus.passed": "Passed",
+ "acceptance.roundStatus.failed": "Verify failed",
+ "acceptance.roundStatus.passed": "Verify passed",
"acceptance.roundStatus.repairing": "Repairing",
- "acceptance.roundStatus.uncertain": "Uncertain",
+ "acceptance.roundStatus.uncertain": "Verify uncertain",
"acceptance.roundStatus.verifying": "In progress",
"acceptance.stats.failed": "{{count}} failed",
"acceptance.stats.notExecuted": "{{count}} not executed",
diff --git a/locales/zh-CN/verify.json b/locales/zh-CN/verify.json
index 1bff16869fb..8d7012cc0cf 100644
--- a/locales/zh-CN/verify.json
+++ b/locales/zh-CN/verify.json
@@ -17,6 +17,7 @@
"acceptance.banner.rejected": "已打回",
"acceptance.banner.rejectedHint": "下一轮验证完成后将重新回到待验收",
"acceptance.banner.rejectedReason": "打回意见:{{reason}}",
+ "acceptance.bar.feedback": "反馈 {{count}}",
"acceptance.checks.copied": "已复制",
"acceptance.checks.copySeq": "复制检查项序号",
"acceptance.checks.finalRoundHint": "最终结果与证据来自该轮,点击查看",
@@ -37,18 +38,34 @@
"acceptance.evidence.file": "{{count}} 份文本证据",
"acceptance.evidence.image": "{{count}} 份图片证据",
"acceptance.evidence.video": "{{count}} 份视频证据",
+ "acceptance.feedback.annotations": "{{count}} 处圈选",
+ "acceptance.feedback.current": "待下一轮处理({{count}})",
+ "acceptance.feedback.empty": "本轮还没有记录任何反馈。",
+ "acceptance.feedback.global": "整单反馈",
+ "acceptance.feedback.group": "分组 · {{label}}",
+ "acceptance.feedback.history": "已被历史轮次消化({{count}})",
+ "acceptance.feedback.title": "反馈清单",
"acceptance.filter.accepted": "已验收 {{count}}",
"acceptance.filter.all": "全部 {{count}}",
"acceptance.filter.needsFix": "待修复 {{count}}",
"acceptance.filter.pending": "未验收 {{count}}",
"acceptance.filter.roundAll": "全部轮次",
+ "acceptance.group.acceptedRatio": "{{accepted}}/{{total}} 已验收",
"acceptance.group.allVerified": "{{passed}}/{{total}} 已全部验证通过",
"acceptance.group.collapse": "收起{{label}}",
"acceptance.group.collapseAll": "收起分组",
"acceptance.group.collapseItems": "收起本组检查项",
"acceptance.group.expandAll": "展开分组",
"acceptance.group.expandItems": "展开本组检查项",
+ "acceptance.group.failedCount": "{{count}} 未通过",
+ "acceptance.group.feedbackAction": "补充分组反馈",
+ "acceptance.group.feedbackDescription": "针对「{{label}}」整组的补充反馈——用于不属于任何单个检查项的问题,下一轮验证会读取。",
+ "acceptance.group.feedbackLabel": "分组反馈 · 第 {{round}} 轮",
+ "acceptance.group.feedbackPlaceholder": "这一块整体有什么问题、你期望的是什么…",
+ "acceptance.group.feedbackSubmit": "提交反馈",
+ "acceptance.group.feedbackTitle": "分组反馈",
"acceptance.group.passRatio": "{{passed}}/{{total}} 通过",
+ "acceptance.group.rejectedCount": "{{count}} 已打回",
"acceptance.group.uncategorized": "其他需求",
"acceptance.history.jump": "第 {{round}} 轮——点击在轮次审计中定位",
"acceptance.latestSummary": "最新报告摘要",
@@ -76,19 +93,25 @@
"acceptance.review.annotationPlaceholder": "区域 {{index}} 的问题…",
"acceptance.review.confirmReject": "提交反馈",
"acceptance.review.feedbackLabel": "你的反馈 · 第 {{round}} 轮",
+ "acceptance.review.fullscreen": "全屏标注",
+ "acceptance.review.regionComments": "圈选评论",
+ "acceptance.review.regionCommentsEmpty": "在左侧图片上拖拽圈出区域,评论会出现在这里。",
"acceptance.review.reject": "拒绝并评论",
"acceptance.review.rejectDescription": "拒绝「{{title}}」——你的反馈将成为下一轮验证的处理输入。",
"acceptance.review.rejectPlaceholder": "哪里不对、你期望的是什么…",
"acceptance.review.rejectedHint": "你已拒绝该项——下一轮将读取你的反馈。",
+ "acceptance.review.removeRegion": "删除该圈选",
"acceptance.review.revertToReject": "改为拒绝并评论",
"acceptance.review.supplement": "补充说明(可选)",
+ "acceptance.review.zoomIn": "放大",
+ "acceptance.review.zoomOut": "缩小",
"acceptance.round": "第 {{round}} 轮",
"acceptance.roundCount": "{{count}} 轮验证",
"acceptance.roundStatus.errored": "异常",
- "acceptance.roundStatus.failed": "失败",
- "acceptance.roundStatus.passed": "通过",
+ "acceptance.roundStatus.failed": "验证失败",
+ "acceptance.roundStatus.passed": "验证通过",
"acceptance.roundStatus.repairing": "修复中",
- "acceptance.roundStatus.uncertain": "不确定",
+ "acceptance.roundStatus.uncertain": "验证不确定",
"acceptance.roundStatus.verifying": "进行中",
"acceptance.stats.failed": "{{count}} 失败",
"acceptance.stats.notExecuted": "{{count}} 未执行",
diff --git a/packages/database/src/models/__tests__/acceptance.test.ts b/packages/database/src/models/__tests__/acceptance.test.ts
index d2910689245..35aec416c14 100644
--- a/packages/database/src/models/__tests__/acceptance.test.ts
+++ b/packages/database/src/models/__tests__/acceptance.test.ts
@@ -44,6 +44,29 @@ describe('AcceptanceModel', () => {
expect(second.requirement).toBe('All checks green');
});
+ it('ensureForSubject backfills an EMPTY requirement from a later round', async () => {
+ const model = new AcceptanceModel(serverDB, userId);
+
+ // First ingest omitted the requirement — the aggregate starts blank.
+ const first = await model.ensureForSubject('topic', topicId);
+ expect(first.requirement).toBeNull();
+
+ // The first later round that supplies one fills the blank…
+ const second = await model.ensureForSubject('topic', topicId, {
+ requirement: 'Review UX polish ships end to end',
+ });
+ expect(second.id).toBe(first.id);
+ expect(second.requirement).toBe('Review UX polish ships end to end');
+ const persisted = await model.findBySubject('topic', topicId);
+ expect(persisted?.requirement).toBe('Review UX polish ships end to end');
+
+ // …and from then on the recorded statement is immutable again.
+ const third = await model.ensureForSubject('topic', topicId, {
+ requirement: 'Different text',
+ });
+ expect(third.requirement).toBe('Review UX polish ships end to end');
+ });
+
it('defaults visibility by scope: personal public, workspace private', async () => {
const personal = new AcceptanceModel(serverDB, userId);
const personalRow = await personal.ensureForSubject('topic', topicId);
diff --git a/packages/database/src/models/acceptance.ts b/packages/database/src/models/acceptance.ts
index e09d8de8413..26ed7ebcf88 100644
--- a/packages/database/src/models/acceptance.ts
+++ b/packages/database/src/models/acceptance.ts
@@ -81,7 +81,20 @@ export class AcceptanceModel {
defaults?: Partial<Pick<NewAcceptance, 'config' | 'requirement'>>,
): Promise<AcceptanceItem> => {
const existing = await this.findBySubject(subjectType, subjectId);
- if (existing) return existing;
+ if (existing) {
+ // A recorded requirement is never overwritten — but an aggregate created
+ // WITHOUT one (a first ingest that omitted it) accepts the first
+ // non-empty statement a later round supplies, instead of staying blank
+ // forever ("尚未记录该对象的验收目标").
+ if (!existing.requirement && defaults?.requirement) {
+ await this.db
+ .update(acceptances)
+ .set({ requirement: defaults.requirement })
+ .where(eq(acceptances.id, existing.id));
+ return { ...existing, requirement: defaults.requirement };
+ }
+ return existing;
+ }
await this.db
.insert(acceptances)
diff --git a/packages/database/src/models/verifyRun.ts b/packages/database/src/models/verifyRun.ts
index 75caa14e632..839a41d78d7 100644
--- a/packages/database/src/models/verifyRun.ts
+++ b/packages/database/src/models/verifyRun.ts
@@ -2,6 +2,7 @@ import type { VerifyVisibility } from '@lobechat/const/verify';
import type {
VerifyCheckItem,
VerifyRunDecisionDetail,
+ VerifyRunGroupFeedbackEntry,
VerifyRunSource,
VerifyRunStatus,
} from '@lobechat/types';
@@ -284,6 +285,31 @@ export class VerifyRunModel {
* closes or re-opens the acceptance loop). Free-form verb by design — see the
* `user_decision` column comment.
*/
+ /**
+ * Append one group-scoped feedback entry to this round's decision detail.
+ * Read-merge-write on the jsonb bag; the round carries its feedback (and
+ * takes it along when the round is deleted).
+ */
+ appendGroupFeedback = async (
+ runId: string,
+ entry: VerifyRunGroupFeedbackEntry,
+ ): Promise<VerifyRunDecisionDetail> => {
+ const run = await this.db.query.verifyRuns.findFirst({
+ where: and(eq(verifyRuns.id, runId), this.ownership()),
+ });
+ if (!run) throw new Error(`Verify run "${runId}" not found in the current workspace`);
+
+ const decisionDetail: VerifyRunDecisionDetail = {
+ ...run.decisionDetail,
+ groupFeedback: [...(run.decisionDetail?.groupFeedback ?? []), entry],
+ };
+ await this.db
+ .update(verifyRuns)
+ .set({ decisionDetail })
+ .where(and(eq(verifyRuns.id, runId), this.ownership()));
+ return decisionDetail;
+ };
+
setDecision = async (
runId: string,
userDecision: string,
diff --git a/packages/locales/src/default/verify.ts b/packages/locales/src/default/verify.ts
index 7f1ab6588ae..8bffb17bcef 100644
--- a/packages/locales/src/default/verify.ts
+++ b/packages/locales/src/default/verify.ts
@@ -24,6 +24,7 @@ export default {
'acceptance.banner.rejectedHint':
'The next verification round re-opens this acceptance when it lands.',
'acceptance.banner.rejectedReason': 'Reason: {{reason}}',
+ 'acceptance.bar.feedback': 'Feedback {{count}}',
'acceptance.checks.copied': 'Copied',
'acceptance.checks.copySeq': 'Copy the check label',
'acceptance.checks.finalRoundHint':
@@ -48,18 +49,36 @@ export default {
'acceptance.evidence.file': '{{count}} text evidence item(s)',
'acceptance.evidence.image': '{{count}} image evidence item(s)',
'acceptance.evidence.video': '{{count}} video evidence item(s)',
+ 'acceptance.feedback.annotations': '{{count}} region(s)',
+ 'acceptance.feedback.current': 'Queued for the next round ({{count}})',
+ 'acceptance.feedback.empty': 'No feedback recorded this round yet.',
+ 'acceptance.feedback.global': 'Overall feedback',
+ 'acceptance.feedback.group': 'Group · {{label}}',
+ 'acceptance.feedback.history': 'Consumed by earlier rounds ({{count}})',
+ 'acceptance.feedback.title': 'Feedback',
'acceptance.filter.accepted': 'Accepted {{count}}',
'acceptance.filter.all': 'All {{count}}',
'acceptance.filter.needsFix': 'Needs fix {{count}}',
'acceptance.filter.pending': 'To review {{count}}',
'acceptance.filter.roundAll': 'All rounds',
+ 'acceptance.group.acceptedRatio': '{{accepted}}/{{total}} accepted',
'acceptance.group.allVerified': '{{passed}}/{{total}} all verified & accepted',
'acceptance.group.collapse': 'Collapse {{label}}',
'acceptance.group.collapseAll': 'Collapse groups',
'acceptance.group.collapseItems': 'Collapse checks in this group',
'acceptance.group.expandAll': 'Expand groups',
'acceptance.group.expandItems': 'Expand checks in this group',
+ 'acceptance.group.failedCount': '{{count}} failing',
+ 'acceptance.group.feedbackAction': 'Add group feedback',
+ 'acceptance.group.feedbackDescription':
+ 'Feedback on “{{label}}” as a whole — for concerns no single check covers. The next verification round reads it.',
+ 'acceptance.group.feedbackLabel': 'Group feedback · round {{round}}',
+ 'acceptance.group.feedbackPlaceholder':
+ 'What should change about this area, and what do you expect…',
+ 'acceptance.group.feedbackSubmit': 'Submit feedback',
+ 'acceptance.group.feedbackTitle': 'Group feedback',
'acceptance.group.passRatio': '{{passed}}/{{total}} passed',
+ 'acceptance.group.rejectedCount': '{{count}} sent back',
'acceptance.group.uncategorized': 'Other requirements',
'acceptance.history.jump': 'Round {{round}} — click to locate it in the ledger',
'acceptance.latestSummary': 'Latest report summary',
@@ -89,22 +108,29 @@ export default {
'acceptance.review.annotationPlaceholder': 'What is wrong in region {{index}}…',
'acceptance.review.confirmReject': 'Submit feedback',
'acceptance.review.feedbackLabel': 'Your feedback · round {{round}}',
+ 'acceptance.review.fullscreen': 'Annotate fullscreen',
+ 'acceptance.review.regionComments': 'Region comments',
+ 'acceptance.review.regionCommentsEmpty':
+ 'Drag on the image to circle a region — its comment lands here.',
'acceptance.review.reject': 'Reject with comment',
'acceptance.review.rejectDescription':
'Reject "{{title}}" — your feedback is what the next verification round acts on.',
'acceptance.review.rejectPlaceholder': 'What is wrong, and what do you expect instead…',
'acceptance.review.rejectedHint': 'You rejected this check — the next round reads your feedback.',
+ 'acceptance.review.removeRegion': 'Remove this region',
'acceptance.review.revertToReject': 'Change to reject with comment',
'acceptance.review.supplement': 'Additional notes (optional)',
'acceptance.requirementEmpty': 'No acceptance goal recorded for this subject yet.',
'acceptance.requirementLabel': 'Acceptance goal',
+ 'acceptance.review.zoomIn': 'Zoom in',
+ 'acceptance.review.zoomOut': 'Zoom out',
'acceptance.round': 'Round {{round}}',
'acceptance.roundCount': '{{count}} verification round(s)',
'acceptance.roundStatus.errored': 'Errored',
- 'acceptance.roundStatus.failed': 'Failed',
- 'acceptance.roundStatus.passed': 'Passed',
+ 'acceptance.roundStatus.failed': 'Verify failed',
+ 'acceptance.roundStatus.passed': 'Verify passed',
'acceptance.roundStatus.repairing': 'Repairing',
- 'acceptance.roundStatus.uncertain': 'Uncertain',
+ 'acceptance.roundStatus.uncertain': 'Verify uncertain',
'acceptance.roundStatus.verifying': 'In progress',
'acceptance.stats.failed': '{{count}} failed',
'acceptance.stats.notExecuted': '{{count}} not executed',
diff --git a/packages/types/src/verify.ts b/packages/types/src/verify.ts
index 26046557868..d832545bf78 100644
--- a/packages/types/src/verify.ts
+++ b/packages/types/src/verify.ts
@@ -99,6 +99,27 @@ export interface AcceptanceConfig {
verifyRubricId?: string;
}
+/**
+ * User feedback addressed to a check GROUP (business category) rather than any
+ * single check — the "this concern doesn't belong to a check I could reject"
+ * channel. Stored on the round it judges ({@link VerifyRunDecisionDetail});
+ * this is the derived view the acceptance page consumes, with `roundIndex`
+ * read off that run, so the check-reject staleness rule (consumed once a
+ * newer round lands) applies structurally.
+ */
+export interface AcceptanceGroupFeedback {
+ /** The group's category label ('' targets the uncategorized bucket). */
+ category: string;
+ comment: string;
+ /** When the feedback was written (ISO 8601). */
+ createdAt: string;
+ /** The round the feedback was addressed to — its run's own round index. */
+ roundIndex: number;
+}
+
+/** One group-scoped feedback entry as stored on a round's decision detail. */
+export type VerifyRunGroupFeedbackEntry = Omit<AcceptanceGroupFeedback, 'roundIndex'>;
+
/** Generic acceptance extension bag for cross-subject state we have not modeled yet. */
export interface AcceptanceMetadata {
[key: string]: unknown;
@@ -221,6 +242,14 @@ export interface VerifyRunDecisionDetail {
decidedBy?: string;
/** Attachments backing the decision (annotated screenshots, etc.) — FKs to files. */
fileIds?: string[];
+ /**
+ * Group-scoped review feedback addressed to THIS round — concerns that
+ * belong to no single check (whose checks may well be accepted) yet must
+ * reach the next round. Lives here, not on the acceptance aggregate, so a
+ * round carries its own feedback (and takes it along when deleted) and
+ * staleness falls out of the round chain.
+ */
+ groupFeedback?: VerifyRunGroupFeedbackEntry[];
}
/**
diff --git a/src/features/Verify/Acceptance/Annotation.tsx b/src/features/Verify/Acceptance/Annotation.tsx
index ca953dd8558..b55cdbb595c 100644
--- a/src/features/Verify/Acceptance/Annotation.tsx
+++ b/src/features/Verify/Acceptance/Annotation.tsx
@@ -159,6 +159,12 @@ export interface DraftAnnotation {
interface AnnotationCanvasProps {
annotations: DraftAnnotation[];
+ /**
+ * Explicit display width (CSS px) — the host computes viewport × zoom.
+ * Rects are normalized to the image box, so zooming never remaps them; the
+ * host's scroll container doubles as panning when zoomed in.
+ */
+ imageWidth?: number;
onDraw: (rect: Rect) => void;
onRemove: (index: number) => void;
/** Reposition / resize an existing region. */
@@ -179,7 +185,7 @@ const clamp01 = (value: number) => Math.min(Math.max(value, 0), 1);
* corner handle to resize; each region carries its own note.
*/
export const AnnotationCanvas = memo<AnnotationCanvasProps>(
- ({ annotations, onDraw, onRemove, onUpdate, src }) => {
+ ({ annotations, imageWidth, onDraw, onRemove, onUpdate, src }) => {
const imageRef = useRef<HTMLImageElement>(null);
const [draft, setDraft] = useState<Rect | null>(null);
const gestureRef = useRef<Gesture | null>(null);
@@ -217,6 +223,10 @@ export const AnnotationCanvas = memo<AnnotationCanvasProps>(
return (
<div
className={`${styles.frame} ${styles.canvas}`}
+ // With an explicit zoomed width the frame must OUTGROW its host —
+ // capping at 100% would clip the image instead of letting the host
+ // viewport scroll/pan over it.
+ style={imageWidth ? { maxWidth: 'none' } : undefined}
onMouseUp={endGesture}
onMouseDown={(event) => {
event.preventDefault();
@@ -254,7 +264,16 @@ export const AnnotationCanvas = memo<AnnotationCanvasProps>(
});
}}
>
- <img alt={''} className={styles.image} draggable={false} ref={imageRef} src={src} />
+ <img
+ alt={''}
+ className={styles.image}
+ draggable={false}
+ ref={imageRef}
+ src={src}
+ // Zoomed width comes from the host (viewport × zoom); the frame
+ // shrink-wraps the image, so overlays track exactly.
+ style={imageWidth ? { maxWidth: 'none', width: imageWidth } : undefined}
+ />
{annotations.map((annotation, index) => (
<div
className={`${styles.rect} ${styles.editableRect}`}
diff --git a/src/features/Verify/Acceptance/CheckList.tsx b/src/features/Verify/Acceptance/CheckList.tsx
index 5d87933ab5e..e9252dab92e 100644
--- a/src/features/Verify/Acceptance/CheckList.tsx
+++ b/src/features/Verify/Acceptance/CheckList.tsx
@@ -1,6 +1,6 @@
'use client';
-import type { AcceptanceReviewAnnotation } from '@lobechat/types';
+import type { AcceptanceGroupFeedback, AcceptanceReviewAnnotation } from '@lobechat/types';
import { ActionIcon, copyToClipboard, Flexbox, Icon, Image, Tag, Text, Tooltip } from '@lobehub/ui';
import { Button } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar, cx } from 'antd-style';
@@ -17,6 +17,8 @@ import {
Film,
HelpCircle,
Images,
+ MessageSquarePlus,
+ MessageSquareText,
MessageSquareX,
Repeat,
XCircle,
@@ -32,6 +34,7 @@ import {
} from '../components/EvidenceComparisonCard';
import { AnnotatedImage } from './Annotation';
import { openCheckRejectModal } from './CheckRejectModal';
+import { openGroupFeedbackModal } from './modals';
export type AcceptanceCheck = AcceptanceBundle['checks'][number];
export type AcceptanceCheckState = AcceptanceCheck['state'];
@@ -675,7 +678,7 @@ const CheckRow = memo<{
);
return (
- <Flexbox className={styles.row}>
+ <Flexbox className={styles.row} data-check-row={check.id}>
<Flexbox
horizontal
align={'center'}
@@ -850,7 +853,7 @@ const CheckRow = memo<{
style={{
background: cssVar.colorFillQuaternary,
borderRadius: cssVar.borderRadius,
- width: 'fit-content',
+ width: '100%',
}}
>
<Text fontSize={12} type={'secondary'}>
@@ -984,8 +987,14 @@ interface CheckListProps {
canReview: boolean;
checks: AcceptanceCheck[];
collapsedGroups: Set<string>;
+ /** The latest round index — arbitrates group-feedback staleness. */
+ currentRound: number;
expanded: Set<string>;
filter: CheckFilter;
+ /** Group-scoped feedback entries recorded on the aggregate. */
+ groupFeedback: AcceptanceGroupFeedback[];
+ /** Record group-scoped feedback; resolves true when the write landed. */
+ onGroupFeedback: (category: string, comment: string) => Promise<boolean>;
/** Record the user's verdict; resolves true when the write landed. */
onReview: (input: CheckReviewInput) => Promise<boolean>;
onRound: (round: number) => void;
@@ -1003,8 +1012,11 @@ const CheckList = memo<CheckListProps>(
canReview,
checks,
collapsedGroups,
+ currentRound,
expanded,
filter,
+ groupFeedback,
+ onGroupFeedback,
onReview,
onRound,
onToggleGroup,
@@ -1047,9 +1059,22 @@ const CheckList = memo<CheckListProps>(
const unaccepted = reviewableChecks.filter(
(check) => userReviewState(check) !== 'accepted',
);
+ // The header counts what the REVIEWER cares about: how many they
+ // signed off, how many the verifier flagged, how many they sent
+ // back — not the verifier's pass tally alone.
+ const acceptedCount = reviewableChecks.filter(
+ (check) => userReviewState(check) === 'accepted',
+ ).length;
+ const rejectedCount = reviewableChecks.filter(
+ (check) => userReviewState(check) === 'rejected',
+ ).length;
+ const exceptionCount = groupChecks_.filter((check) => isException(check)).length;
// Everything passed AND the user signed all of it off — the ratio
// itself turns into the green receipt, no separate right-side note.
const allVerified = passed === groupChecks_.length && isGroupFullyAccepted(groupChecks_);
+ // Group-scoped feedback targets the raw category ('' = uncategorized).
+ const rawCategory = key === 'uncategorized' ? '' : label;
+ const feedbackEntries = groupFeedback.filter((entry) => entry.category === rawCategory);
return (
<Fragment key={key}>
@@ -1078,9 +1103,24 @@ const CheckList = memo<CheckListProps>(
{t('acceptance.group.allVerified', { passed, total: groupChecks_.length })}
</Flexbox>
) : (
- <Text fontSize={12} type={'secondary'}>
- {t('acceptance.group.passRatio', { passed, total: groupChecks_.length })}
- </Text>
+ <Flexbox horizontal align={'center'} gap={8}>
+ <Text fontSize={12} type={'secondary'}>
+ {t('acceptance.group.acceptedRatio', {
+ accepted: acceptedCount,
+ total: groupChecks_.length,
+ })}
+ </Text>
+ {exceptionCount > 0 && (
+ <Text style={{ color: cssVar.colorError, fontSize: 12 }}>
+ {t('acceptance.group.failedCount', { count: exceptionCount })}
+ </Text>
+ )}
+ {rejectedCount > 0 && (
+ <Text style={{ color: cssVar.colorError, fontSize: 12 }}>
+ {t('acceptance.group.rejectedCount', { count: rejectedCount })}
+ </Text>
+ )}
+ </Flexbox>
)}
{/* Bulk accept sits by the ratio it settles, hover-revealed —
a full-width column of always-on buttons begs misclicks. */}
@@ -1123,6 +1163,24 @@ const CheckList = memo<CheckListProps>(
{t('acceptance.review.acceptAllDone')}
</Flexbox>
))}
+ {/* Group-scoped feedback — the channel for concerns that
+ belong to no single check yet must reach the next round. */}
+ {canReview && (
+ <span className={'acceptance-group-actions'}>
+ <ActionIcon
+ icon={MessageSquarePlus}
+ size={'small'}
+ title={t('acceptance.group.feedbackAction')}
+ onClick={(event) => {
+ event.stopPropagation();
+ openGroupFeedbackModal({
+ groupLabel: label,
+ onConfirm: (comment) => onGroupFeedback(rawCategory, comment),
+ });
+ }}
+ />
+ </span>
+ )}
<Flexbox flex={1} />
{collapsed ? (
// Fixed-size placeholder keeps the header height stable across toggles.
@@ -1155,6 +1213,42 @@ const CheckList = memo<CheckListProps>(
}}
/>
</Flexbox>
+ {/* Group feedback trail — newest first; entries consumed by a
+ later round stay readable but visually recede. */}
+ {!collapsed && feedbackEntries.length > 0 && (
+ <Flexbox gap={10} paddingBlock={10} paddingInline={16}>
+ {[...feedbackEntries].reverse().map((entry) => {
+ const stale = entry.roundIndex < currentRound;
+ return (
+ <Flexbox
+ gap={4}
+ key={`${entry.createdAt}-${entry.roundIndex}`}
+ style={stale ? { opacity: 0.55 } : undefined}
+ >
+ <Flexbox horizontal align={'center'} gap={6}>
+ <Icon
+ color={stale ? cssVar.colorTextQuaternary : cssVar.colorError}
+ icon={MessageSquareText}
+ size={13}
+ />
+ <Text
+ style={{
+ color: stale ? cssVar.colorTextTertiary : cssVar.colorError,
+ fontSize: 12,
+ }}
+ >
+ {t('acceptance.group.feedbackLabel', { round: entry.roundIndex })}
+ </Text>
+ <Text fontSize={12} type={'secondary'}>
+ {dayjs(entry.createdAt).format('MM-DD HH:mm')}
+ </Text>
+ </Flexbox>
+ <Text style={{ fontSize: 12 }}>{entry.comment}</Text>
+ </Flexbox>
+ );
+ })}
+ </Flexbox>
+ )}
{!collapsed &&
rows.map((check) => (
<CheckRow
@@ -1180,6 +1274,8 @@ const CheckList = memo<CheckListProps>(
<Button
icon={<Icon icon={ChevronsDownUp} />}
size={'small'}
+ // Quiet escape hatch — tertiary text, not a competing action.
+ style={{ color: cssVar.colorTextTertiary }}
type={'text'}
onClick={() => onToggleGroup(key)}
>
diff --git a/src/features/Verify/Acceptance/CheckRejectModal.tsx b/src/features/Verify/Acceptance/CheckRejectModal.tsx
index 3590695d793..b5ddc827ce8 100644
--- a/src/features/Verify/Acceptance/CheckRejectModal.tsx
+++ b/src/features/Verify/Acceptance/CheckRejectModal.tsx
@@ -1,16 +1,77 @@
'use client';
import type { AcceptanceReviewAnnotation } from '@lobechat/types';
-import { Flexbox, Text, TextArea } from '@lobehub/ui';
-import { Button, createModal, type ModalInstance, useModalContext } from '@lobehub/ui/base-ui';
+import { ActionIcon, Flexbox, Text, TextArea } from '@lobehub/ui';
+import {
+ Button,
+ createModal,
+ Modal,
+ type ModalInstance,
+ useModalContext,
+} from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar, cx } from 'antd-style';
import { t } from 'i18next';
-import { memo, useEffect, useState } from 'react';
+import { Maximize2, ZoomIn, ZoomOut } from 'lucide-react';
+import { memo, useEffect, useLayoutEffect, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { AnnotationCanvas } from './Annotation';
const styles = createStaticStyles(({ css }) => ({
+ canvasWrap: css`
+ position: relative;
+
+ .acceptance-annotate-fullscreen {
+ position: absolute;
+ z-index: 5;
+ inset-block-start: 8px;
+ inset-inline-end: 8px;
+
+ border: 1px solid ${cssVar.colorBorderSecondary};
+
+ opacity: 0;
+ background: ${cssVar.colorBgContainer};
+
+ transition: opacity 0.2s;
+ }
+
+ &:hover {
+ .acceptance-annotate-fullscreen {
+ opacity: 1;
+ }
+ }
+ `,
+ fullscreenBody: css`
+ display: flex;
+ flex: 1;
+ gap: 16px;
+ min-height: 0;
+ `,
+ regionIndex: css`
+ flex: none;
+
+ width: 18px;
+ height: 18px;
+ border-radius: 50%;
+
+ font-size: 11px;
+ font-weight: 600;
+ line-height: 18px;
+ color: #fff;
+ text-align: center;
+
+ background: ${cssVar.colorError};
+ `,
+ sidePanel: css`
+ overflow-y: auto;
+ display: flex;
+ flex: none;
+ flex-direction: column;
+ gap: 12px;
+
+ width: 320px;
+ min-width: 0;
+ `,
thumb: css`
cursor: pointer;
@@ -31,6 +92,25 @@ const styles = createStaticStyles(({ css }) => ({
thumbActive: css`
border-color: ${cssVar.colorPrimary};
`,
+ /** The fullscreen zoom stage — its native scrolling doubles as panning. */
+ viewport: css`
+ overflow: auto;
+ flex: 1;
+
+ min-width: 0;
+ border: 1px solid ${cssVar.colorBorderSecondary};
+ border-radius: ${cssVar.borderRadiusLG};
+
+ background: ${cssVar.colorFillQuaternary};
+ `,
+ zoomLabel: css`
+ min-width: 44px;
+
+ font-size: 12px;
+ font-variant-numeric: tabular-nums;
+ color: ${cssVar.colorTextSecondary};
+ text-align: center;
+ `,
}));
/** One annotatable evidence image (already filtered to visual, file-backed). */
@@ -69,6 +149,8 @@ const readDraft = (key: string | undefined): RejectDraft | null => {
}
};
+const ZOOM_STEPS = [0.5, 0.75, 1, 1.5, 2, 3, 4];
+
interface CheckRejectModalProps {
checkTitle: string;
/** Stable key (the check id) for the refresh-surviving draft cache. */
@@ -98,6 +180,38 @@ const CheckRejectContent = memo<CheckRejectModalProps>(
.map((entry) => ({ ...entry, key: nextAnnotationKey() })),
);
+ // Fullscreen inspect-and-annotate: same draft state, a zoomable stage.
+ const [fullscreen, setFullscreen] = useState(false);
+ const [zoom, setZoom] = useState(1);
+ const viewportRef = useRef<HTMLDivElement>(null);
+ const [viewportWidth, setViewportWidth] = useState<number>();
+
+ useLayoutEffect(() => {
+ if (!fullscreen) return;
+ let observer: ResizeObserver | undefined;
+ let raf = 0;
+ // The Modal body mounts async (portal + open animation), so the ref may
+ // be null on the first pass — retry on the next frame until it attaches,
+ // then track its width. Without this the image stays fit-width and zoom
+ // does nothing (viewportWidth never resolves).
+ const attach = () => {
+ const node = viewportRef.current;
+ if (!node) {
+ raf = requestAnimationFrame(attach);
+ return;
+ }
+ const measure = () => setViewportWidth(node.clientWidth);
+ measure();
+ observer = new ResizeObserver(measure);
+ observer.observe(node);
+ };
+ attach();
+ return () => {
+ cancelAnimationFrame(raf);
+ observer?.disconnect();
+ };
+ }, [fullscreen, activeEvidenceId]);
+
// Persist the draft as it is typed; an empty draft cleans the slot up.
useEffect(() => {
if (!draftKey) return;
@@ -118,6 +232,13 @@ const CheckRejectContent = memo<CheckRejectModalProps>(
const activeEvidence = evidence.find((item) => item.id === activeEvidenceId);
const activeAnnotations = annotations.filter((item) => item.evidenceId === activeEvidenceId);
+ const stepZoom = (direction: 1 | -1) =>
+ setZoom((current) => {
+ const index = ZOOM_STEPS.findIndex((step) => Math.abs(step - current) < 0.001);
+ const at = index === -1 ? 2 : index;
+ return ZOOM_STEPS[Math.min(Math.max(at + direction, 0), ZOOM_STEPS.length - 1)];
+ });
+
// The reject IS its feedback — at least one note (global or per-region).
const canSubmit =
Boolean(comment.trim()) || annotations.some((annotation) => annotation.comment.trim());
@@ -146,6 +267,63 @@ const CheckRejectContent = memo<CheckRejectModalProps>(
const hasEvidence = evidence.length > 0;
+ const canvasHandlers = {
+ onDraw: (rect: AcceptanceReviewAnnotation['rect']) =>
+ setAnnotations((previous) => [
+ ...previous,
+ { comment: '', evidenceId: activeEvidence!.id, key: nextAnnotationKey(), rect },
+ ]),
+ onRemove: (index: number) => {
+ const target = activeAnnotations[index];
+ if (target)
+ setAnnotations((previous) => previous.filter((item) => item.key !== target.key));
+ },
+ onUpdate: (index: number, rect: AcceptanceReviewAnnotation['rect']) => {
+ const target = activeAnnotations[index];
+ if (target)
+ setAnnotations((previous) =>
+ previous.map((item) => (item.key === target.key ? { ...item, rect } : item)),
+ );
+ },
+ };
+
+ const annotationInputs = activeAnnotations.map((annotation, index) => (
+ <Flexbox horizontal align={'flex-start'} gap={8} key={annotation.key}>
+ <span className={styles.regionIndex} style={{ marginBlockStart: 6 }}>
+ {index + 1}
+ </span>
+ <TextArea
+ autoSize={{ maxRows: 5, minRows: 1 }}
+ style={{ flex: 1 }}
+ value={annotation.comment}
+ placeholder={translate('acceptance.review.annotationPlaceholder', {
+ index: index + 1,
+ })}
+ onChange={(event) =>
+ setAnnotations((previous) =>
+ previous.map((item) =>
+ item.key === annotation.key ? { ...item, comment: event.target.value } : item,
+ ),
+ )
+ }
+ />
+ </Flexbox>
+ ));
+
+ const thumbnails = evidence.length > 1 && (
+ <Flexbox horizontal gap={8} wrap={'wrap'}>
+ {evidence.map((item) => (
+ <div
+ className={cx(styles.thumb, item.id === activeEvidenceId && styles.thumbActive)}
+ key={item.id}
+ onClick={() => setActiveEvidenceId(item.id)}
+ >
+ <img alt={''} src={item.fileUrl} />
+ </div>
+ ))}
+ </Flexbox>
+ );
+
return (
<>
{/* Only the body scrolls — the action bar below stays pinned to the
@@ -161,9 +339,9 @@ const CheckRejectContent = memo<CheckRejectModalProps>(
{translate('acceptance.review.rejectDescription', { title: checkTitle })}
</Text>
- {/* Circling the evidence is the primary feedback act; the free-form note
- below is supplementary context. Without evidence, the note IS the
- feedback and stands alone. */}
+ {/* Circling the evidence is the primary feedback act; region notes
+ sit right under the canvas. Fullscreen opens the zoomable stage
+ for pixel-level inspection on large screenshots. */}
{hasEvidence && (
<Flexbox gap={8}>
<Flexbox gap={2}>
@@ -174,85 +352,27 @@ const CheckRejectContent = memo<CheckRejectModalProps>(
{translate('acceptance.review.annotateHint')}
</Text>
</Flexbox>
- {evidence.length > 1 && (
- <Flexbox horizontal gap={8} wrap={'wrap'}>
- {evidence.map((item) => (
- <div
- key={item.id}
- className={cx(
- styles.thumb,
- item.id === activeEvidenceId && styles.thumbActive,
- )}
- onClick={() => setActiveEvidenceId(item.id)}
- >
- <img alt={''} src={item.fileUrl} />
- </div>
- ))}
- </Flexbox>
- )}
+ {thumbnails}
{activeEvidence && (
- <AnnotationCanvas
- annotations={activeAnnotations}
- src={activeEvidence.fileUrl}
- onDraw={(rect) =>
- setAnnotations((previous) => [
- ...previous,
- {
- comment: '',
- evidenceId: activeEvidence.id,
- key: nextAnnotationKey(),
- rect,
- },
- ])
- }
- onRemove={(index) => {
- const target = activeAnnotations[index];
- if (target)
- setAnnotations((previous) =>
- previous.filter((item) => item.key !== target.key),
- );
- }}
- onUpdate={(index, rect) => {
- const target = activeAnnotations[index];
- if (target)
- setAnnotations((previous) =>
- previous.map((item) =>
- item.key === target.key ? { ...item, rect } : item,
- ),
- );
- }}
- />
+ <div className={styles.canvasWrap}>
+ <AnnotationCanvas
+ annotations={activeAnnotations}
+ src={activeEvidence.fileUrl}
+ {...canvasHandlers}
+ />
+ <ActionIcon
+ className={'acceptance-annotate-fullscreen'}
+ icon={Maximize2}
+ size={'small'}
+ title={translate('acceptance.review.fullscreen')}
+ onClick={() => {
+ setZoom(1);
+ setFullscreen(true);
+ }}
+ />
+ </div>
)}
- {activeAnnotations.map((annotation, index) => {
- return (
- <Flexbox horizontal align={'flex-start'} gap={8} key={annotation.key}>
- <Text
- fontSize={12}
- style={{ flex: 'none', lineHeight: '30px' }}
- type={'secondary'}
- >
- {index + 1}.
- </Text>
- <TextArea
- autoSize={{ maxRows: 4, minRows: 1 }}
- style={{ flex: 1 }}
- value={annotation.comment}
- placeholder={translate('acceptance.review.annotationPlaceholder', {
- index: index + 1,
- })}
- onChange={(event) =>
- setAnnotations((previous) =>
- previous.map((item) =>
- item.key === annotation.key
- ? { ...item, comment: event.target.value }
- : item,
- ),
- )
- }
- />
- </Flexbox>
- );
- })}
+ {annotationInputs}
</Flexbox>
)}
@@ -286,6 +406,84 @@ const CheckRejectContent = memo<CheckRejectModalProps>(
{translate('acceptance.review.confirmReject')}
</Button>
</Flexbox>
+
+ {/* Fullscreen inspect-and-annotate stage — a base-ui Modal so the mask,
+ theme scope and stacking are handled by the same layer system as
+ the reject dialog it opens over (nested modals stack correctly).
+ Same draft state: zoom via the toolbar, pan via the viewport's
+ native scroll. */}
+ <Modal
+ centered
+ destroyOnHidden
+ footer={null}
+ height={'88vh'}
+ open={fullscreen}
+ title={translate('acceptance.review.annotate')}
+ width={'min(96vw, 1440px)'}
+ styles={{
+ body: {
+ display: 'flex',
+ flexDirection: 'column',
+ gap: 12,
+ height: '100%',
+ minHeight: 0,
+ paddingBlock: 12,
+ },
+ }}
+ onCancel={() => setFullscreen(false)}
+ >
+ {activeEvidence && (
+ <>
+ <Flexbox horizontal align={'center'} gap={8}>
+ <Text fontSize={12} type={'secondary'}>
+ {translate('acceptance.review.annotateHint')}
+ </Text>
+ <Flexbox flex={1} />
+ <ActionIcon
+ disabled={zoom <= ZOOM_STEPS[0]}
+ icon={ZoomOut}
+ size={'small'}
+ title={translate('acceptance.review.zoomOut')}
+ onClick={() => stepZoom(-1)}
+ />
+ <span className={styles.zoomLabel}>{Math.round(zoom * 100)}%</span>
+ <ActionIcon
+ disabled={zoom >= ZOOM_STEPS.at(-1)!}
+ icon={ZoomIn}
+ size={'small'}
+ title={translate('acceptance.review.zoomIn')}
+ onClick={() => stepZoom(1)}
+ />
+ </Flexbox>
+ {thumbnails}
+ <div className={styles.fullscreenBody}>
+ <div className={styles.viewport} ref={viewportRef}>
+ <AnnotationCanvas
+ annotations={activeAnnotations}
+ src={activeEvidence.fileUrl}
+ imageWidth={
+ // -2 keeps the frame's own border inside the viewport at
+ // fit zoom, so no phantom horizontal scrollbar.
+ viewportWidth ? Math.max(viewportWidth * zoom - 2, 0) : undefined
+ }
+ {...canvasHandlers}
+ />
+ </div>
+ <div className={styles.sidePanel}>
+ <Text strong fontSize={13}>
+ {translate('acceptance.review.regionComments')}
+ </Text>
+ {activeAnnotations.length === 0 && (
+ <Text fontSize={12} type={'secondary'}>
+ {translate('acceptance.review.regionCommentsEmpty')}
+ </Text>
+ )}
+ {annotationInputs}
+ </div>
+ </div>
+ </>
+ )}
+ </Modal>
</>
);
},
@@ -293,7 +491,7 @@ const CheckRejectContent = memo<CheckRejectModalProps>(
CheckRejectContent.displayName = 'AcceptanceCheckRejectContent';
-/** Per-check reject dialog — a note plus optional circled regions on evidence. */
+/** Per-check reject dialog — a note plus circled regions; fullscreen zoom to inspect. */
export const openCheckRejectModal = (options: CheckRejectModalProps): ModalInstance =>
createModal({
content: <CheckRejectContent {...options} />,
diff --git a/src/features/Verify/Acceptance/DecisionBar.tsx b/src/features/Verify/Acceptance/DecisionBar.tsx
new file mode 100644
index 00000000000..1d41856a23f
--- /dev/null
+++ b/src/features/Verify/Acceptance/DecisionBar.tsx
@@ -0,0 +1,120 @@
+'use client';
+
+import { Flexbox, Icon, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
+import { createStaticStyles, cssVar } from 'antd-style';
+import { BadgeCheck, HelpCircle, ListTodo, Loader2, RotateCcw } from 'lucide-react';
+import { memo } from 'react';
+import { useTranslation } from 'react-i18next';
+
+const styles = createStaticStyles(({ css }) => ({
+ /* Floats over the scrolling checklist — the decision stays reachable
+ however deep the review goes. */
+ bar: css`
+ position: sticky;
+ z-index: 20;
+ inset-block-end: 16px;
+
+ display: flex;
+ gap: 12px;
+ align-items: center;
+
+ padding-block: 10px;
+ padding-inline: 14px;
+ border: 1px solid ${cssVar.colorBorderSecondary};
+ border-radius: ${cssVar.borderRadiusLG};
+
+ background: ${cssVar.colorBgElevated};
+ box-shadow: ${cssVar.boxShadowTertiary};
+ `,
+ feedbackChip: css`
+ white-space: nowrap;
+ `,
+}));
+
+type BarState = 'accepted' | 'live' | 'rejected' | 'settled';
+
+interface DecisionBarProps {
+ /** Active (not-yet-consumed) feedback recorded this round. */
+ feedbackCount: number;
+ /** Exceptions (failed / uncertain) in the current union — colors the settled text. */
+ hasException: boolean;
+ onAccept: () => void;
+ onOpenFeedback: () => void;
+ pending: boolean;
+ state: BarState;
+ /** The state line, prepared by the page (status + counts wording). */
+ statusText: string;
+ subText?: string;
+}
+
+/**
+ * The floating decision strip (P-12): the round chain's state, the feedback
+ * clearing-list opener, and the closing accept. Whole-delivery feedback is
+ * NOT an inline input here — feedback is left per-check / per-group where the
+ * evidence is; the bar stays a decision surface, not a compose box.
+ */
+const DecisionBar = memo<DecisionBarProps>(
+ ({
+ feedbackCount,
+ hasException,
+ onAccept,
+ onOpenFeedback,
+ pending,
+ state,
+ statusText,
+ subText,
+ }) => {
+ const { t } = useTranslation('verify');
+
+ const stateMeta = {
+ accepted: { color: cssVar.colorSuccess, icon: BadgeCheck, spin: false },
+ live: { color: cssVar.colorInfo, icon: Loader2, spin: true },
+ rejected: { color: cssVar.colorError, icon: RotateCcw, spin: false },
+ settled: {
+ color: hasException ? cssVar.colorWarning : cssVar.colorSuccess,
+ icon: hasException ? HelpCircle : BadgeCheck,
+ spin: false,
+ },
+ }[state];
+
+ return (
+ <div className={styles.bar}>
+ <Icon color={stateMeta.color} icon={stateMeta.icon} size={18} spin={stateMeta.spin} />
+ <Flexbox gap={1} style={{ flex: 1, minWidth: 0 }}>
+ <Text strong style={{ fontSize: 14, whiteSpace: 'nowrap' }}>
+ {statusText}
+ </Text>
+ {subText && (
+ <Text ellipsis fontSize={12} type={'secondary'}>
+ {subText}
+ </Text>
+ )}
+ </Flexbox>
+
+ {/* The clearing list — every note this round queues for the next one. */}
+ {feedbackCount > 0 && (
+ <Button
+ className={styles.feedbackChip}
+ icon={<Icon icon={ListTodo} />}
+ size={'small'}
+ type={'text'}
+ onClick={onOpenFeedback}
+ >
+ {t('acceptance.bar.feedback', { count: feedbackCount })}
+ </Button>
+ )}
+
+ {state === 'settled' && (
+ <Button disabled={pending} type={'primary'} onClick={onAccept}>
+ {t('acceptance.actions.accept')}
+ </Button>
+ )}
+ </div>
+ );
+ },
+);
+
+DecisionBar.displayName = 'AcceptanceDecisionBar';
+
+export default DecisionBar;
diff --git a/src/features/Verify/Acceptance/FeedbackDrawer.tsx b/src/features/Verify/Acceptance/FeedbackDrawer.tsx
new file mode 100644
index 00000000000..15d5f466b69
--- /dev/null
+++ b/src/features/Verify/Acceptance/FeedbackDrawer.tsx
@@ -0,0 +1,165 @@
+'use client';
+
+import { Drawer, Flexbox, Icon, Tag, Text } from '@lobehub/ui';
+import { createStaticStyles, cssVar } from 'antd-style';
+import dayjs from 'dayjs';
+import { MessageSquareText, MessageSquareX } from 'lucide-react';
+import { memo } from 'react';
+import { useTranslation } from 'react-i18next';
+
+const styles = createStaticStyles(({ css }) => ({
+ card: css`
+ padding-block: 10px;
+ padding-inline: 12px;
+ border: 1px solid ${cssVar.colorBorderSecondary};
+ border-radius: ${cssVar.borderRadiusLG};
+ `,
+ clickable: css`
+ cursor: pointer;
+ transition: border-color 0.2s;
+
+ &:hover {
+ border-color: ${cssVar.colorBorder};
+ background: ${cssVar.colorFillQuaternary};
+ }
+ `,
+ sectionTitle: css`
+ font-size: 12px;
+ font-weight: 500;
+ color: ${cssVar.colorTextTertiary};
+ letter-spacing: 0.04em;
+ `,
+ seq: css`
+ font-family: ${cssVar.fontFamilyCode};
+ font-size: 11px;
+ color: ${cssVar.colorTextQuaternary};
+ `,
+}));
+
+/** One feedback event, flattened for the clearing list — check-scoped or group/global. */
+export interface FeedbackListEntry {
+ /** Number of circled regions carried by the feedback (check rejects). */
+ annotationCount?: number;
+ /** Jump target — set for check-scoped entries. */
+ checkId?: string;
+ /** Check label ("C3") for check-scoped entries. */
+ checkSeq?: number;
+ comment: string;
+ createdAt: string;
+ /** Group label; '' = the whole-delivery (global) channel. */
+ groupLabel?: string;
+ kind: 'check' | 'group';
+ roundIndex: number;
+ /** Consumed by a later round — history, not the next round's input. */
+ stale: boolean;
+ /** Check title for check-scoped entries. */
+ title?: string;
+}
+
+interface FeedbackDrawerProps {
+ entries: FeedbackListEntry[];
+ onClose: () => void;
+ /** Expand + scroll to a check row in the union list. */
+ onJumpToCheck: (checkId: string) => void;
+ open: boolean;
+}
+
+const EntryCard = memo<{
+ entry: FeedbackListEntry;
+ onJumpToCheck: (checkId: string) => void;
+}>(({ entry, onJumpToCheck }) => {
+ const { t } = useTranslation('verify');
+ const isCheck = entry.kind === 'check';
+ return (
+ <Flexbox
+ className={`${styles.card} ${entry.checkId ? styles.clickable : ''}`}
+ gap={6}
+ style={entry.stale ? { opacity: 0.55 } : undefined}
+ onClick={entry.checkId ? () => onJumpToCheck(entry.checkId!) : undefined}
+ >
+ <Flexbox horizontal align={'center'} gap={6}>
+ <Icon
+ color={entry.stale ? cssVar.colorTextQuaternary : cssVar.colorError}
+ icon={isCheck ? MessageSquareX : MessageSquareText}
+ size={13}
+ />
+ {isCheck ? (
+ <>
+ <span className={styles.seq}>C{entry.checkSeq}</span>
+ <Text ellipsis style={{ fontSize: 13, minWidth: 0 }}>
+ {entry.title}
+ </Text>
+ </>
+ ) : (
+ <Text style={{ fontSize: 13 }}>
+ {entry.groupLabel
+ ? t('acceptance.feedback.group', { label: entry.groupLabel })
+ : t('acceptance.feedback.global')}
+ </Text>
+ )}
+ <Flexbox flex={1} />
+ {entry.annotationCount ? (
+ <Tag size={'small'}>
+ {t('acceptance.feedback.annotations', { count: entry.annotationCount })}
+ </Tag>
+ ) : null}
+ <Text fontSize={12} type={'secondary'}>
+ {t('acceptance.round', { round: entry.roundIndex })} ·{' '}
+ {dayjs(entry.createdAt).format('MM-DD HH:mm')}
+ </Text>
+ </Flexbox>
+ {entry.comment && <Text style={{ fontSize: 13 }}>{entry.comment}</Text>}
+ </Flexbox>
+ );
+});
+
+/**
+ * The feedback clearing house: what THIS round's review has queued for the
+ * next verification round (active), and everything earlier rounds already
+ * consumed (history) — one place to audit the whole trail.
+ */
+const FeedbackDrawer = memo<FeedbackDrawerProps>(({ entries, onClose, onJumpToCheck, open }) => {
+ const { t } = useTranslation('verify');
+ const active = entries.filter((entry) => !entry.stale);
+ const history = entries.filter((entry) => entry.stale);
+
+ return (
+ <Drawer
+ open={open}
+ placement={'right'}
+ title={t('acceptance.feedback.title')}
+ width={'min(92vw, 440px)'}
+ onClose={onClose}
+ >
+ <Flexbox gap={16}>
+ <Flexbox gap={8}>
+ <Text className={styles.sectionTitle}>
+ {t('acceptance.feedback.current', { count: active.length })}
+ </Text>
+ {active.length === 0 && (
+ <Text fontSize={12} type={'secondary'}>
+ {t('acceptance.feedback.empty')}
+ </Text>
+ )}
+ {active.map((entry, index) => (
+ <EntryCard entry={entry} key={index} onJumpToCheck={onJumpToCheck} />
+ ))}
+ </Flexbox>
+ {history.length > 0 && (
+ <Flexbox gap={8}>
+ <Text className={styles.sectionTitle}>
+ {t('acceptance.feedback.history', { count: history.length })}
+ </Text>
+ {history.map((entry, index) => (
+ <EntryCard entry={entry} key={index} onJumpToCheck={onJumpToCheck} />
+ ))}
+ </Flexbox>
+ )}
+ </Flexbox>
+ </Drawer>
+ );
+});
+
+FeedbackDrawer.displayName = 'AcceptanceFeedbackDrawer';
+
+export default FeedbackDrawer;
diff --git a/src/features/Verify/Acceptance/index.tsx b/src/features/Verify/Acceptance/index.tsx
index 9383ef036a2..5761e75f447 100644
--- a/src/features/Verify/Acceptance/index.tsx
+++ b/src/features/Verify/Acceptance/index.tsx
@@ -37,6 +37,10 @@ import { useParams } from 'react-router';
import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
import AgentProfilePopup from '@/features/AgentProfileCard/AgentProfilePopup';
+// 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';
+import { verifyKeys } from '@/libs/swr/keys';
import { verifyService } from '@/services/verify';
import { useAcceptanceBundle } from '../hooks';
@@ -50,6 +54,8 @@ import CheckList, {
isException,
isGroupFullyAccepted,
} from './CheckList';
+import DecisionBar from './DecisionBar';
+import FeedbackDrawer, { type FeedbackListEntry } from './FeedbackDrawer';
import LedgerPanel, { type AcceptanceRound } from './LedgerPanel';
import { openAcceptModal } from './modals';
@@ -181,6 +187,7 @@ const AcceptancePage = memo<AcceptancePageProps>(({ acceptanceId: explicitAccept
const [reportRound, setReportRound] = useState<AcceptanceRound | null>(null);
const [pending, setPending] = useState(false);
const [actionError, setActionError] = useState<string>();
+ const [feedbackOpen, setFeedbackOpen] = useState(false);
const status = data?.acceptance.status;
@@ -246,6 +253,14 @@ const AcceptancePage = memo<AcceptancePageProps>(({ acceptanceId: explicitAccept
const { acceptance, checks, isOwner, latestReport, origin, rounds, subject } = data;
const currentRound = rounds.at(-1);
+ // Group-scoped feedback lives on each round's decision detail — flatten the
+ // chain into the derived per-entry view (roundIndex from the carrying run).
+ const groupFeedbackEntries = rounds.flatMap((round) =>
+ (round.run.decisionDetail?.groupFeedback ?? []).map((entry) => ({
+ ...entry,
+ roundIndex: round.run.roundIndex ?? 0,
+ })),
+ );
// The latest coding round's context — rendered with the latest report card
// (it describes what THAT round verified), not as aggregate-level identity.
// A round with no scenario predates the column and is a coding round; a
@@ -323,6 +338,9 @@ const AcceptancePage = memo<AcceptancePageProps>(({ acceptanceId: explicitAccept
setActionError(undefined);
await action();
await mutate();
+ // The list panel derives its glyph from the same status — a decision
+ // here must not leave a stale icon there until a hard refresh.
+ void globalMutate(verifyKeys.acceptances());
return true;
} catch (cause) {
setActionError(cause instanceof Error ? cause.message : t('acceptance.actionError'));
@@ -342,120 +360,94 @@ const AcceptancePage = memo<AcceptancePageProps>(({ acceptanceId: explicitAccept
const handleReview = (input: CheckReviewInput) =>
runAction(() => verifyService.reviewChecks({ id: acceptance.id, ...input }));
- const decisionBanner = () => {
- if (LIVE_STATUSES.has(acceptance.status))
- return (
- <Flexbox
- horizontal
- align={'center'}
- className={styles.banner}
- gap={10}
- style={{ background: cssVar.colorInfoBg }}
- >
- <Icon spin color={cssVar.colorInfo} icon={Loader2} size={16} />
- <Flexbox flex={1} gap={2}>
- <Text strong style={{ fontSize: 13 }}>
- {t(`acceptance.status.${acceptance.status}`)}
- </Text>
- <Text fontSize={12} type={'secondary'}>
- {t('acceptance.banner.liveHint')}
- </Text>
- </Flexbox>
- </Flexbox>
- );
-
- if (acceptance.status === 'accepted')
- return (
- <Flexbox
- horizontal
- align={'center'}
- className={styles.banner}
- gap={10}
- style={{ background: cssVar.colorSuccessBg }}
- >
- <Icon color={cssVar.colorSuccess} icon={BadgeCheck} size={18} />
- <Flexbox flex={1} gap={2}>
- <Text strong style={{ fontSize: 13 }}>
- {t('acceptance.banner.accepted', {
- time: acceptance.completedAt
- ? dayjs(acceptance.completedAt).format('YYYY-MM-DD HH:mm')
- : '',
- })}
- </Text>
- <Text fontSize={12} type={'secondary'}>
- {countsText} · {t('acceptance.banner.acceptedHint', { count: rounds.length })}
- </Text>
- </Flexbox>
- </Flexbox>
- );
-
- if (acceptance.status === 'rejected') {
- const reason = currentRound?.run.decisionDetail?.comment;
- return (
- <Flexbox className={styles.banner} gap={6} style={{ background: cssVar.colorErrorBg }}>
- <Flexbox horizontal align={'center'} gap={10}>
- <Icon color={cssVar.colorError} icon={RotateCcw} size={16} />
- <Text strong style={{ fontSize: 13 }}>
- {t('acceptance.banner.rejected')}
- </Text>
- </Flexbox>
- {reason && (
- <Text fontSize={12} type={'secondary'}>
- {t('acceptance.banner.rejectedReason', { reason })}
- </Text>
- )}
- <Text fontSize={12} type={'secondary'}>
- {t('acceptance.banner.rejectedHint')}
- </Text>
- </Flexbox>
- );
- }
+ // Group-scoped feedback — for concerns that belong to no single check (the
+ // checks themselves may be accepted) yet must reach the next round.
+ const handleGroupFeedback = (category: string, comment: string) =>
+ runAction(() => verifyService.addGroupFeedback({ category, comment, id: acceptance.id }));
- // delivered / errored — the round chain settled; the decision is the user's.
- const hasException = counts.exceptions > 0;
- return (
- <Flexbox
- horizontal
- align={'center'}
- className={styles.banner}
- gap={12}
- style={{ background: hasException ? cssVar.colorWarningBg : cssVar.colorSuccessBg }}
- >
- <Icon
- color={hasException ? cssVar.colorWarning : cssVar.colorSuccess}
- icon={hasException ? HelpCircle : BadgeCheck}
- size={18}
- />
- <Flexbox flex={1} gap={2}>
- <Text strong style={{ fontSize: 13 }}>
- {hasException
- ? t('acceptance.banner.exceptions', { count: counts.exceptions })
- : t('acceptance.banner.clean', { count: rounds.length })}
- </Text>
- <Text fontSize={12} type={'secondary'}>
- {countsText} · {t('acceptance.banner.decisionHint')}
- </Text>
- </Flexbox>
- {/* Whole-delivery reject is deliberately NOT exposed yet — per-check
- reject-with-feedback is the send-back path; only the closing
- accept ships for now. */}
- <Button
- disabled={pending}
- type={'primary'}
- onClick={() =>
- openAcceptModal({
- exceptions: checks.filter((check) => isException(check)).map((check) => check.title),
- onConfirm: () => runAction(() => verifyService.acceptDelivery(acceptance.id)),
- subjectTitle: subject.title ?? subject.id,
- })
- }
- >
- {t('acceptance.actions.accept')}
- </Button>
- </Flexbox>
- );
+ // The floating bar's one-line state + supporting line — the old banner's
+ // content, relocated to where the decision actually happens.
+ const barState = LIVE_STATUSES.has(acceptance.status)
+ ? ('live' as const)
+ : acceptance.status === 'accepted'
+ ? ('accepted' as const)
+ : acceptance.status === 'rejected'
+ ? ('rejected' as const)
+ : ('settled' as const);
+ const hasException = counts.exceptions > 0;
+ const barTexts = {
+ accepted: {
+ statusText: t('acceptance.banner.accepted', {
+ time: acceptance.completedAt
+ ? dayjs(acceptance.completedAt).format('YYYY-MM-DD HH:mm')
+ : '',
+ }),
+ subText: `${countsText} · ${t('acceptance.banner.acceptedHint', { count: rounds.length })}`,
+ },
+ live: {
+ statusText: t(`acceptance.status.${acceptance.status}` as any),
+ subText: t('acceptance.banner.liveHint'),
+ },
+ rejected: {
+ statusText: t('acceptance.banner.rejected'),
+ subText: currentRound?.run.decisionDetail?.comment ?? t('acceptance.banner.rejectedHint'),
+ },
+ settled: {
+ statusText: hasException
+ ? t('acceptance.banner.exceptions', { count: counts.exceptions })
+ : t('acceptance.banner.clean', { count: rounds.length }),
+ subText: `${countsText} · ${t('acceptance.banner.decisionHint')}`,
+ },
+ }[barState];
+
+ // Every feedback event, flattened for the clearing list: per-check rejects
+ // (each review event) + group/global notes, active vs consumed by round.
+ const currentRoundIndex = currentRound?.run.roundIndex ?? 0;
+ const feedbackEntries: FeedbackListEntry[] = [
+ ...checks.flatMap((check) =>
+ check.reviews
+ .filter((review) => review.action === 'reject')
+ .map((review) => ({
+ annotationCount: review.annotations?.length || undefined,
+ checkId: check.id,
+ checkSeq: check.seq,
+ comment: review.comment ?? '',
+ createdAt: review.createdAt,
+ kind: 'check' as const,
+ roundIndex: review.roundIndex,
+ stale: review.roundIndex < currentRoundIndex,
+ title: check.title,
+ })),
+ ),
+ ...groupFeedbackEntries.map((entry) => ({
+ comment: entry.comment,
+ createdAt: entry.createdAt,
+ groupLabel: entry.category,
+ kind: 'group' as const,
+ roundIndex: entry.roundIndex,
+ stale: entry.roundIndex < currentRoundIndex,
+ })),
+ ].sort((a, b) => b.createdAt.localeCompare(a.createdAt));
+ const activeFeedbackCount = feedbackEntries.filter((entry) => !entry.stale).length;
+
+ const jumpToCheck = (checkId: string) => {
+ setFeedbackOpen(false);
+ setExpanded((previous) => new Set(previous).add(checkId));
+ // Wait a paint so a collapsed group/row has rendered before scrolling.
+ setTimeout(() => {
+ document
+ .querySelector(`[data-check-row="${checkId}"]`)
+ ?.scrollIntoView({ behavior: 'smooth', block: 'center' });
+ }, 80);
};
+ const handleAccept = () =>
+ openAcceptModal({
+ exceptions: checks.filter((check) => isException(check)).map((check) => check.title),
+ onConfirm: () => runAction(() => verifyService.acceptDelivery(acceptance.id)),
+ subjectTitle: subject.title ?? subject.id,
+ });
+
return (
<Flexbox horizontal className={styles.page}>
{/* The reopen affordance lives at the page corner — no edge handle tab. */}
@@ -527,7 +519,7 @@ const AcceptancePage = memo<AcceptancePageProps>(({ acceptanceId: explicitAccept
align={'center'}
className={styles.scopeChip}
gap={6}
- style={{ cursor: 'default' }}
+ style={{ cursor: 'default', fontSize: 14 }}
>
<Avatar
avatar={origin.agent.avatar ?? undefined}
@@ -544,8 +536,18 @@ const AcceptancePage = memo<AcceptancePageProps>(({ acceptanceId: explicitAccept
align={'center'}
className={cx(styles.scopeChip, styles.scopeLink)}
gap={4}
+ style={{ fontSize: 14 }}
title={t('acceptance.origin.openTopic')}
- onClick={() => window.open(`/chat?topic=${origin.topic!.id}`, '_blank')}
+ onClick={() =>
+ window.open(
+ // The canonical conversation route needs the agent;
+ // without one, the legacy topic deep-link is the way in.
+ origin.agent
+ ? `/agent/${origin.agent.id}/${origin.topic!.id}`
+ : `/chat?topic=${origin.topic!.id}`,
+ '_blank',
+ )
+ }
>
<Icon icon={MessagesSquare} size={13} />
{origin.topic.title ?? subject.title ?? origin.topic.id}
@@ -556,9 +558,6 @@ const AcceptancePage = memo<AcceptancePageProps>(({ acceptanceId: explicitAccept
)}
</Flexbox>
- {/* Decision bar — the user closes the lifecycle (P-12). Owner-only:
- the closing accept is the author's call, never a visitor's. */}
- {isOwner && decisionBanner()}
{actionError && <Text type={'danger'}>{actionError}</Text>}
{/* The acceptance goal — THE thing this delivery is judged against,
@@ -674,8 +673,11 @@ const AcceptancePage = memo<AcceptancePageProps>(({ acceptanceId: explicitAccept
{rounds.length > 1 && (
<Select
size={'small'}
- style={{ width: 110 }}
+ // Filled + the Segmented's exact height so the two read as
+ // one control family, not a stray bordered input.
+ style={{ height: 34, width: 110 }}
value={roundFilter === null ? 'all' : String(roundFilter)}
+ variant={'filled'}
options={[
{ label: t('acceptance.filter.roundAll'), value: 'all' },
...[...rounds].reverse().map((round) => ({
@@ -704,10 +706,13 @@ const AcceptancePage = memo<AcceptancePageProps>(({ acceptanceId: explicitAccept
canReview={isOwner}
checks={checks}
collapsedGroups={collapsedGroups}
+ currentRound={currentRound?.run.roundIndex ?? 0}
expanded={expanded}
filter={filter}
+ groupFeedback={groupFeedbackEntries}
reviewPending={pending}
round={roundFilter}
+ onGroupFeedback={handleGroupFeedback}
onReview={handleReview}
onRound={gotoRound}
onToggleGroup={(key) =>
@@ -737,10 +742,31 @@ const AcceptancePage = memo<AcceptancePageProps>(({ acceptanceId: explicitAccept
})
}
/>
- <Flexbox style={{ height: 24 }} />
+ {/* The floating decision strip — owner-only: closing the loop and
+ queueing feedback are the author's calls, never a visitor's. */}
+ {isOwner && (
+ <DecisionBar
+ feedbackCount={activeFeedbackCount}
+ hasException={hasException}
+ pending={pending}
+ state={barState}
+ statusText={barTexts.statusText}
+ subText={barTexts.subText}
+ onAccept={handleAccept}
+ onOpenFeedback={() => setFeedbackOpen(true)}
+ />
+ )}
+ <Flexbox style={{ height: 8 }} />
</Flexbox>
</Flexbox>
+ <FeedbackDrawer
+ entries={feedbackEntries}
+ open={feedbackOpen}
+ onClose={() => setFeedbackOpen(false)}
+ onJumpToCheck={jumpToCheck}
+ />
+
{/* Round ledger — audit detail, off the decision path (P-13). No edge
handle: opening happens from the page-corner toggle, closing from the
ledger's own header action. */}
diff --git a/src/features/Verify/Acceptance/modals.tsx b/src/features/Verify/Acceptance/modals.tsx
index 796b108fe2f..34150e74f0a 100644
--- a/src/features/Verify/Acceptance/modals.tsx
+++ b/src/features/Verify/Acceptance/modals.tsx
@@ -141,3 +141,69 @@ export const openRejectModal = (options: RejectContentProps): ModalInstance =>
title: t('acceptance.actions.reject', { ns: 'verify' }),
width: 'min(90vw, 480px)',
});
+
+interface GroupFeedbackContentProps {
+ groupLabel: string;
+ /** Record the feedback; resolve true to close. */
+ onConfirm: (comment: string) => Promise<boolean>;
+}
+
+const GroupFeedbackContent = memo<GroupFeedbackContentProps>(({ groupLabel, onConfirm }) => {
+ const { t: translate } = useTranslation('verify');
+ const { close } = useModalContext();
+ const [comment, setComment] = useState('');
+ const [loading, setLoading] = useState(false);
+
+ const handleConfirm = async () => {
+ const trimmed = comment.trim();
+ if (!trimmed) return;
+ setLoading(true);
+ try {
+ if (await onConfirm(trimmed)) close();
+ } finally {
+ setLoading(false);
+ }
+ };
+
+ return (
+ <Flexbox gap={16}>
+ <Text fontSize={13} type={'secondary'}>
+ {translate('acceptance.group.feedbackDescription', { label: groupLabel })}
+ </Text>
+ <TextArea
+ autoSize={{ maxRows: 8, minRows: 3 }}
+ placeholder={translate('acceptance.group.feedbackPlaceholder')}
+ value={comment}
+ onChange={(event) => setComment(event.target.value)}
+ />
+ <Flexbox horizontal gap={8} justify={'flex-end'}>
+ <Button disabled={loading} onClick={close}>
+ {translate('acceptance.actions.cancel')}
+ </Button>
+ <Button
+ disabled={!comment.trim()}
+ loading={loading}
+ type={'primary'}
+ onClick={handleConfirm}
+ >
+ {translate('acceptance.group.feedbackSubmit')}
+ </Button>
+ </Flexbox>
+ </Flexbox>
+ );
+});
+
+GroupFeedbackContent.displayName = 'AcceptanceGroupFeedbackContent';
+
+/**
+ * Group-scoped feedback dialog — the channel for concerns that belong to no
+ * single check (which may well be accepted) yet must reach the next round.
+ */
+export const openGroupFeedbackModal = (options: GroupFeedbackContentProps): ModalInstance =>
+ createModal({
+ content: <GroupFeedbackContent {...options} />,
+ footer: null,
+ maskClosable: true,
+ title: t('acceptance.group.feedbackTitle', { ns: 'verify' }),
+ width: 'min(90vw, 520px)',
+ });
diff --git a/src/services/verify.ts b/src/services/verify.ts
index 3552caff0cf..64a43e73721 100644
--- a/src/services/verify.ts
+++ b/src/services/verify.ts
@@ -162,6 +162,13 @@ export class VerifyService {
id: string;
}) => lambdaClient.acceptance.reviewChecks.mutate(input);
+ /**
+ * Feedback addressed to a check group (business category) — for concerns
+ * that belong to no single check yet must reach the next round.
+ */
+ addGroupFeedback = (input: { category: string; comment: string; id: string }) =>
+ lambdaClient.acceptance.addGroupFeedback.mutate(input);
+
// ---- per-run plan ----
getVerifyState = (operationId: string): Promise<VerifyStateResponse | null> =>
lambdaClient.verify.getVerifyState.query({