Files
Jyotisha/frontend/src/lib/queued-draft.ts
T
Jesse_ChenandCursor 055b7adca9 fix(web): keep composer enabled while generating and treat stop as neutral (BUG-551, BUG-552)
Enter now queues one follow-up instead of dropping it, and a rectification stop leaves the streamed reply with a grey notice instead of an error alert.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-06 13:08:43 +08:00

18 lines
638 B
TypeScript

export const COMPOSER_QUEUE_LABEL = "已排队,回答结束后发出";
export const COMPOSER_QUEUE_RECALL_LABEL = "撤回";
export type QueuedDraftSettle = "send" | "restore";
export function appendQueuedText(current: string, incoming: string): string {
const next = incoming.trim();
if (!next) return current.trim();
if (!current.trim()) return next;
return `${current.trimEnd()}\n${next}`;
}
export function queuedDraftSettleAction(
phase: "completed" | "succeeded" | "stopped" | "failed" | "recovering" | "readonly",
): QueuedDraftSettle {
return phase === "completed" || phase === "succeeded" ? "send" : "restore";
}