Skip to content

Commit

Permalink
weird hack
Browse files Browse the repository at this point in the history
  • Loading branch information
Henry Fontanier committed Jul 25, 2024
1 parent 275559c commit 071ac7f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import type { SetStateAction } from "react";
import { useCallback, useEffect, useMemo, useState } from "react";

import { RenderMessageMarkdown } from "@app/components/assistant/RenderMessageMarkdown";
import { classNames } from "@app/lib/utils";

const sendResponseToIframe = <T extends VisualizationRPCCommand>(
request: { command: T } & VisualizationRPCRequest,
Expand Down Expand Up @@ -161,17 +162,31 @@ export function VisualizationActionIframe({

return (
<div className="relative">
{showIframe && (
<div
style={{
height: `${contentHeight}px`,
}}
/>
)}
<div>
{!showIframe && extractedCode && extractedCode.length > 0 && (
<RenderMessageMarkdown
content={"```javascript\n" + extractedCode + "\n```"}
isStreaming={isStreaming}
/>
)}
{showIframe && (
{!showIframe &&
contentHeight > 0 &&
extractedCode &&
extractedCode.length > 0 && (
<RenderMessageMarkdown
content={"```javascript\n" + extractedCode + "\n```"}
isStreaming={isStreaming}
/>
)}

{!!action.generation && (
<div
style={{ height: `${contentHeight}px` }}
className="max-h-[40vh] w-full"
className={classNames(
"absolute left-0 top-0 max-h-[40vh] w-full",
!showIframe && contentHeight > 0 ? "opacity-0" : "opacity-100"
)}
>
<iframe
className="h-full w-full"
Expand Down
2 changes: 1 addition & 1 deletion types/src/front/lib/actions/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ export const DustProdActionRegistry = createActionRegistry({
workspaceId: PRODUCTION_DUST_APPS_WORKSPACE_ID,
appId: "tWcuYDj1OE",
appHash:
"9c25f18c9a913f810045dc15ad0aae4814dff712ea6cfcf21c48da4e81b6814f",
"9e7dac5aeeaf250aaaaf3f56ceaa2730c76b75e5333a4b59e6dd28cd45a4cea3",
},
config: {
MODEL: {
Expand Down

0 comments on commit 071ac7f

Please sign in to comment.