Merge pull request #1532 from CREDO23/imporve-artifacts-accessibility

[Feat] Artifacts sidebar for chat deliverables
This commit is contained in:
Rohan Verma 2026-06-25 13:31:45 -07:00 committed by GitHub
commit efa9efc80b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
40 changed files with 1306 additions and 43 deletions

View file

@ -0,0 +1,11 @@
"use client";
import { useParams } from "next/navigation";
import { ArtifactsLibrary } from "@/features/artifacts-library";
export default function ArtifactsPage() {
const params = useParams();
const searchSpaceId = Number(params.search_space_id);
return <ArtifactsLibrary searchSpaceId={searchSpaceId} />;
}

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
@ -2488,6 +2496,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,
@ -2547,6 +2558,7 @@ export default function NewChatPage() {
<MobileReportPanel />
<MobileEditorPanel />
<MobileHitlEditPanel />
<MobileArtifactsPanel />
</div>
</PendingInterruptProvider>
<EditMessageDialog