feat(core): 脚本交互再打磨 — 点字展开思考 / 一句话主题对话流 / 删除秒删持久队列 / 生成可停止

- 思考过程:点整行(不只小箭头)即可展开/收起
- 一句话主题改对话式:确定=确认风格/类型 → 模型主动问主题 → 输入再生成;设定卡「返回」回三选项
- 删除分镜:本地秒删 + localStorage 持久重试队列(扛刷新、网络不好自动重试到删成、绝不回滚)
- 生成中发送键变停止键:AbortController 掐断流(后端检测断连自动释放预扣额度)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
seaislee1209
2026-06-18 23:32:15 +08:00
co-authored by Claude Opus 4.8
parent 4399da2090
commit 5cfee715a2
3 changed files with 111 additions and 40 deletions
+4 -2
View File
@@ -237,7 +237,8 @@ export const api = {
total_duration?: number;
target_index?: number;
},
onEvent: (evt: { type: string; [k: string]: unknown }) => void
onEvent: (evt: { type: string; [k: string]: unknown }) => void,
signal?: AbortSignal
): Promise<void> {
const token = getToken();
const headers = new Headers({ "Content-Type": "application/json", Accept: "text/event-stream" });
@@ -245,7 +246,8 @@ export const api = {
const response = await fetch(`${API_BASE}/api/projects/${projectId}/script-agent-stream/`, {
method: "POST",
headers,
body: JSON.stringify(payload)
body: JSON.stringify(payload),
signal // 停止按钮:abort 这个 signal 即掐断流(后端检测断连会自动释放预扣额度)
});
if (!response.ok || !response.body) {
const text = await response.text().catch(() => "");