Changesets · Branches · Tags · Compare
| Changeset | 9fdff64e54855db3d22d5c55cbea0fa99ffc88be283532508b75d370caa89570 |
|---|---|
| Author | uinstinct <61635505+uinstinct@users.noreply.github.com> · 2025-07-15 11:54 +05:30 |
| Committer | uinstinct <61635505+uinstinct@users.noreply.github.com> · 2025-07-15 11:54 +05:30 |
| Parents | 10ed2343a94a |
6 files changed
modified core/core.ts +4 −0
| @@ -292,6 +292,10 @@ | ||
| 292 | 292 | historyManager.clearAll(); |
| 293 | 293 | }); |
| 294 | 294 | |
| 295 | + on("history/getSessionData", (msg) => { | |
| 296 | + return historyManager.getSessionData(msg.data.id); | |
| 297 | + }); | |
| 298 | + | |
| 295 | 299 | on("devdata/log", async (msg) => { |
| 296 | 300 | void DataLogger.getInstance().logDevData(msg.data); |
| 297 | 301 | }); |
modified core/protocol/core.ts +1 −0
| @@ -67,6 +67,7 @@ | ||
| 67 | 67 | "history/load": [{ id: string }, Session]; |
| 68 | 68 | "history/save": [Session, void]; |
| 69 | 69 | "history/clear": [undefined, void]; |
| 70 | + "history/getSessionData": [{ id: string }, string]; | |
| 70 | 71 | "devdata/log": [DevDataLogEvent, void]; |
| 71 | 72 | "config/addOpenAiKey": [string, void]; |
| 72 | 73 | "config/addModel": [ |
modified core/protocol/passThrough.ts +1 −0
| @@ -15,6 +15,7 @@ | ||
| 15 | 15 | "history/load", |
| 16 | 16 | "history/save", |
| 17 | 17 | "history/clear", |
| 18 | + "history/getSessionData", | |
| 18 | 19 | "devdata/log", |
| 19 | 20 | "config/addModel", |
| 20 | 21 | "config/newPromptFile", |
modified core/util/history.ts +13 −0
| @@ -95,6 +95,19 @@ | ||
| 95 | 95 | } |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | + getSessionData(sessionId: string): string { | |
| 99 | + try { | |
| 100 | + const sessionFile = getSessionFilePath(sessionId); | |
| 101 | + if (!fs.existsSync(sessionFile)) { | |
| 102 | + throw new Error(`Session file ${sessionFile} does not exist`); | |
| 103 | + } | |
| 104 | + const fileContent = fs.readFileSync(sessionFile, "utf8"); | |
| 105 | + return JSON.stringify(JSON.parse(fileContent), null, 2); | |
| 106 | + } catch (e) { | |
| 107 | + throw new Error(`Error reading session data: ${e}`); | |
| 108 | + } | |
| 109 | + } | |
| 110 | + | |
| 98 | 111 | save(session: Session) { |
| 99 | 112 | // Save the main session json file |
| 100 | 113 | // Explicitely rewriting here to influence the written key order in the file! |
modified extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/constants/MessageTypes.kt +1 −0
| @@ -81,6 +81,7 @@ | ||
| 81 | 81 | "history/load", |
| 82 | 82 | "history/save", |
| 83 | 83 | "history/clear", |
| 84 | + "history/getSessionData", | |
| 84 | 85 | "devdata/log", |
| 85 | 86 | "config/addModel", |
| 86 | 87 | "config/newPromptFile", |
modified gui/src/pages/config/HelpCenterSection.tsx +30 −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,25 @@ | ||
| 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 | + try { | |
| 26 | + const sessionData = await ideMessenger.request("history/getSessionData", { | |
| 27 | + id: currentSession.id, | |
| 28 | + }); | |
| 29 | + | |
| 30 | + if (sessionData.status === "success") { | |
| 31 | + await ideMessenger.request("showVirtualFile", { | |
| 32 | + name: "currentSessionData.json", | |
| 33 | + content: sessionData.content, | |
| 34 | + }); | |
| 35 | + } | |
| 36 | + } catch (error) { | |
| 37 | + console.error("Error viewing session data:", error); | |
| 38 | + } | |
| 39 | + }; | |
| 40 | + | |
| 21 | 41 | return ( |
| 22 | 42 | <div className="py-5"> |
| 23 | 43 | <h3 className="mb-4 mt-0 text-xl">Help center</h3> |
| @@ -68,6 +88,15 @@ | ||
| 68 | 88 | onClick={() => navigate("/stats")} |
| 69 | 89 | /> |
| 70 | 90 | |
| 91 | + {currentSession.history.length > 0 && !currentSession.isStreaming && ( | |
| 92 | + <MoreHelpRow | |
| 93 | + title="View current session history" | |
| 94 | + description="Open the current chat session file for troubleshooting" | |
| 95 | + Icon={NumberedListIcon} | |
| 96 | + onClick={handleViewSessionData} | |
| 97 | + /> | |
| 98 | + )} | |
| 99 | + | |
| 71 | 100 | <MoreHelpRow |
| 72 | 101 | title="Quickstart" |
| 73 | 102 | description="Reopen the quickstart and tutorial file" |