fix: restore stable canvas page hooks
Some checks failed
Lint / build (20) (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled

This commit is contained in:
Your Name 2026-03-16 14:45:30 +08:00
parent 176fc94293
commit 3bd022fc15

View File

@ -800,6 +800,19 @@ export default function CanvasEditorPage({ params }: PageProps) {
};
}, []);
const resolvedWorkflowUiConfig = useMemo(
() => normalizeAgentWorkflowUiConfig(siteSettingsData?.agentWorkflowUiConfig),
[siteSettingsData?.agentWorkflowUiConfig]
);
const workflowContext = useMemo<AgentWorkflowComposerContext | null>(() => {
return buildAgentWorkflowComposerContext({
config: resolvedWorkflowUiConfig || defaultAgentWorkflowUiConfig,
inputs: workflowInputs,
selections: workflowSelections,
});
}, [resolvedWorkflowUiConfig, workflowInputs, workflowSelections]);
if (isLoading) {
return (
<div className="h-full flex items-center justify-center bg-muted/30">
@ -844,18 +857,6 @@ export default function CanvasEditorPage({ params }: PageProps) {
</div>
</div>
) : null;
const resolvedWorkflowUiConfig = useMemo(
() => normalizeAgentWorkflowUiConfig(siteSettingsData?.agentWorkflowUiConfig),
[siteSettingsData?.agentWorkflowUiConfig]
);
const workflowContext = useMemo<AgentWorkflowComposerContext | null>(() => {
return buildAgentWorkflowComposerContext({
config: resolvedWorkflowUiConfig || defaultAgentWorkflowUiConfig,
inputs: workflowInputs,
selections: workflowSelections,
});
}, [resolvedWorkflowUiConfig, workflowInputs, workflowSelections]);
if (isAgentMode) {
return (