mirror of
https://github.com/backnotprop/plannotator.git
synced 2026-09-14 14:17:26 +08:00
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:
committed by
GitHub
parent
062106ff90
commit
3b1b3317ae
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user