feat: CSV and Markdown export for the Prompts route - #10
Open
sebastientang wants to merge 1 commit into
Open
Conversation
Closes upstreams CSV/JSON export wishlist item. Adds web/export.js with four small helpers (toCSV, toMarkdown, copyToClipboard, downloadBlob) and wires Copy MD / Download CSV buttons into the Prompts route header. The helpers operate on a sections payload — the same shape can be reused for any future per-route or per-drawer export. CSV preserves the full prompt text via standard quoting; MD truncates pipes/newlines for clean GFM rendering. No new Python tests — this is JS-only utility code with manual smoke- test against the running dashboard.
muckybuzzwoo
added a commit
to muckybuzzwoo/token-dashboard
that referenced
this pull request
May 13, 2026
…e Prompts route Integrates nateherkai#10
muckybuzzwoo
added a commit
to muckybuzzwoo/token-dashboard
that referenced
this pull request
May 22, 2026
- README clone URL now points at the fork (was upstream). - "The 7 tabs" → "The 8 tabs" — adds RTK and updates the Skills entry to describe the new "You ran" / "Claude invoked" split. Settings section mentions Team plans (PR nateherkai#15) and runtime .claude-folder switching (PR nateherkai#7). - First-run scan-time estimate dropped from 20–60s to 5–10s to reflect the PR nateherkai#18 batched-insert scanner. Prompts entry now mentions the CSV / Markdown export (PR nateherkai#10). - FORK_NOTES.md gains a "Last updated" line at the top pointing at the commits page as the running change log.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes upstream's "CSV or JSON export of any route" wishlist item from
CONTRIBUTING.md.What this adds
web/export.js(new, 60 lines) — four small helpers:toCSV(sections)— RFC-4180-style escaping (quotes, commas, newlines)toMarkdown(title, sections)— pipe-and-newline-safe GFM tablescopyToClipboard(text)— async, returnstrue/falseso the caller can show feedbackdownloadBlob(filename, mime, text)— anchor-based download withURL.revokeObjectURLcleanupCopy MDandDownload CSVbuttons next to the existing sort tabs. Copy MD shows transient "Copied!" feedback. Download CSV exports the currently sorted set with the file nameprompts-<sort>-<YYYY-MM-DD>.csv.The helpers operate on a
sectionspayload ([{ heading, columns, rows }]) so the same shape can be reused later for sessions / projects / skills exports without touchingexport.js.Why prompts first
Prompts are the route most useful to take into a spreadsheet — full text, model, tokens, cost, session. Other routes can follow in subsequent PRs once the helper shape is reviewed.
Tests
JS-only utility code with manual smoke testing against the running dashboard:
The repo doesn't ship a JS test runner, so I didn't add one. Happy to add a Python integration test that hits
/api/promptsand asserts the JSON shapeweb/export.jsconsumes, if there's a preferred shape.