Merge pull request #6624 from uinstinct/session-file

This commit is contained in:
Dallin Romney 2025-07-18 11:48:05 +02:00 • committed by GitHub
commit 73fcce73ce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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 (
<div className="py-5">
<h3 className="mb-4 mt-0 text-xl">Help center</h3>
@ -68,6 +84,15 @@ export function HelpCenterSection() {
onClick={() => navigate("/stats")}
/>
{currentSession.history.length > 0 && !currentSession.isStreaming && (
<MoreHelpRow
title="View current session history"
description="Open the current chat session file for troubleshooting"
Icon={NumberedListIcon}
onClick={handleViewSessionData}
/>
)}
<MoreHelpRow
title="Quickstart"
description="Reopen the quickstart and tutorial file"