diff --git a/gui/src/pages/config/HelpCenterSection.tsx b/gui/src/pages/config/HelpCenterSection.tsx index 004e5b78a..7a711068c 100644 --- a/gui/src/pages/config/HelpCenterSection.tsx +++ b/gui/src/pages/config/HelpCenterSection.tsx @@ -1,13 +1,14 @@ import { ArrowTopRightOnSquareIcon, DocumentArrowUpIcon, + NumberedListIcon, PaintBrushIcon, TableCellsIcon, } from "@heroicons/react/24/outline"; import { useContext } from "react"; import { useNavigate } from "react-router-dom"; import { IdeMessengerContext } from "../../context/IdeMessenger"; -import { useAppDispatch } from "../../redux/hooks"; +import { useAppDispatch, useAppSelector } from "../../redux/hooks"; import { setOnboardingCard } from "../../redux/slices/uiSlice"; import { saveCurrentSession } from "../../redux/thunks/session"; import { ROUTES } from "../../util/navigation"; @@ -18,6 +19,21 @@ export function HelpCenterSection() { const navigate = useNavigate(); const dispatch = useAppDispatch(); + const currentSession = useAppSelector((state) => state.session); + + const handleViewSessionData = async () => { + const sessionData = await ideMessenger.request("history/load", { + id: currentSession.id, + }); + + if (sessionData.status === "success") { + await ideMessenger.request("showVirtualFile", { + name: `${sessionData.content.title}.json`, + content: JSON.stringify(sessionData.content, null, 2), + }); + } + }; + return (