diff --git a/app/(docs)/@chat/chat/[chatId]/chatArea.tsx b/app/(docs)/@chat/chat/[chatId]/chatArea.tsx index 63bef250..2e1d6af6 100644 --- a/app/(docs)/@chat/chat/[chatId]/chatArea.tsx +++ b/app/(docs)/@chat/chat/[chatId]/chatArea.tsx @@ -116,6 +116,9 @@ export function ChatAreaContent(props: Props) { questionScope: "page", sectionContent: priorSectionContent, deleteChatOnCreated: chatId, + replOutputs: chatData.replOutputs ?? {}, + files: chatData.files ?? {}, + execResults: chatData.execResults ?? {}, }); }; @@ -127,20 +130,28 @@ export function ChatAreaContent(props: Props) {
diff --git a/app/(docs)/@docs/[lang]/[pageId]/chatForm.tsx b/app/(docs)/@docs/[lang]/[pageId]/chatForm.tsx index 71f0a96a..f77ee613 100644 --- a/app/(docs)/@docs/[lang]/[pageId]/chatForm.tsx +++ b/app/(docs)/@docs/[lang]/[pageId]/chatForm.tsx @@ -14,6 +14,7 @@ import { // import { getLanguageName } from "../pagesList"; import { DynamicMarkdownSection, PagePath } from "@/lib/docs"; import { useSendChat } from "@/(docs)/useSendChat"; +import { useEmbedContext } from "@/terminal/embedContext"; interface ChatFormProps { path: PagePath; @@ -30,6 +31,7 @@ export function ChatForm({ path, langName, sectionContent, close }: ChatFormProp ); const { sendChat, isLoading, errorMessage } = useSendChat(); + const { files, replOutputs, execResults } = useEmbedContext(); const exampleData = useMemo( () => @@ -70,6 +72,9 @@ export function ChatForm({ path, langName, sectionContent, close }: ChatFormProp userQuestion, questionScope, sectionContent, + files, + replOutputs, + execResults, onSuccess: () => { setInputValue(""); close(); diff --git a/app/(docs)/@docs/[lang]/[pageId]/page.tsx b/app/(docs)/@docs/[lang]/[pageId]/page.tsx index 1e0c03c3..b0e5d67e 100644 --- a/app/(docs)/@docs/[lang]/[pageId]/page.tsx +++ b/app/(docs)/@docs/[lang]/[pageId]/page.tsx @@ -17,6 +17,7 @@ import { } from "@/lib/docs"; import { DocsAutoRedirect } from "./autoRedirect"; import { TermDefinitionProvider } from "@/markdown/term"; +import { EmbedContextProvider } from "@/terminal/embedContext"; export async function generateMetadata({ params, @@ -68,19 +69,21 @@ export default async function Page({ return ( <> - - - + + + + + ); diff --git a/app/(docs)/@docs/[lang]/[pageId]/pageContent.tsx b/app/(docs)/@docs/[lang]/[pageId]/pageContent.tsx index 7beb8036..95453b1f 100644 --- a/app/(docs)/@docs/[lang]/[pageId]/pageContent.tsx +++ b/app/(docs)/@docs/[lang]/[pageId]/pageContent.tsx @@ -19,7 +19,6 @@ import Link from "next/link"; import { useChatId } from "@/(docs)/chatAreaState"; import { ChatWithMessages } from "@/lib/chatHistory"; import { usePagesListForLang } from "@/pagesListContext"; -import { useEmbedContext } from "@/terminal/embedContext"; import { useRouter } from "next/navigation"; import { revalidateChatAction } from "@/actions/revalidateChat"; import { RegenerateStreamEvent } from "@/api/chat/regenerate-section/route"; @@ -167,10 +166,12 @@ export function PageContent(props: PageContentProps) { ); } -function ChatListForSection(props: { +export function ChatListForSection(props: { dynamicMdContent: DynamicMarkdownSection[]; sectionId: SectionId; chatHistories: ChatWithMessages[]; + fullWidth?: boolean; + className?: string; }) { const { dynamicMdContent, sectionId, chatHistories } = props; const filteredChatHistories = chatHistories.filter( @@ -195,10 +196,15 @@ function ChatListForSection(props: { */}