fix(frontend): show raw chat messages and improve roundtable draft saves
This commit is contained in:
1 parent
0d8cdf3afb
commit
93e702f9ca
5 files changed
+99
-20
No files matched your search
@@ -17,11 +17,12 @@
|
||||
* 1) special 顺序派活,**不要**改回 `Promise.all`(详见 §5.4)
|
||||
* 2) step1InitGenRef / step2InitRef 闸门用于规避 StrictMode 双 mount 副作用
|
||||
* 3) 离开 Step 2 不销毁 threadIds,允许返回继续看
|
||||
* 4) 草稿自动保存仅在前进切换(1→2、2→3)触发,后退不保存
|
||||
* 4) 草稿自动保存:前进切换(1→2、2→3)推进 furthestStep;此外每轮模型回答完
|
||||
* (Step 1 一轮任务理解结束 / Step 2 每个气泡收尾)也增量回写一次,后者不动 furthestStep
|
||||
* 5) Persona 抽屉改的 model 不会立即重启编排,下一轮才生效
|
||||
* 6) 模型选择全局默认 `availableModels[0].name`,Persona 覆盖更高优先级
|
||||
*/
|
||||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
||||
import {
|
||||
Activity,
|
||||
Check,
|
||||
@@ -173,11 +174,21 @@ export default function RoundtablePlanningPage() {
|
||||
};
|
||||
}, [step1.intentReady, step1.interactiveMessages]);
|
||||
|
||||
// Step 2 已收尾(非 streaming)的气泡数量 —— 递增即「某轮模型刚交付完」,
|
||||
// 作为草稿自动保存的触发信号(详见 useDraftPersistence)。流式增量不计入,
|
||||
// 所以不会在 token 级别刷屏式保存。
|
||||
const step2FinalizedCount = useMemo(
|
||||
() => step2.step2RoundtableDialogues.filter((d) => !d.streaming).length,
|
||||
[step2.step2RoundtableDialogues],
|
||||
);
|
||||
|
||||
// 草稿 hook —— 同时依赖 step1 + step2 的 snapshot / hydrate。
|
||||
const drafts = useDraftPersistence({
|
||||
currentStep,
|
||||
setCurrentStep,
|
||||
triggerToast,
|
||||
intentSending: step1.isIntentSending,
|
||||
step2FinalizedCount,
|
||||
getStep1Snapshot: () => ({
|
||||
intentThreadId: step1.intentThreadId,
|
||||
intentReady: step1.intentReady,
|
||||
|
||||
Reference in new issue
Block a user