按钮修改
This commit is contained in:
1 parent
d94c0aae4b
commit
68ac49259c
3 files changed
+44
-26
No files matched your search
@@ -15,7 +15,7 @@
|
||||
*
|
||||
* 状态全部来自 `useStep2Orchestration` —— 本组件不调任何后端、不持久化。
|
||||
*/
|
||||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import { useCallback, useRef, useState } from "react";
|
||||
import {
|
||||
Cpu,
|
||||
FileIcon,
|
||||
@@ -89,7 +89,7 @@ export interface Step2PanelProps {
|
||||
// ─── Handlers ─────────────────────────────────────────────────
|
||||
onPauseRoundtable: () => void;
|
||||
onResumeRoundtable: () => void;
|
||||
onRecordInjectMessage: () => void;
|
||||
onHandleInjectToRoundtable: () => void;
|
||||
onSubmitClarification: (answer: string) => void;
|
||||
onSavePersona: (id: number) => void;
|
||||
onProceedToStep3: () => void;
|
||||
@@ -123,7 +123,7 @@ export function Step2Panel(props: Step2PanelProps) {
|
||||
setSelectedAgentId,
|
||||
onPauseRoundtable,
|
||||
onResumeRoundtable,
|
||||
onRecordInjectMessage,
|
||||
onHandleInjectToRoundtable,
|
||||
onSubmitClarification,
|
||||
onSavePersona,
|
||||
onProceedToStep3,
|
||||
@@ -134,24 +134,14 @@ export function Step2Panel(props: Step2PanelProps) {
|
||||
const { atBottom: step2AtBottom, scrollToBottom: scrollStep2ToBottom } =
|
||||
useAutoScroll(step2ScrollRef, [step2RoundtableDialogues]);
|
||||
|
||||
// 干预研审 → 暂停会商:与右上角按钮共用 onPauseRoundtable;乐观 UI 避免等父 state 刷新。
|
||||
// 干预研审:记录指令并自动恢复会商,右上角按钮状态由 isRoundTableRunning 驱动
|
||||
const [pauseFlash, setPauseFlash] = useState(false);
|
||||
const [optimisticPaused, setOptimisticPaused] = useState(false);
|
||||
const showPausedUi = !isRoundTableRunning || optimisticPaused;
|
||||
|
||||
useEffect(() => {
|
||||
if (!isRoundTableRunning) {
|
||||
setOptimisticPaused(false);
|
||||
}
|
||||
}, [isRoundTableRunning]);
|
||||
|
||||
const handleInject = useCallback(() => {
|
||||
setOptimisticPaused(true);
|
||||
onPauseRoundtable();
|
||||
onRecordInjectMessage();
|
||||
onHandleInjectToRoundtable();
|
||||
setPauseFlash(true);
|
||||
window.setTimeout(() => setPauseFlash(false), 1600);
|
||||
}, [onPauseRoundtable, onRecordInjectMessage]);
|
||||
}, [onHandleInjectToRoundtable]);
|
||||
|
||||
const isSandboxStreaming =
|
||||
isOrchestrating ||
|
||||
@@ -196,7 +186,7 @@ export function Step2Panel(props: Step2PanelProps) {
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
{showPausedUi ? (
|
||||
{!isRoundTableRunning ? (
|
||||
<button
|
||||
type="button"
|
||||
onClick={onResumeRoundtable}
|
||||
@@ -354,10 +344,10 @@ export function Step2Panel(props: Step2PanelProps) {
|
||||
<button
|
||||
type="button"
|
||||
onClick={handleInject}
|
||||
title="暂停会商并记录干预指令;点击右上角「恢复会商」继续执行"
|
||||
title="记录干预指令并立即恢复会商执行"
|
||||
className="bg-primary hover:bg-[var(--brand-900)] text-white text-xs font-bold px-4 py-2.5 rounded-xl transition shrink-0 cursor-pointer active:scale-95 shadow-md shadow-primary/10"
|
||||
>
|
||||
干预研审
|
||||
干预并发送
|
||||
</button>
|
||||
|
||||
<div className="h-6 w-[1px] bg-slate-200 shrink-0" />
|
||||
|
||||
Reference in new issue
Block a user