feat: surface chat page artifacts

This commit is contained in:
CREDO23 2026-06-22 22:38:15 +02:00
parent 365c8a1088
commit ec907431d5

View file

@ -52,6 +52,7 @@ import {
} from "@/components/assistant-ui/token-usage-context";
import { Button } from "@/components/ui/button";
import { Skeleton } from "@/components/ui/skeleton";
import { useSyncChatArtifacts } from "@/features/chat-artifacts";
import {
type HitlDecision,
PendingInterruptProvider,
@ -138,6 +139,13 @@ const MobileReportPanel = dynamic(
})),
{ ssr: false }
);
const MobileArtifactsPanel = dynamic(
() =>
import("@/features/chat-artifacts/ui/artifacts-panel").then((m) => ({
default: m.MobileArtifactsPanel,
})),
{ ssr: false }
);
/**
* Generate a synthetic ``toolCallId`` for an action_request that has no
@ -2501,6 +2509,9 @@ export default function NewChatPage() {
await handleRegenerate(null);
}, [handleRegenerate]);
// Surface the thread's deliverables to the layout-level artifacts sidebar.
useSyncChatArtifacts(messages);
// Create external store runtime
const runtime = useExternalStoreRuntime({
messages,
@ -2560,6 +2571,7 @@ export default function NewChatPage() {
<MobileReportPanel />
<MobileEditorPanel />
<MobileHitlEditPanel />
<MobileArtifactsPanel />
</div>
</PendingInterruptProvider>
<EditMessageDialog