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(goal): mark accepted deliveries on batch squares and the checklist title (#22782)

Arvin Xu0003e726ea34
diff --git a/locales/en-US/chat.json b/locales/en-US/chat.json
index c9a0b0786c1..d30fb8d54a2 100644
--- a/locales/en-US/chat.json
+++ b/locales/en-US/chat.json
@@ -497,6 +497,7 @@
"goalAcceptance.removeConfirm.content": "\"{{title}}\" will no longer gate this goal’s final acceptance.",
"goalAcceptance.removeConfirm.title": "Remove this criterion?",
"goalAcceptance.title": "Acceptance standard",
+ "goalBatch.cell.accepted": "Accepted",
"goalBatch.cell.backlog": "Not run",
"goalBatch.cell.done": "Done",
"goalBatch.cell.human": "Needs you",
diff --git a/locales/zh-CN/chat.json b/locales/zh-CN/chat.json
index edd88fd94c2..7d24b3a89d8 100644
--- a/locales/zh-CN/chat.json
+++ b/locales/zh-CN/chat.json
@@ -497,6 +497,7 @@
"goalAcceptance.removeConfirm.content": "「{{title}}」将不再作为此目标的最终验收条件。",
"goalAcceptance.removeConfirm.title": "移除这条标准?",
"goalAcceptance.title": "验收标准",
+ "goalBatch.cell.accepted": "已验收",
"goalBatch.cell.backlog": "暂未执行",
"goalBatch.cell.done": "执行完成",
"goalBatch.cell.human": "需要介入",
diff --git a/packages/locales/src/default/chat.ts b/packages/locales/src/default/chat.ts
index fb14147e1bf..c82694883c1 100644
--- a/packages/locales/src/default/chat.ts
+++ b/packages/locales/src/default/chat.ts
@@ -76,6 +76,7 @@ export default {
'response.contentSafetyNotice':
'This reply was limited for content safety reasons. If this happens often, you may temporarily lose access to this model.',
+ 'goalBatch.cell.accepted': 'Accepted',
'goalBatch.cell.backlog': 'Not run',
'goalBatch.cell.done': 'Done',
'goalBatch.cell.human': 'Needs you',
diff --git a/src/features/Acceptance/Viewer/Checks/AcceptanceCheckInventory.tsx b/src/features/Acceptance/Viewer/Checks/AcceptanceCheckInventory.tsx
index a4b1133814d..a8673e72472 100644
--- a/src/features/Acceptance/Viewer/Checks/AcceptanceCheckInventory.tsx
+++ b/src/features/Acceptance/Viewer/Checks/AcceptanceCheckInventory.tsx
@@ -67,12 +67,15 @@ const styles = createStaticStyles(({ css }) => ({
interface AcceptanceCheckInventoryProps {
children?: ReactNode;
onOpenTrace?: (verifierOperationId: string) => void | Promise<void>;
+ /** Rides right after the title — a host's word on where the delivery stands. */
+ titleExtra?: ReactNode;
toolbar?: ReactNode;
}
const AcceptanceCheckInventory = ({
children,
onOpenTrace,
+ titleExtra,
toolbar,
}: AcceptanceCheckInventoryProps) => {
const { t } = useTranslation('verify');
@@ -241,6 +244,7 @@ const AcceptanceCheckInventory = ({
<Text strong style={{ fontSize: 14, whiteSpace: 'nowrap' }}>
{t('acceptance.checks.title')}
</Text>
+ {titleExtra}
<Flexbox flex={1} />
{toolbar}
</Flexbox>
diff --git a/src/features/AgentGoals/ProcessControl/Graph/BatchGroups.tsx b/src/features/AgentGoals/ProcessControl/Graph/BatchGroups.tsx
index 9b0ab55091d..7b5a68dea0f 100644
--- a/src/features/AgentGoals/ProcessControl/Graph/BatchGroups.tsx
+++ b/src/features/AgentGoals/ProcessControl/Graph/BatchGroups.tsx
@@ -13,6 +13,7 @@ import {
} from '@lobehub/ui';
import { Handle, type NodeProps, Position } from '@xyflow/react';
import {
+ Check,
ChevronLeft,
ChevronRight,
CircleCheck,
@@ -300,8 +301,10 @@ const styles = createStaticStyles(({ css }) => ({
square: css`
cursor: default;
- display: inline-block;
+ display: inline-flex;
flex: none;
+ align-items: center;
+ justify-content: center;
width: ${BATCH_SQUARE}px;
height: ${BATCH_SQUARE}px;
@@ -462,15 +465,33 @@ const GroupShell = memo<{
GroupShell.displayName = 'GoalBatchGroupShell';
+/**
+ * Drawn at the square's own size and scaled about its centre: the glyph's box
+ * is centred in its 24-unit frame, so the tick lands in the middle of the
+ * square. A smaller icon box rounded to whole pixels and rendered off-centre.
+ */
+const AcceptedTick = () => (
+ <Check
+ data-accepted-tick
+ color={cssVar.colorBgContainer}
+ size={BATCH_SQUARE}
+ strokeWidth={3.5}
+ style={{ display: 'block', flex: 'none', transform: 'scale(0.78)' }}
+ />
+);
+
export const Square = memo<{
+ /** Done and signed off: the square carries a check. */
+ accepted?: boolean;
onSelect?: (nodeId: string) => void;
nodeId?: string;
state: BatchCellState;
tooltip: string;
-}>(({ nodeId, onSelect, state, tooltip }) => (
+}>(({ accepted, nodeId, onSelect, state, tooltip }) => (
<Tooltip title={tooltip}>
<button
aria-label={tooltip}
+ data-accepted={accepted || undefined}
data-state={state}
style={squareStyle(state)}
type="button"
@@ -484,7 +505,9 @@ export const Square = memo<{
event.stopPropagation();
if (nodeId) onSelect?.(nodeId);
}}
- />
+ >
+ {accepted && <AcceptedTick />}
+ </button>
</Tooltip>
));
@@ -492,7 +515,7 @@ Square.displayName = 'GoalBatchSquare';
const useCellLabel = () => {
const { t } = useTranslation('chat');
- return (state: BatchCellState) => t(`goalBatch.cell.${state}` as const);
+ return (state: BatchCellState | 'accepted') => t(`goalBatch.cell.${state}` as const);
};
/** One group status from its units: a person first, then progress. */
@@ -546,6 +569,12 @@ const SquareLegend = memo(() => {
{label(state)}
</Flexbox>
))}
+ <Flexbox horizontal align={'center'} gap={6}>
+ <span className={styles.square} style={squareStyle('done')}>
+ <AcceptedTick />
+ </span>
+ {label('accepted')}
+ </Flexbox>
</Flexbox>
);
});
@@ -776,13 +805,14 @@ const WaveRows = memo<{
<Flexbox horizontal gap={BATCH_SQUARE_GAP}>
{cells.map((cell) => (
<Square
+ accepted={cell.accepted}
key={cell.index}
nodeId={cell.nodeId}
state={cell.state}
tooltip={[
t('goalBatch.cell.tooltip', {
index: cell.index + 1,
- state: label(cell.state),
+ state: label(cell.accepted ? 'accepted' : cell.state),
title: cell.title,
wave: wave + 1,
}),
@@ -901,10 +931,15 @@ export const BatchWavesGroup = memo<NodeProps>(({ data }) => {
<Flexbox horizontal gap={BATCH_SQUARE_GAP}>
{row.probes.map((probe) => (
<Square
+ accepted={probe.accepted}
key={probe.nodeId}
nodeId={probe.nodeId}
state={probe.state}
- tooltip={[probe.title, originCopy(probe.from), label(probe.state)]
+ tooltip={[
+ probe.title,
+ originCopy(probe.from),
+ label(probe.accepted ? 'accepted' : probe.state),
+ ]
.filter(Boolean)
.join(' · ')}
onSelect={onSelect}
diff --git a/src/features/AgentGoals/ProcessControl/Graph/batchModel.test.ts b/src/features/AgentGoals/ProcessControl/Graph/batchModel.test.ts
index 9c57eb48d5f..8d63c0b6d4d 100644
--- a/src/features/AgentGoals/ProcessControl/Graph/batchModel.test.ts
+++ b/src/features/AgentGoals/ProcessControl/Graph/batchModel.test.ts
@@ -694,6 +694,39 @@ describe('buildBatchModel roster', () => {
});
});
+describe('buildBatchModel acceptance', () => {
+ it('marks a done unit whose acceptance was signed off, and only that one', () => {
+ const graph = buildGoalGraphView(
+ {
+ ...batchSnapshot({
+ extraNodes: [
+ node('m3', 'task', 10, { status: 'resolved', title: 'U3' }),
+ node('m4', 'task', 11, { status: 'resolved', title: 'U4' }),
+ node('m5', 'task', 12, { status: 'active', title: 'U5' }),
+ ],
+ state: { massNodeIds: ['m3', 'm4', 'm5'] },
+ }),
+ acceptances: {
+ m3: { id: 'acc-3', status: 'accepted' },
+ m4: { id: 'acc-4', status: 'passed' },
+ m5: { id: 'acc-5', status: 'accepted' },
+ p1: { id: 'acc-p1', status: 'accepted' },
+ },
+ },
+ NOW,
+ );
+ const model = buildBatchModel(graph, 'batch');
+
+ expect(model.waves[0][0]).toMatchObject({ accepted: true, state: 'done', title: 'U3' });
+ expect(model.waves[0][1]).not.toHaveProperty('accepted');
+ // Signed off ahead of its run settling is not a finished square.
+ expect(model.waves[0][2]).not.toHaveProperty('accepted');
+ expect(model.rounds[0].probes.find((probe) => probe.nodeId === 'p1')).toMatchObject({
+ accepted: true,
+ });
+ });
+});
+
describe('batchPlanTitleKey', () => {
const round = { forked: false, revision: 2 } as any;
diff --git a/src/features/AgentGoals/ProcessControl/Graph/batchModel.ts b/src/features/AgentGoals/ProcessControl/Graph/batchModel.ts
index 098f85f7a6c..c01b4667b39 100644
--- a/src/features/AgentGoals/ProcessControl/Graph/batchModel.ts
+++ b/src/features/AgentGoals/ProcessControl/Graph/batchModel.ts
@@ -33,6 +33,8 @@ import { type GoalGraphView, type GoalNodeView, isRunningNode } from '../goalGra
export type BatchCellState = 'backlog' | 'running' | 'human' | 'done' | 'stale';
export interface BatchCell {
+ /** Done, and its delivery's Acceptance was signed off. */
+ accepted?: true;
/** 0-based position inside its wave. */
index: number;
/** The node that delivers this unit on the main roster, once released. */
@@ -54,6 +56,8 @@ export type BatchUnitOrigin =
| { index: number; kind: 'wave'; wave: number };
export interface BatchProbe {
+ /** Done, and its delivery's Acceptance was signed off. */
+ accepted?: true;
/** Which run of the unit this is, when it was sent back and run again in the round (2, 3…). */
attempt?: number;
from?: BatchUnitOrigin;
@@ -181,6 +185,11 @@ export const buildBatchModel = (graph: GoalGraphView, batchId: string): BatchMod
);
const cellOf = (id?: string): BatchCellState =>
id && superseded.has(id) ? 'stale' : batchCellState(id ? graph.byId[id] : undefined, waitingOn);
+ // A done square whose delivery a person signed off carries the mark of it.
+ const acceptedOf = (id?: string) =>
+ id && cellOf(id) === 'done' && graph.byId[id]?.acceptance?.status === 'accepted'
+ ? { accepted: true as const }
+ : undefined;
const templates = members.filter(
(view) => view.node.kind === 'finding' && view.node.title === GOAL_BATCH_TEMPLATE_TITLE,
@@ -259,6 +268,7 @@ export const buildBatchModel = (graph: GoalGraphView, batchId: string): BatchMod
(waves[wave] ??= []).push(
main
? {
+ ...(!later && acceptedOf(main.node.id)),
index,
nodeId: main.node.id,
reopenedIn: laterRound,
@@ -268,6 +278,7 @@ export const buildBatchModel = (graph: GoalGraphView, batchId: string): BatchMod
wave,
}
: {
+ ...acceptedOf(later?.node.id),
index,
// Never released here: the square follows the round that runs it.
nodeId: later?.node.id,
@@ -371,6 +382,7 @@ export const buildBatchModel = (graph: GoalGraphView, batchId: string): BatchMod
state: batchCellState(graph.byId[id], waitingOn),
})),
}),
+ ...acceptedOf(view.node.id),
from: r > 0 ? originOf(view) : undefined,
nodeId: view.node.id,
state: cellOf(view.node.id),
diff --git a/src/features/AgentTasks/AgentTaskDetail/TaskAcceptance.test.tsx b/src/features/AgentTasks/AgentTaskDetail/TaskAcceptance.test.tsx
index 595d3af7f16..f79027756b3 100644
--- a/src/features/AgentTasks/AgentTaskDetail/TaskAcceptance.test.tsx
+++ b/src/features/AgentTasks/AgentTaskDetail/TaskAcceptance.test.tsx
@@ -17,7 +17,7 @@ const mocks = vi.hoisted(() => ({
bundle: undefined as
| undefined
| {
- acceptance: { id: string; requirement: string };
+ acceptance: { completedAt?: string; id: string; requirement: string; status?: string };
checks: Array<{
category: string;
id: string;
@@ -120,8 +120,11 @@ vi.mock('@/features/Acceptance/Viewer/AcceptanceScope', () => ({
}));
vi.mock('@/features/Acceptance/Viewer/Checks/AcceptanceCheckInventory', () => ({
- default: ({ toolbar }: { toolbar?: ReactNode }) => (
- <div data-testid="acceptance-check-inventory">{toolbar}</div>
+ default: ({ titleExtra, toolbar }: { titleExtra?: ReactNode; toolbar?: ReactNode }) => (
+ <div data-testid="acceptance-check-inventory">
+ {titleExtra}
+ {toolbar}
+ </div>
),
}));
@@ -302,6 +305,25 @@ describe('TaskAcceptance', () => {
expect(screen.queryByText('taskDetail.acceptance.title')).not.toBeInTheDocument();
});
+ it('moves a signed-off verdict into the checklist title and drops the decision bar', () => {
+ mocks.acceptanceSubject = { id: 'acceptance-1' };
+ mocks.bundle = {
+ acceptance: {
+ completedAt: '2026-11-10T10:50:00.000Z',
+ id: 'acceptance-1',
+ requirement: 'Everything is verifiable.',
+ status: 'accepted',
+ },
+ checks: [{ category: 'Setup', id: 'c1', seq: 1, title: 'Create task' }],
+ isOwner: true,
+ };
+
+ render(<TaskAcceptance variant={'result'} />);
+
+ expect(screen.getByText('taskDetail.acceptanceState.accepted')).toBeInTheDocument();
+ expect(screen.queryByTestId('acceptance-decision')).not.toBeInTheDocument();
+ });
+
it('keeps the report link reachable from the inventory toolbar in the result panel', () => {
mocks.acceptanceSubject = { id: 'acceptance-1' };
mocks.bundle = {
diff --git a/src/features/AgentTasks/AgentTaskDetail/TaskAcceptance.tsx b/src/features/AgentTasks/AgentTaskDetail/TaskAcceptance.tsx
index fdcda592069..deb45d2ab06 100644
--- a/src/features/AgentTasks/AgentTaskDetail/TaskAcceptance.tsx
+++ b/src/features/AgentTasks/AgentTaskDetail/TaskAcceptance.tsx
@@ -10,8 +10,11 @@ import {
Icon,
Spin,
Text,
+ Tooltip,
} from '@lobehub/ui';
+import dayjs from 'dayjs';
import {
+ BadgeCheck,
ChevronRight,
ChevronsDownUp,
ChevronsUpDown,
@@ -254,12 +257,32 @@ const TaskAcceptance = memo<TaskAcceptanceProps>(({ variant = 'default' }) => {
// through the acceptance page. Its own 验收检查清单 header replaces the
// section header; the report link rides in the inventory toolbar.
if (variant === 'result' && acceptanceSubject && !subjectError) {
+ // Signed off is finished: the verdict moves up beside the title, and the
+ // decision bar — which has nothing left to offer — stops covering the
+ // evidence below it.
+ const accepted = bundle?.acceptance.status === 'accepted';
+ const acceptedAt = accepted ? bundle?.acceptance.completedAt : undefined;
+ const acceptedBadge = accepted && (
+ <Tooltip
+ title={t('acceptance.banner.accepted', {
+ ns: 'verify',
+ time: acceptedAt ? dayjs(acceptedAt).format('YYYY-MM-DD HH:mm') : '',
+ })}
+ >
+ <Flexbox data-task-acceptance-accepted horizontal align={'center'} gap={4}>
+ <Icon color={cssVar.colorSuccess} icon={BadgeCheck} size={14} />
+ <Text fontSize={12} style={{ color: cssVar.colorSuccess, whiteSpace: 'nowrap' }}>
+ {t('taskDetail.acceptanceState.accepted')}
+ </Text>
+ </Flexbox>
+ </Tooltip>
+ );
return (
<AcceptanceScope embedded acceptanceId={acceptanceSubject.id}>
<AcceptanceBundleGate height={160}>
<Flexbox gap={16}>
- <AcceptanceCheckInventory toolbar={reportButton} />
- <AcceptanceDecision />
+ <AcceptanceCheckInventory titleExtra={acceptedBadge} toolbar={reportButton} />
+ {!accepted && <AcceptanceDecision />}
</Flexbox>
</AcceptanceBundleGate>
</AcceptanceScope>