Skip to content

🀯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

πŸ› fix(cli): print the region before the note drawn on it in acceptance feedback (#20867)

Arvin Xubf4d8e340e2c
diff --git a/apps/cli/src/commands/acceptanceFeedback.test.ts b/apps/cli/src/commands/acceptanceFeedback.test.ts
index f78ac12846e..e87243c6adf 100644
--- a/apps/cli/src/commands/acceptanceFeedback.test.ts
+++ b/apps/cli/src/commands/acceptanceFeedback.test.ts
@@ -70,7 +70,14 @@ const bundle = () => ({
title: 'Token table',
evidence: [],
timeline: [{ evidence: [{ id: 'image', description: 'table.png' }] }],
- reviews: [],
+ reviews: [] as {
+ action: string;
+ annotations?: { comment?: string; evidenceId?: string; rect?: typeof rect }[];
+ comment?: string;
+ createdAt?: string;
+ id?: string;
+ roundIndex?: number;
+ }[],
userReview: null,
},
],
@@ -244,6 +251,30 @@ it('prints readable region, attachment and overall rejection context in plain te
expect(text).not.toContain('No actionable feedback');
});
+it('leads with the region a note was drawn on, and hangs the note under it', async () => {
+ const stdout = vi.spyOn(console, 'log').mockImplementation(() => {});
+ const data = bundle();
+ data.checks[0].reviews.push({
+ action: 'reject',
+ // A region note: the reviewer circled an area and wrote the words for it.
+ annotations: [{ comment: 'Expand this by default', evidenceId: 'image', rect }],
+ comment: '',
+ createdAt: '2026-09-22T14:20:00.000Z',
+ id: 'review-1',
+ roundIndex: 1,
+ });
+ getBundle.mockResolvedValue(data);
+
+ await feedback();
+
+ const text = stdout.mock.calls.flat().join('\n');
+ expect(text).toContain('table.png @ 10%,20% Β· 30%Γ—40%');
+ expect(text).toContain('Expand this by default');
+ // The anchor names the artifact; the reviewer's own words come after it.
+ expect(text.indexOf('table.png')).toBeLessThan(text.indexOf('Expand this by default'));
+ expect(text).not.toContain('region: Expand this by default');
+});
+
it('reports a comment read failure instead of claiming there is no feedback', async () => {
listComments.mockRejectedValue(new Error('Comments unavailable'));
await expect(feedback('--actionable', '--json')).rejects.toThrow('Comments unavailable');
diff --git a/apps/cli/src/commands/verifyAcceptance.ts b/apps/cli/src/commands/verifyAcceptance.ts
index cd79fa6bbf7..39ba20d866a 100644
--- a/apps/cli/src/commands/verifyAcceptance.ts
+++ b/apps/cli/src/commands/verifyAcceptance.ts
@@ -514,9 +514,19 @@ export function registerAcceptanceCommands(parent: Command, options?: { deprecat
console.log(` ${pc.dim(`β”” ${location}`)}`);
}
for (const annotation of entry.annotations ?? []) {
- if (annotation.comment && annotation.comment !== entry.comment)
- console.log(` ${pc.dim('region:')} ${annotation.comment}`);
- if (annotation.region) console.log(` ${pc.dim(`β”” ${annotation.region}`)}`);
+ // The region is the anchor, and the anchor is metadata: lead with it,
+ // dim the whole line, and hang the reviewer's own words under it, so
+ // the readable half stays the comment.
+ const note =
+ annotation.comment && annotation.comment !== entry.comment
+ ? annotation.comment
+ : undefined;
+ if (annotation.region) {
+ console.log(` ${pc.dim(`region: ${annotation.region}`)}`);
+ if (note) console.log(` ${pc.dim('β””')} ${note}`);
+ } else if (note) {
+ console.log(` ${pc.dim('region:')} ${note}`);
+ }
const disputed = formatDisputedChapter(annotation.disputes);
if (disputed) console.log(` ${pc.dim(`β”” disputes ${disputed}`)}`);
}