feat(review,annotate): add Close button to exit sessions without feedback (#523)

Adds a Close button to review and annotation sessions so users can exit
cleanly without sending feedback or killing the agent. Works across all
agent origins and includes a warning dialog when annotations would be lost.

Fixes #522

Co-authored-by: gwynnnplaine <vladyslav.hrabovyii@gmail.com>
This commit is contained in:
Vladyslav Hrabovyi
2026-04-10 03:22:01 +01:00
committed by GitHub
parent 062106ff90
commit 3b1b3317ae
15 changed files with 436 additions and 136 deletions
+10
View File
@@ -90,6 +90,7 @@ export interface ReviewServerResult {
feedback: string;
annotations: unknown[];
agentSwitch?: string;
exit?: boolean;
}>;
/** Stop the server */
stop: () => void;
@@ -329,12 +330,14 @@ export async function startReviewServer(
feedback: string;
annotations: unknown[];
agentSwitch?: string;
exit?: boolean;
}) => void;
const decisionPromise = new Promise<{
approved: boolean;
feedback: string;
annotations: unknown[];
agentSwitch?: string;
exit?: boolean;
}>((resolve) => {
resolveDecision = resolve;
});
@@ -560,6 +563,13 @@ export async function startReviewServer(
});
if (agentResponse) return agentResponse;
// API: Exit review session without feedback
if (url.pathname === "/api/exit" && req.method === "POST") {
deleteDraft(draftKey);
resolveDecision({ approved: false, feedback: "", annotations: [], exit: true });
return Response.json({ ok: true });
}
// API: Submit review feedback
if (url.pathname === "/api/feedback" && req.method === "POST") {
try {