Changesets · Branches · Tags · Compare
| Changeset | beec9aab9cdf5b4d73dc04ab3c86f819b74e856168e946a6f163f2989b79c302 |
|---|---|
| Author | Dallin Romney <dallinromney@gmail.com> · 2025-07-18 11:48 +02:00 |
| Committer | GitHub <noreply@github.com> · 2025-07-18 11:48 +02:00 |
| Parents | 11fa65088c6a, 01051dd917b5 |
1 file changed
modified gui/src/pages/config/HelpCenterSection.tsx +26 −1
| @@ -1,13 +1,14 @@ | ||
| 1 | 1 | import { |
| 2 | 2 | ArrowTopRightOnSquareIcon, |
| 3 | 3 | DocumentArrowUpIcon, |
| 4 | + NumberedListIcon, | |
| 4 | 5 | PaintBrushIcon, |
| 5 | 6 | TableCellsIcon, |
| 6 | 7 | } from "@heroicons/react/24/outline"; |
| 7 | 8 | import { useContext } from "react"; |
| 8 | 9 | import { useNavigate } from "react-router-dom"; |
| 9 | 10 | import { IdeMessengerContext } from "../../context/IdeMessenger"; |
| 10 | -import { useAppDispatch } from "../../redux/hooks"; | |
| 11 | +import { useAppDispatch, useAppSelector } from "../../redux/hooks"; | |
| 11 | 12 | import { setOnboardingCard } from "../../redux/slices/uiSlice"; |
| 12 | 13 | import { saveCurrentSession } from "../../redux/thunks/session"; |
| 13 | 14 | import { ROUTES } from "../../util/navigation"; |
| @@ -18,6 +19,21 @@ | ||
| 18 | 19 | const navigate = useNavigate(); |
| 19 | 20 | const dispatch = useAppDispatch(); |
| 20 | 21 | |
| 22 | + const currentSession = useAppSelector((state) => state.session); | |
| 23 | + | |
| 24 | + const handleViewSessionData = async () => { | |
| 25 | + const sessionData = await ideMessenger.request("history/load", { | |
| 26 | + id: currentSession.id, | |
| 27 | + }); | |
| 28 | + | |
| 29 | + if (sessionData.status === "success") { | |
| 30 | + await ideMessenger.request("showVirtualFile", { | |
| 31 | + name: `${sessionData.content.title}.json`, | |
| 32 | + content: JSON.stringify(sessionData.content, null, 2), | |
| 33 | + }); | |
| 34 | + } | |
| 35 | + }; | |
| 36 | + | |
| 21 | 37 | return ( |
| 22 | 38 | <div className="py-5"> |
| 23 | 39 | <h3 className="mb-4 mt-0 text-xl">Help center</h3> |
| @@ -68,6 +84,15 @@ | ||
| 68 | 84 | onClick={() => navigate("/stats")} |
| 69 | 85 | /> |
| 70 | 86 | |
| 87 | + {currentSession.history.length > 0 && !currentSession.isStreaming && ( | |
| 88 | + <MoreHelpRow | |
| 89 | + title="View current session history" | |
| 90 | + description="Open the current chat session file for troubleshooting" | |
| 91 | + Icon={NumberedListIcon} | |
| 92 | + onClick={handleViewSessionData} | |
| 93 | + /> | |
| 94 | + )} | |
| 95 | + | |
| 71 | 96 | <MoreHelpRow |
| 72 | 97 | title="Quickstart" |
| 73 | 98 | description="Reopen the quickstart and tutorial file" |