From bbdd58cc9341bfdb2e9464d9d9afa1788ed342a5 Mon Sep 17 00:00:00 2001 From: Philip Fung <1054593+philfung@users.noreply.github.com> Date: Fri, 13 Sep 2024 12:02:11 -0700 Subject: [PATCH] adding timestamp to the Exported Task markdown file (#293) per feature request https://github.com/saoudrizwan/claude-dev/issues/278 this makes the file more readable/parseable. also added minor fix in README for debugging. Test Plan: 1. Launch Debug Instance of VSCode 2. Went to Extension, clicked on a recent Task, clicked "Export" 3. Opened saved export file, saw properly formatted timestamp above each User/Assistant action. Co-authored-by: Philip Fung --- README.md | 2 +- src/utils/export-markdown.ts | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1140196..09c8cd4 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ To build Claude Dev locally, follow these steps: ```bash npm run install:all ``` -4. Launch by pressing `F5` to open a new VSCode window with the extension loaded. (You may need to install the [esbuild problem matchers extension](https://marketplace.visualstudio.com/items?itemName=connor4312.esbuild-problem-matchers) if you run into issues building the project.) +4. Launch by pressing `F5` (or `Run`->`Start Debugging`) to open a new VSCode window with the extension loaded. (You may need to install the [esbuild problem matchers extension](https://marketplace.visualstudio.com/items?itemName=connor4312.esbuild-problem-matchers) if you run into issues building the project.) ## Reviews diff --git a/src/utils/export-markdown.ts b/src/utils/export-markdown.ts index b82d206..3bf7df1 100644 --- a/src/utils/export-markdown.ts +++ b/src/utils/export-markdown.ts @@ -7,6 +7,7 @@ export async function downloadTask(dateTs: number, conversationHistory: Anthropi // File name const date = new Date(dateTs) const month = date.toLocaleString("en-US", { month: "short" }).toLowerCase() + const monthLong = date.toLocaleString("en-US", { month: "long" }) const day = date.getDate() const year = date.getFullYear() let hours = date.getHours() @@ -24,8 +25,8 @@ export async function downloadTask(dateTs: number, conversationHistory: Anthropi const content = Array.isArray(message.content) ? message.content.map(formatContentBlockToMarkdown).join("\n") : message.content - - return `${role}\n\n${content}\n\n` + const timestamp = `# ${monthLong} ${day},${year} ${hours}:${minutes}:${seconds}${ampm}`; + return `${timestamp}\n${role}\n\n${content}\n\n` }) .join("---\n\n")