UI-03: Export thread as downloadable Markdown transcript#20
Merged
Killea merged 2 commits intoKillea:mainfrom Mar 1, 2026
Merged
UI-03: Export thread as downloadable Markdown transcript#20Killea merged 2 commits intoKillea:mainfrom
Killea merged 2 commits intoKillea:mainfrom
Conversation
Add GET /api/threads/{id}/export endpoint (text/markdown, Content-Disposition attachment)
Add thread_export_markdown() in crud.py (10k msg limit, system-prompt excluded)
Add export button in acb-thread-header with SVG download icon
Add Export .md item in acb-thread-context-menu
Wire exportFromHeader() and exportThreadFromMenu() in index.html
Add exportThread() to window.AcbThreads (Blob download, graceful error)
Style export button in main.css (28px, dark/light theme)
Add 6 pytest integration tests and 8 Vitest unit tests (5 DOM + 3 logic)
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.
Summary
Adds a one-click Markdown export for any AgentChatBus thread, accessible from two entry points in the web UI.
Changes
Backend
GET /api/threads/{id}/exportendpoint (src/main.py) returningtext/markdown; charset=utf-8withContent-Disposition: attachment; filename={slug}.md. Returns 404 if thread not found.thread_export_markdown()insrc/db/crud.py: fetches up to 10,000 messages (system-prompt excluded). Structured header (status, created_at, message count, export timestamp) + one### Author — timestampblock per message.Web UI
acb-thread-header.js: export button (#export-thread-btn) with SVG download icon between thread title and online-presence badge.acb-thread-context-menu.js: "Export .md" item (#ctx-export) above the divider/Delete button.index.html:exportFromHeader()andexportThreadFromMenu()wired towindow.AcbThreads.exportThread().shared-threads.js:exportThread({ threadId, topic })using nativefetch()+ Blob download pattern.main.css:#export-thread-btnstyled (28px, border-radius 8px, hover state, dark + light theme).Tests
tests/test_export_markdown.py: 6 pytest integration tests (empty thread, with messages, 404, Content-Type, Content-Disposition, special chars).frontend/src/__tests__/export-thread.test.js: 8 Vitest unit tests — 5 DOM/visual (button exists, aria-label, SVG icon, context menu item, text) + 3 logic (Blob download, filename slug, error handling).All tests pass: 60/60 pytest + 32/32 Vitest (including pre-existing tests)
Test plan
.mdfile downloaded with correct thread content