diff --git a/front/components/assistant/conversation/AgentMessage.tsx b/front/components/assistant/conversation/AgentMessage.tsx
index 66048b422646..031738dd2c69 100644
--- a/front/components/assistant/conversation/AgentMessage.tsx
+++ b/front/components/assistant/conversation/AgentMessage.tsx
@@ -509,6 +509,27 @@ export function AgentMessage({
return (
+ <>
+ {agentMessage.actions
+ .filter((a) => isVisualizationActionType(a))
+ .map((a, i) => {
+ const streamingViz = streamedVisualizations.find(
+ (sv) => sv.actionId === a.id
+ );
+ assert(isVisualizationActionType(a));
+ return (
+
retryHandler(agentMessage)}
+ owner={owner}
+ streamedCode={streamingViz?.visualization || null}
+ />
+ );
+ })}
+ >
{agentMessage.chainOfThought?.length ? (
@@ -556,27 +577,6 @@ export function AgentMessage({
)}
)}
- <>
- {agentMessage.actions
- .filter((a) => isVisualizationActionType(a))
- .map((a, i) => {
- const streamingViz = streamedVisualizations.find(
- (sv) => sv.actionId === a.id
- );
- assert(isVisualizationActionType(a));
- return (
- retryHandler(agentMessage)}
- owner={owner}
- streamedCode={streamingViz?.visualization || null}
- />
- );
- })}
- >
{agentMessage.status === "cancelled" && (
(
request: { command: T } & VisualizationRPCRequest,
@@ -135,8 +136,7 @@ export function VisualizationActionIframe({
isStreaming: boolean;
onRetry: () => void;
}) {
- const [activeTab, setActiveTab] = useState<"code" | "runtime">("code");
- const [tabManuallyChanged, setTabManuallyChanged] = useState(false);
+ const [showIframe, setShowIframe] = useState(null);
const [contentHeight, setContentHeight] = useState(0);
const workspaceId = owner.sId;
@@ -148,11 +148,10 @@ export function VisualizationActionIframe({
});
useEffect(() => {
- if (activeTab === "code" && action.generation && !tabManuallyChanged) {
- setActiveTab("runtime");
- setTabManuallyChanged(true);
+ if (showIframe === null && action.generation) {
+ setShowIframe(true);
}
- }, [action.generation, activeTab, tabManuallyChanged]);
+ }, [action.generation, showIframe]);
let extractedCode: string | null = null;
@@ -161,48 +160,48 @@ export function VisualizationActionIframe({
);
return (
- <>
- {
- event.preventDefault();
- setActiveTab(tabId as "code" | "runtime");
- }}
- />
- {activeTab === "code" && extractedCode && extractedCode.length > 0 && (
-
+ {showIframe && (
+
)}
- {activeTab === "runtime" && (
-
+
+ {action.generation && contentHeight > 0 && (
+
+ setShowIframe((prev) => !prev)}
/>
)}
- >
+
);
}
diff --git a/types/src/front/lib/actions/registry.ts b/types/src/front/lib/actions/registry.ts
index 6d712ab18e00..5c800b598e25 100644
--- a/types/src/front/lib/actions/registry.ts
+++ b/types/src/front/lib/actions/registry.ts
@@ -238,7 +238,7 @@ export const DustProdActionRegistry = createActionRegistry({
workspaceId: PRODUCTION_DUST_APPS_WORKSPACE_ID,
appId: "tWcuYDj1OE",
appHash:
- "e404a057516d5d1bb7b1807b74a20484c3f60bf0a36c510cb799127f060f032b",
+ "8298c6543759d1d11db0e360a8b7aa7b8ec0fa71ed274f2667678302073e4f8d",
},
config: {
MODEL: {