调整策划交互卡片位置
将审批卡和问询卡移动到输入框上方 拆分阶段状态与待处理操作并保持原有交互逻辑
This commit is contained in:
@@ -25,23 +25,20 @@ type DesignAgentSurfaceProps = {
|
||||
onRetry: () => void;
|
||||
};
|
||||
|
||||
export function DesignAgentSurface({
|
||||
type DesignAgentControlsProps = Pick<
|
||||
DesignAgentSurfaceProps,
|
||||
'view' | 'busy' | 'error' | 'onApprove' | 'onClarify' | 'onRetry'
|
||||
>;
|
||||
|
||||
export function DesignAgentPhaseStatus({
|
||||
view,
|
||||
busy,
|
||||
error,
|
||||
onApprove,
|
||||
onClarify,
|
||||
onRetry,
|
||||
}: DesignAgentSurfaceProps) {
|
||||
const [clarifyText, setClarifyText] = useState('');
|
||||
busy,
|
||||
}: DesignAgentControlsProps) {
|
||||
const phase = view?.session.currentPhase ?? 'concept';
|
||||
const pending = view?.session.pendingApproval;
|
||||
const clarification = view?.session.pendingClarification;
|
||||
useLayoutEffect(() => {
|
||||
setClarifyText('');
|
||||
}, [clarification?.requestId]);
|
||||
return (
|
||||
<section className="design-agent-controls" aria-label="策划阶段控制">
|
||||
<section className="design-agent-controls" aria-label="策划阶段状态">
|
||||
<div className="design-agent-controls__header">
|
||||
<div>
|
||||
<span>当前阶段</span>
|
||||
@@ -54,6 +51,42 @@ export function DesignAgentSurface({
|
||||
) : null}
|
||||
</div>
|
||||
{error ? <p className="design-agent-controls__error">{error}</p> : null}
|
||||
{view?.canRetry ? (
|
||||
<button
|
||||
className="design-agent-retry"
|
||||
type="button"
|
||||
disabled={busy}
|
||||
onClick={onRetry}
|
||||
>
|
||||
<RotateCcw size={15} aria-hidden="true" />
|
||||
重试本轮
|
||||
</button>
|
||||
) : null}
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
||||
export function DesignAgentPendingActions({
|
||||
view,
|
||||
busy,
|
||||
onApprove,
|
||||
onClarify,
|
||||
}: DesignAgentControlsProps) {
|
||||
const [clarifyText, setClarifyText] = useState('');
|
||||
const phase = view?.session.currentPhase ?? 'concept';
|
||||
const pending = view?.session.pendingApproval;
|
||||
const clarification = view?.session.pendingClarification;
|
||||
useLayoutEffect(() => {
|
||||
setClarifyText('');
|
||||
}, [clarification?.requestId]);
|
||||
if (!pending || phase === 'consultant') {
|
||||
if (!clarification) return null;
|
||||
}
|
||||
return (
|
||||
<section
|
||||
className="design-agent-pending-actions"
|
||||
aria-label="策划待处理事项"
|
||||
>
|
||||
{pending && phase !== 'consultant' ? (
|
||||
<div className="design-agent-approval">
|
||||
<p>当前阶段产物已提交,是否批准进入下一阶段?</p>
|
||||
@@ -110,17 +143,26 @@ export function DesignAgentSurface({
|
||||
</button>
|
||||
</div>
|
||||
) : null}
|
||||
{view?.canRetry ? (
|
||||
<button
|
||||
className="design-agent-retry"
|
||||
type="button"
|
||||
disabled={busy}
|
||||
onClick={onRetry}
|
||||
>
|
||||
<RotateCcw size={15} aria-hidden="true" />
|
||||
重试本轮
|
||||
</button>
|
||||
) : null}
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
||||
export function DesignAgentSurface({
|
||||
view,
|
||||
busy,
|
||||
error,
|
||||
onApprove,
|
||||
onClarify,
|
||||
onRetry,
|
||||
}: DesignAgentSurfaceProps) {
|
||||
return (
|
||||
<DesignAgentPhaseStatus
|
||||
view={view}
|
||||
busy={busy}
|
||||
error={error}
|
||||
onApprove={onApprove}
|
||||
onClarify={onClarify}
|
||||
onRetry={onRetry}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
+15
-2
@@ -33,7 +33,10 @@ import {
|
||||
ConversationModelSelect,
|
||||
type ConversationModelSelectHandle,
|
||||
} from './ConversationModelSelect';
|
||||
import { DesignAgentSurface } from './DesignAgentSurface';
|
||||
import {
|
||||
DesignAgentPendingActions,
|
||||
DesignAgentPhaseStatus,
|
||||
} from './DesignAgentSurface';
|
||||
import { PlanGddSurface } from './GddApprovalCard';
|
||||
import {
|
||||
pendingCommandDetail,
|
||||
@@ -178,7 +181,7 @@ export function ProjectSupervisorView({
|
||||
>
|
||||
<div className="project-supervisor-conversation">
|
||||
{designView || onDesignApprove ? (
|
||||
<DesignAgentSurface
|
||||
<DesignAgentPhaseStatus
|
||||
view={designView}
|
||||
busy={runtimePanelProps.controlBusy || planGddDecisionBusy}
|
||||
error={planGddError}
|
||||
@@ -359,6 +362,16 @@ export function ProjectSupervisorView({
|
||||
</button>
|
||||
</div>
|
||||
) : null}
|
||||
{designView || onDesignApprove ? (
|
||||
<DesignAgentPendingActions
|
||||
view={designView}
|
||||
busy={runtimePanelProps.controlBusy || planGddDecisionBusy}
|
||||
error={planGddError}
|
||||
onApprove={onDesignApprove ?? (() => undefined)}
|
||||
onClarify={onDesignClarify ?? (() => undefined)}
|
||||
onRetry={onDesignRetry ?? (() => undefined)}
|
||||
/>
|
||||
) : null}
|
||||
<form
|
||||
className="project-supervisor-composer"
|
||||
onSubmit={(event) => {
|
||||
|
||||
@@ -8521,6 +8521,12 @@ button.design-workspace-tree__entry:hover,
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.design-agent-pending-actions {
|
||||
display: grid;
|
||||
gap: 10px;
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
.design-agent-approval p,
|
||||
.design-agent-clarify p {
|
||||
margin: 0;
|
||||
|
||||
Reference in New Issue
Block a user