mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-26 21:39:43 +02:00
Merge pull request #1532 from CREDO23/imporve-artifacts-accessibility
[Feat] Artifacts sidebar for chat deliverables
This commit is contained in:
commit
efa9efc80b
40 changed files with 1306 additions and 43 deletions
|
|
@ -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} />;
|
||||
}
|
||||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue