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): simplify checklist presentation (#17650)

Arvin Xu4d11af23e9c0
diff --git a/.agents/acceptance/probe-mock-patterns.md b/.agents/acceptance/probe-mock-patterns.md
index e1df8d8e2e3..5d65eaf6cc9 100644
--- a/.agents/acceptance/probe-mock-patterns.md
+++ b/.agents/acceptance/probe-mock-patterns.md
@@ -156,6 +156,22 @@ adding or moving a module, then re-probe. Confirm the new code is live by a
structural signal (a renamed component in the fiber chain, a new class in the
computed cascade) before concluding anything about behavior.
+### Production debug proxy stays on the development loading shell in an isolated browser
+
+**Situation:** verifying a public SPA route with local frontend code against the
+production backend through `/_dangerous_local_dev_proxy`.
+
+**Doesn't work:** treating a successful Vite connection or the route's debug ID
+as proof that the product page loaded. In a fresh, signed-out automation context,
+the proxy can remain on the development loading shell without a useful page error;
+its screenshot is blank except for the debug marker.
+
+**Works:** visually reject the loading-shell screenshot, then use the adapter's
+isolated local full stack. Seed the test user, ingest a representative public
+Acceptance fixture through the local CLI, and capture the same route in separate
+authenticated and storage-empty browser contexts. This proves both owner and
+shared-viewer rendering without depending on production browser cookies.
+
### Reading a transitioned CSS property immediately after focus/hover
**Situation:** asserting that a `:focus-within` / `:hover` rule reveals a
diff --git a/apps/server/src/routers/lambda/acceptance.ts b/apps/server/src/routers/lambda/acceptance.ts
index a85cebfb5f4..8a175a2a9fd 100644
--- a/apps/server/src/routers/lambda/acceptance.ts
+++ b/apps/server/src/routers/lambda/acceptance.ts
@@ -603,7 +603,7 @@ export const acceptanceRouter = router({
/**
* Manually move the acceptance's user-facing lifecycle state from the list —
- * an owner override (mark accepted / rejected, or reopen for another look).
+ * an owner override (mark accepted / closed / rejected, or reopen for another look).
*
* accept / reject go through the SERVICE, never a bare status write: the
* service applies `requireDecidableAcceptance` (a premature `accepted` is
@@ -613,7 +613,12 @@ export const acceptanceRouter = router({
* not be forced back to a decision-pending state by hand.
*/
updateStatus: acceptanceWriteProcedure
- .input(z.object({ id: z.string(), status: z.enum(['delivered', 'accepted', 'rejected']) }))
+ .input(
+ z.object({
+ id: z.string(),
+ status: z.enum(['delivered', 'accepted', 'closed', 'rejected']),
+ }),
+ )
.mutation(async ({ ctx, input }) => {
const acceptance = await resolveAcceptance(ctx, input.id);
assertWorkspaceRowManageable(ctx, acceptance.userId, 'acceptance');
@@ -621,6 +626,8 @@ export const acceptanceRouter = router({
try {
if (input.status === 'accepted') {
await ctx.acceptanceService.accept(acceptance.id);
+ } else if (input.status === 'closed') {
+ await ctx.acceptanceService.acceptanceModel.updateStatus(acceptance.id, 'closed');
} else if (input.status === 'rejected') {
await ctx.acceptanceService.reject(
acceptance.id,
@@ -629,7 +636,11 @@ export const acceptanceRouter = router({
} else {
// Reopen (→ delivered): only a decided aggregate can be re-opened; a
// live round recomputes its own status and must not be clobbered.
- if (acceptance.status !== 'accepted' && acceptance.status !== 'rejected') {
+ if (
+ acceptance.status !== 'accepted' &&
+ acceptance.status !== 'closed' &&
+ acceptance.status !== 'rejected'
+ ) {
throw new TRPCError({
code: 'BAD_REQUEST',
message: `Only a decided acceptance can be reopened (status: ${acceptance.status})`,
diff --git a/apps/server/src/services/verify/__tests__/acceptanceDecision.test.ts b/apps/server/src/services/verify/__tests__/acceptanceDecision.test.ts
index 740156aac11..338fd1d6a74 100644
--- a/apps/server/src/services/verify/__tests__/acceptanceDecision.test.ts
+++ b/apps/server/src/services/verify/__tests__/acceptanceDecision.test.ts
@@ -68,6 +68,14 @@ describe('AcceptanceService decision gating', () => {
expect(mocks.setDecision).not.toHaveBeenCalled();
});
+ it('keeps a manually closed acceptance terminal during status recomputation', async () => {
+ mocks.findById.mockResolvedValue(acceptance('closed'));
+
+ await expect(service().recomputeStatus('acc-1')).resolves.toBe('closed');
+ expect(mocks.listByAcceptance).not.toHaveBeenCalled();
+ expect(mocks.updateStatus).not.toHaveBeenCalled();
+ });
+
it.each(['delivered', 'errored'])('accepts a settled (%s) delivery', async (status) => {
mocks.findById.mockResolvedValue(acceptance(status));
diff --git a/apps/server/src/services/verify/acceptanceService.ts b/apps/server/src/services/verify/acceptanceService.ts
index ec159986404..5c9da24a92c 100644
--- a/apps/server/src/services/verify/acceptanceService.ts
+++ b/apps/server/src/services/verify/acceptanceService.ts
@@ -491,13 +491,15 @@ export class AcceptanceService {
/**
* Re-derive the aggregate's lifecycle state from its current round. The
- * user's `accepted` is terminal; `rejected` is sticky until a round newer
- * than the decision arrives.
+ * user's `accepted` / `closed` are terminal; `rejected` is sticky until a
+ * round newer than the decision arrives.
*/
recomputeStatus = async (acceptanceId: string): Promise<AcceptanceStatus | null> => {
const acceptance = await this.acceptanceModel.findById(acceptanceId);
if (!acceptance) return null;
- if (acceptance.status === 'accepted') return 'accepted';
+ if (acceptance.status === 'accepted' || acceptance.status === 'closed') {
+ return acceptance.status;
+ }
const runs = await this.runModel.listByAcceptance(acceptanceId);
const current = runs.at(-1);
@@ -650,6 +652,9 @@ export class AcceptanceService {
if (acceptance.status === 'accepted') {
throw new Error('This delivery has already been accepted');
}
+ if (acceptance.status === 'closed') {
+ throw new Error('This acceptance is closed — reopen it before making a decision');
+ }
if (acceptance.status === 'rejected') {
throw new Error('This delivery was rejected — the next verification round re-opens it');
}
diff --git a/locales/en-US/verify.json b/locales/en-US/verify.json
index 2fd49a2000b..a1559190e25 100644
--- a/locales/en-US/verify.json
+++ b/locales/en-US/verify.json
@@ -190,6 +190,7 @@
"acceptance.stats.passed": "{{count}} passed",
"acceptance.stats.uncertain": "{{count}} uncertain",
"acceptance.status.accepted": "Delivery accepted",
+ "acceptance.status.closed": "Acceptance closed",
"acceptance.status.delivered": "Ready for your decision",
"acceptance.status.errored": "Verification could not run",
"acceptance.status.failed": "Verification failed",
@@ -234,11 +235,12 @@
"acceptance.viewFullReport": "View full report",
"acceptance.workspace.actions.delete": "Delete",
"acceptance.workspace.actions.markAccepted": "Mark as accepted",
+ "acceptance.workspace.actions.markClosed": "Mark as closed",
"acceptance.workspace.actions.markRejected": "Mark as rejected",
"acceptance.workspace.actions.more": "More actions",
"acceptance.workspace.actions.rename": "Rename",
"acceptance.workspace.actions.reopen": "Reopen for review",
- "acceptance.workspace.actions.status": "Change status",
+ "acceptance.workspace.actions.status": "Status",
"acceptance.workspace.checkCount": "{{count}} checks",
"acceptance.workspace.deleteConfirmDescription": "Delete the acceptance “{{title}}”? Its verification rounds are kept — they detach into standalone reports.",
"acceptance.workspace.deleteConfirmTitle": "Delete acceptance",
diff --git a/locales/zh-CN/verify.json b/locales/zh-CN/verify.json
index 7369d52b567..b45b3952847 100644
--- a/locales/zh-CN/verify.json
+++ b/locales/zh-CN/verify.json
@@ -190,6 +190,7 @@
"acceptance.stats.passed": "{{count}} 通过",
"acceptance.stats.uncertain": "{{count}} 不确定",
"acceptance.status.accepted": "交付已接受",
+ "acceptance.status.closed": "验收已关闭",
"acceptance.status.delivered": "等待你的决定",
"acceptance.status.errored": "验证未能运行",
"acceptance.status.failed": "验证未通过",
@@ -234,11 +235,12 @@
"acceptance.viewFullReport": "查看完整报告",
"acceptance.workspace.actions.delete": "删除",
"acceptance.workspace.actions.markAccepted": "标记为已验收",
+ "acceptance.workspace.actions.markClosed": "标记为关闭",
"acceptance.workspace.actions.markRejected": "标记为已打回",
"acceptance.workspace.actions.more": "更多操作",
"acceptance.workspace.actions.rename": "重命名",
"acceptance.workspace.actions.reopen": "重新打开验收",
- "acceptance.workspace.actions.status": "修改状态",
+ "acceptance.workspace.actions.status": "状态",
"acceptance.workspace.checkCount": "{{count}} 项验收项",
"acceptance.workspace.deleteConfirmDescription": "确定删除验收「{{title}}」吗?各轮验证记录会保留,并拆分为独立的报告。",
"acceptance.workspace.deleteConfirmTitle": "删除验收",
diff --git a/packages/const/src/verify.ts b/packages/const/src/verify.ts
index a8cf0914bbb..9ab0f3df3e5 100644
--- a/packages/const/src/verify.ts
+++ b/packages/const/src/verify.ts
@@ -159,6 +159,7 @@ export const acceptanceStatuses = [
// recommendation either way.
'delivered',
'accepted',
+ 'closed',
'rejected',
'errored',
] as const;
diff --git a/packages/database/src/models/__tests__/acceptance.test.ts b/packages/database/src/models/__tests__/acceptance.test.ts
index ccfb379d778..0636a312a4b 100644
--- a/packages/database/src/models/__tests__/acceptance.test.ts
+++ b/packages/database/src/models/__tests__/acceptance.test.ts
@@ -103,6 +103,9 @@ describe('AcceptanceModel', () => {
await model.updateStatus(row.id, 'accepted');
expect((await model.findById(row.id))?.completedAt).toBeInstanceOf(Date);
+ await model.updateStatus(row.id, 'closed');
+ expect((await model.findById(row.id))?.completedAt).toBeInstanceOf(Date);
+
// A new round re-opening the loop clears the completion stamp.
await model.updateStatus(row.id, 'verifying');
expect((await model.findById(row.id))?.completedAt).toBeNull();
diff --git a/packages/database/src/models/acceptance.ts b/packages/database/src/models/acceptance.ts
index ad8989158eb..41f7a3af984 100644
--- a/packages/database/src/models/acceptance.ts
+++ b/packages/database/src/models/acceptance.ts
@@ -7,8 +7,8 @@ import type { LobeChatDatabase } from '../type';
import { isUuid } from '../utils/uuid';
import { buildWorkspacePayload, buildWorkspaceWhere } from '../utils/workspace';
-/** Statuses a user's decision produced — sticky until a new round re-opens the loop. */
-const TERMINAL_ACCEPTANCE_STATUSES = new Set<AcceptanceStatus>(['accepted', 'rejected']);
+/** Statuses a user's decision produced — sticky until explicitly re-opened. */
+const TERMINAL_ACCEPTANCE_STATUSES = new Set<AcceptanceStatus>(['accepted', 'closed', 'rejected']);
/**
* Owns the business-level acceptance aggregate (`acceptances`): one row per
@@ -140,7 +140,7 @@ export class AcceptanceModel {
/**
* Move the user-facing lifecycle state. `completedAt` is stamped when the
- * user's decision closes the loop (accepted / rejected) and cleared when a
+ * user's decision closes the loop (accepted / closed / rejected) and cleared when a
* new round re-opens it.
*/
updateStatus = async (id: string, status: AcceptanceStatus): Promise<void> => {
diff --git a/packages/locales/src/default/verify.ts b/packages/locales/src/default/verify.ts
index c5461104254..45abe8f2fa4 100644
--- a/packages/locales/src/default/verify.ts
+++ b/packages/locales/src/default/verify.ts
@@ -218,6 +218,7 @@ export default {
'acceptance.stats.passed': '{{count}} passed',
'acceptance.stats.uncertain': '{{count}} uncertain',
'acceptance.status.accepted': 'Delivery accepted',
+ 'acceptance.status.closed': 'Acceptance closed',
'acceptance.status.delivered': 'Ready for your decision',
'acceptance.status.errored': 'Verification could not run',
'acceptance.status.failed': 'Verification failed',
@@ -265,11 +266,12 @@ export default {
'acceptance.viewFullReport': 'View full report',
'acceptance.workspace.actions.delete': 'Delete',
'acceptance.workspace.actions.markAccepted': 'Mark as accepted',
+ 'acceptance.workspace.actions.markClosed': 'Mark as closed',
'acceptance.workspace.actions.markRejected': 'Mark as rejected',
'acceptance.workspace.actions.more': 'More actions',
'acceptance.workspace.actions.rename': 'Rename',
'acceptance.workspace.actions.reopen': 'Reopen for review',
- 'acceptance.workspace.actions.status': 'Change status',
+ 'acceptance.workspace.actions.status': 'Status',
'acceptance.workspace.checkCount': '{{count}} checks',
'acceptance.workspace.deleteConfirmDescription':
'Delete the acceptance “{{title}}”? Its verification rounds are kept — they detach into standalone reports.',
diff --git a/packages/types/src/verify.ts b/packages/types/src/verify.ts
index adf0589f750..1afec93197f 100644
--- a/packages/types/src/verify.ts
+++ b/packages/types/src/verify.ts
@@ -54,7 +54,9 @@ export type AcceptanceSubjectType = 'task' | 'topic' | 'document';
/**
* Business-level acceptance state. Check-level and run-level verdicts stay in the
* verify vocabulary (`passed` / `failed`); the aggregate exposes the user's
- * outcome language (`accepted` / `rejected`).
+ * outcome language (`accepted` / `rejected`). `closed` is a reversible archive
+ * state for an acceptance that is no longer needed; unlike `accepted`, it does
+ * not record a positive delivery decision.
*
* `delivered`: verification settled (passed OR failed) and the aggregate now
* waits for the user's accept/reject — the human decision closes the lifecycle,
@@ -67,6 +69,7 @@ export type AcceptanceStatus =
| 'repairing'
| 'delivered'
| 'accepted'
+ | 'closed'
| 'rejected'
| 'errored';
diff --git a/src/features/Verify/Acceptance/CheckList.test.ts b/src/features/Verify/Acceptance/CheckList.test.ts
index 9e185300227..0dec2325f55 100644
--- a/src/features/Verify/Acceptance/CheckList.test.ts
+++ b/src/features/Verify/Acceptance/CheckList.test.ts
@@ -5,6 +5,7 @@ import {
checkFilterState,
focusedCheckStates,
groupChecks,
+ shouldGroupChecks,
userReviewState,
} from './CheckList';
@@ -47,6 +48,17 @@ describe('groupChecks', () => {
});
});
+describe('shouldGroupChecks', () => {
+ it('keeps checklists with 10 or fewer items flat', () => {
+ expect(shouldGroupChecks(9)).toBe(false);
+ expect(shouldGroupChecks(10)).toBe(false);
+ });
+
+ it('groups checklists only after they exceed 10 items', () => {
+ expect(shouldGroupChecks(11)).toBe(true);
+ });
+});
+
describe('userReviewState', () => {
const withReview = (userReview: AcceptanceCheck['userReview']) =>
({ userReview }) as AcceptanceCheck;
diff --git a/src/features/Verify/Acceptance/CheckList.tsx b/src/features/Verify/Acceptance/CheckList.tsx
index 36e4fb7fa84..869a03cb623 100644
--- a/src/features/Verify/Acceptance/CheckList.tsx
+++ b/src/features/Verify/Acceptance/CheckList.tsx
@@ -65,6 +65,11 @@ export type AcceptanceCheckState = AcceptanceCheck['state'];
type AcceptanceEvidence = AcceptanceCheck['evidence'][number];
type AcceptanceCheckReviewEntry = AcceptanceCheck['reviews'][number];
+export const CHECK_GROUPING_THRESHOLD = 10;
+
+/** Small checklists stay flat; grouping only earns its hierarchy once the list grows beyond 10. */
+export const shouldGroupChecks = (checkCount: number) => checkCount > CHECK_GROUPING_THRESHOLD;
+
/** What the user asked the page to record — the page owns the service call. */
export interface CheckReviewInput {
action: 'accept' | 'ignore' | 'reject';
@@ -623,7 +628,7 @@ const IterationTimeline = memo<{
check: AcceptanceCheck;
evidenceById: Map<string, AcceptanceEvidence>;
historyReviews: AcceptanceCheckReviewEntry[];
- onRound: (round: number) => void;
+ onRound?: (round: number) => void;
}>(({ check, evidenceById, historyReviews, onRound }) => {
const { t } = useTranslation('verify');
@@ -702,15 +707,21 @@ const IterationTimeline = memo<{
{!isLast && <div className={styles.stepRail} />}
</Flexbox>
<Flexbox flex={1} gap={6} style={{ minWidth: 0, paddingBlockEnd: isLast ? 0 : 20 }}>
- <Tooltip title={t('acceptance.history.jump', { round: step.roundIndex })}>
- <Text
- strong
- style={{ cursor: 'pointer', fontSize: 12, lineHeight: '19px' }}
- onClick={() => onRound(step.roundIndex)}
- >
+ {onRound ? (
+ <Tooltip title={t('acceptance.history.jump', { round: step.roundIndex })}>
+ <Text
+ strong
+ style={{ cursor: 'pointer', fontSize: 12, lineHeight: '19px' }}
+ onClick={() => onRound(step.roundIndex)}
+ >
+ {t('acceptance.round', { round: step.roundIndex })}
+ </Text>
+ </Tooltip>
+ ) : (
+ <Text strong style={{ fontSize: 12, lineHeight: '19px' }}>
{t('acceptance.round', { round: step.roundIndex })}
</Text>
- </Tooltip>
+ )}
<Text style={{ fontSize: 12 }}>{step.title}</Text>
{step.evidence.length > 0 && (
<Flexbox horizontal gap={8} wrap={'wrap'}>
@@ -761,7 +772,7 @@ const CheckRow = memo<{
detailMode?: boolean;
expanded: boolean;
onReview: (input: CheckReviewInput) => Promise<boolean>;
- onRound: (round: number) => void;
+ onRound?: (round: number) => void;
onToggle: () => void;
reviewPending: boolean;
}>(({ canReview, check, detailMode, expanded, onReview, onRound, onToggle, reviewPending }) => {
@@ -998,7 +1009,7 @@ const CheckRow = memo<{
{/* The iteration mark stays compact — [↻ N]; the words (verified N
rounds · introduced in round X) live in its tooltip. Clicking
jumps to the round the concern first appeared in. */}
- {check.revisions > 1 && (
+ {onRound && check.revisions > 1 && (
<Tooltip
title={[
check.titleChanged
@@ -1024,7 +1035,7 @@ const CheckRow = memo<{
</span>
</Tooltip>
)}
- {check.resultRound !== undefined && check.resultRound !== null && (
+ {onRound && check.resultRound !== undefined && check.resultRound !== null && (
<Tooltip title={t('acceptance.checks.finalRoundHint')}>
<span
className={cx(styles.chip, styles.chipClickable)}
@@ -1287,7 +1298,7 @@ interface FocusedCheckDetailsProps {
canReview: boolean;
check: AcceptanceCheck;
onReview: (input: CheckReviewInput) => Promise<boolean>;
- onRound: (round: number) => void;
+ onRound?: (round: number) => void;
reviewPending: boolean;
}
@@ -1381,7 +1392,7 @@ interface CheckListProps {
onGroupFeedback: (category: string, comment: string, fileIds: string[]) => Promise<boolean>;
/** Record the user's verdict; resolves true when the write landed. */
onReview: (input: CheckReviewInput) => Promise<boolean>;
- onRound: (round: number) => void;
+ onRound?: (round: number) => void;
onToggleGroup: (key: string) => void;
onToggleGroupItems: (ids: string[], open: boolean) => void;
onToggleItem: (id: string) => void;
@@ -1418,6 +1429,14 @@ const CheckList = memo<CheckListProps>(
round === undefined ||
check.timeline.some((step) => step.roundIndex === round));
+ const visibleRows = checks
+ .filter(visible)
+ .sort(
+ (a, b) =>
+ SEVERITY[a.state] - SEVERITY[b.state] ||
+ (hasVisualEvidence(b) ? 1 : 0) - (hasVisualEvidence(a) ? 1 : 0) ||
+ a.introducedAtRound - b.introducedAtRound,
+ );
const groups = groupChecks(checks, t('acceptance.group.uncategorized'))
.map((group) => ({
...group,
@@ -1436,7 +1455,7 @@ const CheckList = memo<CheckListProps>(
// a blank bordered card — each filter gets its own reassuring line. But an
// EMPTY pending bucket where every check is signed off isn't "nothing here"
// — it's the finish line, so it earns a celebration instead of a flat line.
- if (groups.length === 0) {
+ if (visibleRows.length === 0) {
const allAccepted = filter === 'pending' && isGroupFullyAccepted(checks);
return (
<Flexbox align={'center'} className={styles.emptyCard} gap={12} justify={'center'}>
@@ -1471,6 +1490,25 @@ const CheckList = memo<CheckListProps>(
);
}
+ if (!shouldGroupChecks(checks.length)) {
+ return (
+ <Flexbox className={styles.groupCard}>
+ {visibleRows.map((check) => (
+ <CheckRow
+ canReview={canReview}
+ check={check}
+ expanded={expanded.has(check.id)}
+ key={check.id}
+ reviewPending={reviewPending}
+ onReview={onReview}
+ onRound={onRound}
+ onToggle={() => onToggleItem(check.id)}
+ />
+ ))}
+ </Flexbox>
+ );
+ }
+
return (
<Flexbox className={styles.groupCard}>
{groups.map(({ checks: groupChecks_, key, label, rows }, groupIndex) => {
@@ -1704,27 +1742,6 @@ 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. Labeled:
- a bare icon at this distance from the header reads as noise. */}
- {!collapsed && (
- <Flexbox
- align={'center'}
- paddingBlock={4}
- style={{ borderBlockStart: `1px solid ${cssVar.colorBorderSecondary}` }}
- >
- <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)}
- >
- {t('acceptance.group.collapse', { label })}
- </Button>
- </Flexbox>
- )}
</Fragment>
);
})}
diff --git a/src/features/Verify/Acceptance/Workspace/AcceptanceListPanel.tsx b/src/features/Verify/Acceptance/Workspace/AcceptanceListPanel.tsx
index b1e4aff5040..f6249c48430 100644
--- a/src/features/Verify/Acceptance/Workspace/AcceptanceListPanel.tsx
+++ b/src/features/Verify/Acceptance/Workspace/AcceptanceListPanel.tsx
@@ -37,6 +37,7 @@ import {
Search,
Trash2,
TriangleAlert,
+ X,
} from 'lucide-react';
import { memo, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
@@ -54,6 +55,7 @@ import { systemStatusSelectors } from '@/store/global/selectors';
import { useAcceptanceList } from '../../hooks';
import type { ReportPanelExpand } from '../../Workspace/useReportPanelExpand';
+import { getAcceptanceStatusActions } from '../statusActions';
import {
type AcceptanceListFilter,
DEFAULT_ACCEPTANCE_LIST_FILTER,
@@ -245,7 +247,7 @@ const styles = createStaticStyles(({ css }) => ({
`,
}));
-type Glyph = 'awaiting' | 'bad' | 'unsure' | 'running' | 'repairing' | 'accepted';
+type Glyph = 'accepted' | 'awaiting' | 'bad' | 'closed' | 'repairing' | 'running' | 'unsure';
const RUNNING_STATUSES = new Set<AcceptanceStatus>([
'pending',
@@ -260,6 +262,7 @@ const glyphOf = (status: AcceptanceStatus): Glyph => {
if (status === 'repairing') return 'repairing';
if (RUNNING_STATUSES.has(status)) return 'running';
if (status === 'accepted') return 'accepted';
+ if (status === 'closed') return 'closed';
if (status === 'rejected') return 'bad';
if (status === 'errored') return 'unsure';
return 'awaiting';
@@ -274,6 +277,7 @@ const glyphMeta: Record<Glyph, { color: string; icon: typeof BadgeCheck }> = {
accepted: { color: cssVar.colorSuccess, icon: BadgeCheck },
awaiting: { color: cssVar.colorInfo, icon: CircleDashed },
bad: { color: cssVar.colorError, icon: CircleX },
+ closed: { color: cssVar.colorTextTertiary, icon: X },
repairing: { color: cssVar.colorWarning, icon: RefreshCw },
running: { color: cssVar.colorInfo, icon: LoaderCircle },
unsure: { color: cssVar.colorWarning, icon: CircleHelp },
@@ -352,7 +356,7 @@ const AcceptanceRow = memo<{
}
};
- const changeStatus = async (status: 'accepted' | 'delivered' | 'rejected') => {
+ const changeStatus = async (status: 'accepted' | 'closed' | 'delivered' | 'rejected') => {
setMutating(true);
try {
await verifyService.updateAcceptanceStatus(item.id, status);
@@ -390,30 +394,33 @@ const AcceptanceRow = memo<{
});
};
- // The status action follows the CURRENT state — an awaiting delivery can be
- // accepted; an already-decided one can be reopened; a still-running round
- // offers nothing (accept/reject need a settled round, matching the server
- // guard). Never "reopen" an acceptance that was never decided.
- const statusItems: DropdownItem[] =
- item.status === 'delivered' || item.status === 'errored'
- ? [
- {
- icon: <Icon icon={CircleCheck} />,
- key: 'accept',
- label: t('verify:acceptance.workspace.actions.markAccepted'),
- onClick: () => void changeStatus('accepted'),
- },
- ]
- : item.status === 'accepted' || item.status === 'rejected'
- ? [
- {
- icon: <Icon icon={RotateCcw} />,
- key: 'reopen',
- label: t('verify:acceptance.workspace.actions.reopen'),
- onClick: () => void changeStatus('delivered'),
- },
- ]
- : [];
+ // The status actions follow the CURRENT state — a settled delivery can be
+ // accepted, an already-decided one can be reopened, and any non-closed
+ // acceptance can be closed without recording a delivery verdict.
+ const statusItems: DropdownItem[] = getAcceptanceStatusActions(item.status).map((action) => {
+ if (action === 'accept') {
+ return {
+ icon: <Icon icon={CircleCheck} />,
+ key: action,
+ label: t('verify:acceptance.workspace.actions.markAccepted'),
+ onClick: () => void changeStatus('accepted'),
+ };
+ }
+ if (action === 'reopen') {
+ return {
+ icon: <Icon icon={RotateCcw} />,
+ key: action,
+ label: t('verify:acceptance.workspace.actions.reopen'),
+ onClick: () => void changeStatus('delivered'),
+ };
+ }
+ return {
+ icon: <Icon icon={X} />,
+ key: action,
+ label: t('verify:acceptance.workspace.actions.markClosed'),
+ onClick: () => void changeStatus('closed'),
+ };
+ });
const menuItems: DropdownItem[] = [
{
@@ -422,8 +429,17 @@ const AcceptanceRow = memo<{
label: t('verify:acceptance.workspace.actions.rename'),
onClick: startRename,
},
- ...statusItems,
- ...(statusItems.length > 0 ? [{ type: 'divider' as const }] : []),
+ ...(statusItems.length > 0
+ ? [
+ {
+ children: statusItems,
+ icon: <Icon icon={CircleDashed} />,
+ key: 'status',
+ label: t('verify:acceptance.workspace.actions.status'),
+ },
+ { type: 'divider' as const },
+ ]
+ : []),
{
danger: true,
icon: <Icon icon={Trash2} />,
diff --git a/src/features/Verify/Acceptance/Workspace/acceptanceListFilter.test.ts b/src/features/Verify/Acceptance/Workspace/acceptanceListFilter.test.ts
index 3a5de181178..f462441d00d 100644
--- a/src/features/Verify/Acceptance/Workspace/acceptanceListFilter.test.ts
+++ b/src/features/Verify/Acceptance/Workspace/acceptanceListFilter.test.ts
@@ -19,6 +19,7 @@ const item = (
const acceptances = [
item('active', 'delivered', 'Needs review'),
item('completed', 'accepted', 'Signed off'),
+ item('closed', 'closed', 'No longer needed'),
item('failed', 'rejected', 'Needs repair'),
];
@@ -33,6 +34,7 @@ describe('filterAcceptanceList', () => {
it('can show only completed acceptances', () => {
expect(filterAcceptanceList(acceptances, 'completed', '').map(({ id }) => id)).toEqual([
'completed',
+ 'closed',
]);
});
diff --git a/src/features/Verify/Acceptance/Workspace/acceptanceListFilter.ts b/src/features/Verify/Acceptance/Workspace/acceptanceListFilter.ts
index fcfffa3bd08..a0266561c08 100644
--- a/src/features/Verify/Acceptance/Workspace/acceptanceListFilter.ts
+++ b/src/features/Verify/Acceptance/Workspace/acceptanceListFilter.ts
@@ -17,7 +17,8 @@ export const filterAcceptanceList = (
const normalizedQuery = query.trim().toLowerCase();
return items.filter((item) => {
- const completed = (item.status as AcceptanceStatus) === 'accepted';
+ const status = item.status as AcceptanceStatus;
+ const completed = status === 'accepted' || status === 'closed';
if (filter === 'active' && completed) return false;
if (filter === 'completed' && !completed) return false;
diff --git a/src/features/Verify/Acceptance/index.tsx b/src/features/Verify/Acceptance/index.tsx
index 4255131369a..28a49113840 100644
--- a/src/features/Verify/Acceptance/index.tsx
+++ b/src/features/Verify/Acceptance/index.tsx
@@ -14,7 +14,8 @@ import {
Tag,
Text,
} from '@lobehub/ui';
-import { Button, Select, toast } from '@lobehub/ui/base-ui';
+import type { DropdownItem } from '@lobehub/ui/base-ui';
+import { Button, DropdownMenu, Select, toast } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar, cx, useResponsive } from 'antd-style';
import dayjs from 'dayjs';
import {
@@ -22,9 +23,11 @@ import {
BadgeCheck,
Ban,
Check,
+ ChevronDown,
ChevronRight,
ChevronsDownUp,
ChevronsUpDown,
+ CircleCheck,
CircleDashed,
GitBranch,
GitCommitHorizontal,
@@ -37,6 +40,7 @@ import {
Plus,
RefreshCw,
RotateCcw,
+ X,
XCircle,
} from 'lucide-react';
import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
@@ -70,15 +74,19 @@ import CheckList, {
hasVisualEvidence,
isException,
isGroupFullyAccepted,
+ shouldGroupChecks,
userReviewState,
} from './CheckList';
import DecisionBar from './DecisionBar';
import { EMPTY_ID_SET, setAggregateEntry } from './expandState';
import FeedbackDrawer, { type FeedbackListEntry } from './FeedbackDrawer';
+import { acceptanceFocusedLayout } from './layout';
import LedgerPanel, { type AcceptanceRound } from './LedgerPanel';
import { openAcceptModal, openRejectModal } from './modals';
import { acceptanceCheckPath, acceptanceOverviewPath } from './routes';
+import { getAcceptanceStatusActions } from './statusActions';
import TopicPanel from './TopicPanel';
+import { canViewAcceptanceHistory, resolveAcceptanceHistoryNavigation } from './visibility';
/**
* The hardcoded repair prompt (复制 review 建议 / 打回重跑 share it): points the
@@ -216,10 +224,18 @@ const styles = createStaticStyles(({ css }) => ({
font-size: 12px;
font-weight: 500;
`,
+ verdictPillInteractive: css`
+ cursor: pointer;
+ transition: filter ${cssVar.motionDurationMid};
+
+ &:hover {
+ filter: brightness(1.08);
+ }
+ `,
focusLayout: css`
display: grid;
grid-template-columns: 320px minmax(0, 1fr);
- min-height: 100vh;
+ min-height: ${acceptanceFocusedLayout.viewportHeight};
@media (width <= 900px) {
grid-template-columns: 1fr;
@@ -231,7 +247,7 @@ const styles = createStaticStyles(({ css }) => ({
overflow: auto;
- height: 100vh;
+ height: ${acceptanceFocusedLayout.viewportHeight};
padding: 8px;
border-inline-end: 1px solid ${cssVar.colorBorderSecondary};
@@ -246,7 +262,7 @@ const styles = createStaticStyles(({ css }) => ({
`,
focusMain: css`
min-width: 0;
- padding-block: 4px 32px;
+ padding-block: ${acceptanceFocusedLayout.contentPaddingBlock};
padding-inline: 32px;
`,
focusContent: css`
@@ -435,7 +451,9 @@ const AcceptancePage = memo<AcceptancePageProps>(
const urlRoundRaw = searchParams.get('r');
useEffect(() => {
if (isEmbedded || !data) return;
- setReportRound(resolveRoundParam(data.rounds, urlRoundRaw));
+ setReportRound(
+ canViewAcceptanceHistory(data.isOwner) ? resolveRoundParam(data.rounds, urlRoundRaw) : null,
+ );
}, [isEmbedded, data, urlRoundRaw]);
const [pending, setPending] = useState(false);
const [rerunPending, setRerunPending] = useState(false);
@@ -475,11 +493,13 @@ const AcceptancePage = memo<AcceptancePageProps>(
),
);
setCollapsedGroups(
- new Set(
- groupChecks(data.checks, t('acceptance.group.uncategorized'))
- .filter((group) => isGroupFullyAccepted(group.checks))
- .map((group) => group.key),
- ),
+ shouldGroupChecks(data.checks.length)
+ ? new Set(
+ groupChecks(data.checks, t('acceptance.group.uncategorized'))
+ .filter((group) => isGroupFullyAccepted(group.checks))
+ .map((group) => group.key),
+ )
+ : new Set(),
);
// First run (one round): nothing has been reviewed yet, so open on the whole
// list. Second round onward: the reviewer came back for what's still unsigned
@@ -544,6 +564,7 @@ const AcceptancePage = memo<AcceptancePageProps>(
);
const { acceptance, checks, isOwner, latestReport, origin, rounds, subject } = data;
+ const showHistory = canViewAcceptanceHistory(isOwner);
const originAgent = origin?.agent;
const originTopic = origin?.topic;
const focusedCheck = focusedCheckId
@@ -598,9 +619,10 @@ const AcceptancePage = memo<AcceptancePageProps>(
.find((round) => (round.run.scenario ?? 'coding') === 'coding' && round.run.context)?.run
.context as VerifyCodingScope | null | undefined;
- const groupKeys = groupChecks(checks, t('acceptance.group.uncategorized')).map(
- (group) => group.key,
- );
+ const grouped = shouldGroupChecks(checks.length);
+ const groupKeys = grouped
+ ? groupChecks(checks, t('acceptance.group.uncategorized')).map((group) => group.key)
+ : [];
const allGroupsCollapsed =
groupKeys.length > 0 && groupKeys.every((key) => collapsedGroups.has(key));
@@ -650,26 +672,33 @@ const AcceptancePage = memo<AcceptancePageProps>(
icon: BadgeCheck,
label: t('acceptance.status.accepted'),
}
- : acceptance.status === 'rejected'
+ : acceptance.status === 'closed'
? {
- bg: cssVar.colorErrorBg,
- color: cssVar.colorError,
- icon: RotateCcw,
- label: t('acceptance.status.rejected'),
+ bg: cssVar.colorFillSecondary,
+ color: cssVar.colorTextSecondary,
+ icon: X,
+ label: t('acceptance.status.closed'),
}
- : acceptance.status === 'errored'
+ : acceptance.status === 'rejected'
? {
- bg: cssVar.colorWarningBg,
- color: cssVar.colorWarning,
- icon: HelpCircle,
- label: t('acceptance.status.errored'),
+ bg: cssVar.colorErrorBg,
+ color: cssVar.colorError,
+ icon: RotateCcw,
+ label: t('acceptance.status.rejected'),
}
- : {
- bg: cssVar.colorInfoBg,
- color: cssVar.colorInfo,
- icon: CircleDashed,
- label: t('acceptance.verdict.inProgress'),
- };
+ : acceptance.status === 'errored'
+ ? {
+ bg: cssVar.colorWarningBg,
+ color: cssVar.colorWarning,
+ icon: HelpCircle,
+ label: t('acceptance.status.errored'),
+ }
+ : {
+ bg: cssVar.colorInfoBg,
+ color: cssVar.colorInfo,
+ icon: CircleDashed,
+ label: t('acceptance.verdict.inProgress'),
+ };
const runAction = async (action: () => Promise<unknown>) => {
try {
@@ -689,10 +718,49 @@ const AcceptancePage = memo<AcceptancePageProps>(
}
};
+ const changeAcceptanceStatus = async (status: 'accepted' | 'closed' | 'delivered') => {
+ const succeeded = await runAction(() =>
+ verifyService.updateAcceptanceStatus(acceptance.id, status),
+ );
+ if (succeeded) {
+ toast.success(t('acceptance.workspace.statusSuccess'));
+ } else {
+ toast.error(t('acceptance.workspace.statusError'));
+ }
+ };
+
+ const statusMenuItems: DropdownItem[] = getAcceptanceStatusActions(acceptance.status).map(
+ (action) => {
+ if (action === 'accept') {
+ return {
+ icon: <Icon icon={CircleCheck} />,
+ key: action,
+ label: t('acceptance.workspace.actions.markAccepted'),
+ onClick: () => void changeAcceptanceStatus('accepted'),
+ };
+ }
+ if (action === 'reopen') {
+ return {
+ icon: <Icon icon={RotateCcw} />,
+ key: action,
+ label: t('acceptance.workspace.actions.reopen'),
+ onClick: () => void changeAcceptanceStatus('delivered'),
+ };
+ }
+ return {
+ icon: <Icon icon={X} />,
+ key: action,
+ label: t('acceptance.workspace.actions.markClosed'),
+ onClick: () => void changeAcceptanceStatus('closed'),
+ };
+ },
+ );
+
const gotoRound = (round: number) => {
setHighlightRound(round);
setLedgerExpand(true);
};
+ const historyNavigation = resolveAcceptanceHistoryNavigation(isOwner, gotoRound);
// Open/close the round report drawer AND mirror it to `?r=` (standalone
// page only) so the address bar is always a copyable snapshot link for the
@@ -1018,7 +1086,7 @@ const AcceptancePage = memo<AcceptancePageProps>(
return (
<Flexbox horizontal className={styles.page}>
{/* The reopen affordance lives at the page corner — no edge handle tab. */}
- {!ledgerExpand && !focusedCheck && (
+ {showHistory && !ledgerExpand && !focusedCheck && (
<ActionIcon
className={styles.ledgerToggle}
icon={PanelRightOpen}
@@ -1044,13 +1112,31 @@ const AcceptancePage = memo<AcceptancePageProps>(
closes it), then identity, then the origin conversation. */}
<Flexbox gap={10}>
<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>
+ {isOwner ? (
+ <DropdownMenu items={statusMenuItems}>
+ <span
+ className={cx(styles.verdictPill, styles.verdictPillInteractive)}
+ title={t('acceptance.workspace.actions.status')}
+ style={{
+ background: verdictMeta.bg,
+ color: verdictMeta.color,
+ pointerEvents: pending ? 'none' : undefined,
+ }}
+ >
+ <Icon icon={verdictMeta.icon} size={13} spin={verdictMeta.spin} />
+ {verdictMeta.label}
+ <Icon icon={ChevronDown} size={11} />
+ </span>
+ </DropdownMenu>
+ ) : (
+ <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,
@@ -1242,7 +1328,7 @@ const AcceptancePage = memo<AcceptancePageProps>(
: ''}
</Text>
<Flexbox flex={1} />
- {latestReport && (
+ {showHistory && latestReport && (
<span
className={styles.viewReportLink}
onClick={() =>
@@ -1362,6 +1448,8 @@ const AcceptancePage = memo<AcceptancePageProps>(
<NavItem
active={check.id === focusedCheck.id}
key={check.id}
+ paddingBlock={acceptanceFocusedLayout.outlineItemPaddingBlock}
+ paddingInline={acceptanceFocusedLayout.outlineItemPaddingInline}
title={check.title}
titleColor={cssVar.colorText}
description={
@@ -1411,6 +1499,8 @@ const AcceptancePage = memo<AcceptancePageProps>(
<NavItem
extra={<Icon color={cssVar.colorTextQuaternary} icon={PencilLine} />}
key={item.id}
+ paddingBlock={acceptanceFocusedLayout.outlineItemPaddingBlock}
+ paddingInline={acceptanceFocusedLayout.outlineItemPaddingInline}
title={item.name}
titleColor={cssVar.colorText}
description={
@@ -1427,7 +1517,7 @@ const AcceptancePage = memo<AcceptancePageProps>(
<Flexbox className={styles.focusMain}>
<Flexbox className={styles.focusContent} gap={16}>
- <Flexbox gap={5}>
+ <Flexbox gap={acceptanceFocusedLayout.headerGap}>
<Flexbox
horizontal
align={'center'}
@@ -1508,7 +1598,7 @@ const AcceptancePage = memo<AcceptancePageProps>(
{t(`acceptance.focus.verifierDescription.${focusedStates.verifierLabel}`)}
</Text>
</Flexbox>
- {isOwner && (
+ {isOwner && acceptance.status !== 'closed' && (
<Flexbox horizontal align={'center'} className={styles.focusWork} gap={16}>
<Flexbox flex={1} gap={3}>
<Text strong>{t('acceptance.checkWork.title')}</Text>
@@ -1532,7 +1622,7 @@ const AcceptancePage = memo<AcceptancePageProps>(
check={focusedCheck}
reviewPending={pending}
onReview={handleReview}
- onRound={gotoRound}
+ onRound={historyNavigation}
/>
</Flexbox>
</Flexbox>
@@ -1594,7 +1684,7 @@ const AcceptancePage = memo<AcceptancePageProps>(
/>
{/* Which round touched a check — audit slicing, orthogonal to the
review-state segments. */}
- {rounds.length > 1 && (
+ {showHistory && rounds.length > 1 && (
<Select
size={'small'}
// Match the state filter so both read as one control family.
@@ -1611,18 +1701,20 @@ const AcceptancePage = memo<AcceptancePageProps>(
onChange={(value) => setRoundFilter(value === 'all' ? null : Number(value))}
/>
)}
- <ActionIcon
- icon={allGroupsCollapsed ? ChevronsUpDown : ChevronsDownUp}
- size={'small'}
- title={
- allGroupsCollapsed
- ? t('acceptance.group.expandAll')
- : t('acceptance.group.collapseAll')
- }
- onClick={() =>
- setCollapsedGroups(allGroupsCollapsed ? new Set() : new Set(groupKeys))
- }
- />
+ {grouped && (
+ <ActionIcon
+ icon={allGroupsCollapsed ? ChevronsUpDown : ChevronsDownUp}
+ size={'small'}
+ title={
+ allGroupsCollapsed
+ ? t('acceptance.group.expandAll')
+ : t('acceptance.group.collapseAll')
+ }
+ onClick={() =>
+ setCollapsedGroups(allGroupsCollapsed ? new Set() : new Set(groupKeys))
+ }
+ />
+ )}
</Flexbox>
{unverifiedStandingChecks.length > 0 && (
@@ -1673,7 +1765,7 @@ const AcceptancePage = memo<AcceptancePageProps>(
round={roundFilter}
onGroupFeedback={handleGroupFeedback}
onReview={handleReview}
- onRound={gotoRound}
+ onRound={historyNavigation}
onToggleGroup={(key) =>
setCollapsedGroups((previous) => {
const next = new Set(previous);
@@ -1705,7 +1797,7 @@ const AcceptancePage = memo<AcceptancePageProps>(
)}
{/* The floating decision strip — owner-only: closing the loop and
queueing feedback are the author's calls, never a visitor's. */}
- {isOwner && !focusedCheck && (
+ {isOwner && !focusedCheck && acceptance.status !== 'closed' && (
<DecisionBar
acceptedCount={acceptedCount}
embedded={isEmbedded}
@@ -1727,7 +1819,7 @@ const AcceptancePage = memo<AcceptancePageProps>(
onRerun={handleRerun}
/>
)}
- <Flexbox style={{ height: 8 }} />
+ {!focusedCheck && <Flexbox style={{ height: 8 }} />}
</Flexbox>
</Flexbox>
@@ -1747,45 +1839,18 @@ const AcceptancePage = memo<AcceptancePageProps>(
shrinking the report into an unreadable column. The panel's own
fold icon is the close affordance (same as wide mode), so the Drawer's
built-in close button is suppressed — one collapse handle, not two. */}
- {isNarrowViewport ? (
- <Drawer
- noHeader
- closable={false}
- containerMaxWidth={'100%'}
- open={ledgerExpand}
- placement={'right'}
- styles={{ body: { padding: 0 } }}
- width={'min(340px, 88vw)'}
- onClose={() => setLedgerExpand(false)}
- >
- {topicPanelOpen && origin?.agent?.id && origin.topic ? (
- <TopicPanel
- agentId={origin.agent.id}
- title={origin.topic.title ?? subject.title ?? origin.topic.id}
- topicId={origin.topic.id}
- onBack={closeTopicPanel}
- onCollapse={() => setLedgerExpand(false)}
- />
- ) : (
- <LedgerPanel
- highlight={highlightRound}
- reviewByRound={reviewByRound}
- rounds={rounds}
- onCollapse={() => setLedgerExpand(false)}
- onOpenReport={openReport}
- />
- )}
- </Drawer>
- ) : (
- <DraggablePanel
- defaultSize={{ width: 340 }}
- expand={ledgerExpand}
- minWidth={300}
- placement={'right'}
- style={{ flex: 'none', height: '100%' }}
- onExpandChange={setLedgerExpand}
- >
- <Flexbox style={{ height: '100%', minHeight: 0, overflow: 'hidden' }}>
+ {showHistory &&
+ (isNarrowViewport ? (
+ <Drawer
+ noHeader
+ closable={false}
+ containerMaxWidth={'100%'}
+ open={ledgerExpand}
+ placement={'right'}
+ styles={{ body: { padding: 0 } }}
+ width={'min(340px, 88vw)'}
+ onClose={() => setLedgerExpand(false)}
+ >
{topicPanelOpen && origin?.agent?.id && origin.topic ? (
<TopicPanel
agentId={origin.agent.id}
@@ -1795,44 +1860,74 @@ const AcceptancePage = memo<AcceptancePageProps>(
onCollapse={() => setLedgerExpand(false)}
/>
) : (
- <Flexbox style={{ height: '100%', overflow: 'auto' }}>
- <LedgerPanel
- highlight={highlightRound}
- reviewByRound={reviewByRound}
- rounds={rounds}
+ <LedgerPanel
+ highlight={highlightRound}
+ reviewByRound={reviewByRound}
+ rounds={rounds}
+ onCollapse={() => setLedgerExpand(false)}
+ onOpenReport={openReport}
+ />
+ )}
+ </Drawer>
+ ) : (
+ <DraggablePanel
+ defaultSize={{ width: 340 }}
+ expand={ledgerExpand}
+ minWidth={300}
+ placement={'right'}
+ style={{ flex: 'none', height: '100%' }}
+ onExpandChange={setLedgerExpand}
+ >
+ <Flexbox style={{ height: '100%', minHeight: 0, overflow: 'hidden' }}>
+ {topicPanelOpen && origin?.agent?.id && origin.topic ? (
+ <TopicPanel
+ agentId={origin.agent.id}
+ title={origin.topic.title ?? subject.title ?? origin.topic.id}
+ topicId={origin.topic.id}
+ onBack={closeTopicPanel}
onCollapse={() => setLedgerExpand(false)}
- onOpenReport={openReport}
/>
- </Flexbox>
- )}
- </Flexbox>
- </DraggablePanel>
- )}
+ ) : (
+ <Flexbox style={{ height: '100%', overflow: 'auto' }}>
+ <LedgerPanel
+ highlight={highlightRound}
+ reviewByRound={reviewByRound}
+ rounds={rounds}
+ onCollapse={() => setLedgerExpand(false)}
+ onOpenReport={openReport}
+ />
+ </Flexbox>
+ )}
+ </Flexbox>
+ </DraggablePanel>
+ ))}
{/* 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; the Drawer's OWN floating close renders even with noHeader,
so no extra close button here (two would overlap). */}
- <Drawer
- destroyOnHidden
- noHeader
- containerMaxWidth={'100%'}
- open={reportRound !== null}
- placement={'right'}
- width={'min(960px, 92vw)'}
- styles={{
- body: { height: '100%', padding: 0 },
- bodyContent: { height: '100%', minHeight: 0, overflow: 'hidden' },
- }}
- onClose={() => openReport(null)}
- >
- {reportRound && (
- <Flexbox style={{ height: '100%', position: 'relative' }}>
- <ReportViewer runId={reportRound.run.id} />
- </Flexbox>
- )}
- </Drawer>
+ {showHistory && (
+ <Drawer
+ destroyOnHidden
+ noHeader
+ containerMaxWidth={'100%'}
+ open={reportRound !== null}
+ placement={'right'}
+ width={'min(960px, 92vw)'}
+ styles={{
+ body: { height: '100%', padding: 0 },
+ bodyContent: { height: '100%', minHeight: 0, overflow: 'hidden' },
+ }}
+ onClose={() => openReport(null)}
+ >
+ {reportRound && (
+ <Flexbox style={{ height: '100%', position: 'relative' }}>
+ <ReportViewer runId={reportRound.run.id} />
+ </Flexbox>
+ )}
+ </Drawer>
+ )}
</Flexbox>
);
},
diff --git a/src/features/Verify/Acceptance/layout.test.ts b/src/features/Verify/Acceptance/layout.test.ts
new file mode 100644
index 00000000000..4e30749ad20
--- /dev/null
+++ b/src/features/Verify/Acceptance/layout.test.ts
@@ -0,0 +1,19 @@
+import { describe, expect, it } from 'vitest';
+
+import { acceptanceFocusedLayout } from './layout';
+
+describe('acceptanceFocusedLayout', () => {
+ it('fits the focused workspace to its scroll container instead of the browser viewport', () => {
+ expect(acceptanceFocusedLayout.viewportHeight).toBe('100%');
+ });
+
+ it('keeps deliberate reading space above and below focused check content', () => {
+ expect(acceptanceFocusedLayout.contentPaddingBlock).toBe('32px 24px');
+ });
+
+ it('paces the detail heading and outline rows independently from the outer padding', () => {
+ expect(acceptanceFocusedLayout.headerGap).toBe(8);
+ expect(acceptanceFocusedLayout.outlineItemPaddingBlock).toBe(10);
+ expect(acceptanceFocusedLayout.outlineItemPaddingInline).toBe(8);
+ });
+});
diff --git a/src/features/Verify/Acceptance/layout.ts b/src/features/Verify/Acceptance/layout.ts
new file mode 100644
index 00000000000..225cdc7e60c
--- /dev/null
+++ b/src/features/Verify/Acceptance/layout.ts
@@ -0,0 +1,7 @@
+export const acceptanceFocusedLayout = {
+ contentPaddingBlock: '32px 24px',
+ headerGap: 8,
+ outlineItemPaddingBlock: 10,
+ outlineItemPaddingInline: 8,
+ viewportHeight: '100%',
+} as const;
diff --git a/src/features/Verify/Acceptance/statusActions.test.ts b/src/features/Verify/Acceptance/statusActions.test.ts
new file mode 100644
index 00000000000..89263576867
--- /dev/null
+++ b/src/features/Verify/Acceptance/statusActions.test.ts
@@ -0,0 +1,17 @@
+import { describe, expect, it } from 'vitest';
+
+import { getAcceptanceStatusActions } from './statusActions';
+
+describe('getAcceptanceStatusActions', () => {
+ it('offers both accepting and closing for a settled delivery', () => {
+ expect(getAcceptanceStatusActions('delivered')).toEqual(['accept', 'close']);
+ });
+
+ it('offers reopening for a closed acceptance', () => {
+ expect(getAcceptanceStatusActions('closed')).toEqual(['reopen']);
+ });
+
+ it('keeps close available while verification is still active', () => {
+ expect(getAcceptanceStatusActions('verifying')).toEqual(['close']);
+ });
+});
diff --git a/src/features/Verify/Acceptance/statusActions.ts b/src/features/Verify/Acceptance/statusActions.ts
new file mode 100644
index 00000000000..5bb725ee616
--- /dev/null
+++ b/src/features/Verify/Acceptance/statusActions.ts
@@ -0,0 +1,15 @@
+import type { AcceptanceStatus } from '@lobechat/types';
+
+export type AcceptanceStatusAction = 'accept' | 'close' | 'reopen';
+
+export const getAcceptanceStatusActions = (status: AcceptanceStatus): AcceptanceStatusAction[] => {
+ const actions: AcceptanceStatusAction[] = [];
+
+ if (status === 'delivered' || status === 'errored') actions.push('accept');
+ if (status === 'accepted' || status === 'closed' || status === 'rejected') {
+ actions.push('reopen');
+ }
+ if (status !== 'closed') actions.push('close');
+
+ return actions;
+};
diff --git a/src/features/Verify/Acceptance/visibility.test.ts b/src/features/Verify/Acceptance/visibility.test.ts
new file mode 100644
index 00000000000..f25877f512d
--- /dev/null
+++ b/src/features/Verify/Acceptance/visibility.test.ts
@@ -0,0 +1,20 @@
+import { describe, expect, it } from 'vitest';
+
+import { canViewAcceptanceHistory, resolveAcceptanceHistoryNavigation } from './visibility';
+
+describe('canViewAcceptanceHistory', () => {
+ it('keeps run history available to the acceptance owner', () => {
+ expect(canViewAcceptanceHistory(true)).toBe(true);
+ });
+
+ it('hides run history from shared viewers', () => {
+ expect(canViewAcceptanceHistory(false)).toBe(false);
+ });
+
+ it('removes round navigation from shared viewers instead of leaving dead controls', () => {
+ const onRound = () => {};
+
+ expect(resolveAcceptanceHistoryNavigation(false, onRound)).toBeUndefined();
+ expect(resolveAcceptanceHistoryNavigation(true, onRound)).toBe(onRound);
+ });
+});
diff --git a/src/features/Verify/Acceptance/visibility.ts b/src/features/Verify/Acceptance/visibility.ts
new file mode 100644
index 00000000000..364f912cb5a
--- /dev/null
+++ b/src/features/Verify/Acceptance/visibility.ts
@@ -0,0 +1,8 @@
+/** Run history is an owner workspace; shared viewers only need the latest aggregate state. */
+export const canViewAcceptanceHistory = (isOwner: boolean) => isOwner;
+
+/** Remove round navigation itself when its history destination is unavailable. */
+export const resolveAcceptanceHistoryNavigation = (
+ isOwner: boolean,
+ onRound: (round: number) => void,
+) => (canViewAcceptanceHistory(isOwner) ? onRound : undefined);
diff --git a/src/services/verify.ts b/src/services/verify.ts
index cd356971009..52acabe9466 100644
--- a/src/services/verify.ts
+++ b/src/services/verify.ts
@@ -215,7 +215,7 @@ export class VerifyService {
lambdaClient.acceptance.rename.mutate({ id, title });
/** Owner override of the acceptance's decision state from the list. */
- updateAcceptanceStatus = (id: string, status: 'accepted' | 'delivered' | 'rejected') =>
+ updateAcceptanceStatus = (id: string, status: 'accepted' | 'closed' | 'delivered' | 'rejected') =>
lambdaClient.acceptance.updateStatus.mutate({ id, status });
/** Delete the acceptance aggregate (its round reports detach, not delete). */