Skip to content

feat(desktop): export transcript as Markdown (copy + download)#3126

Open
HUQIANTAO wants to merge 1 commit into
esengine:main-v2from
HUQIANTAO:feat/export-session
Open

feat(desktop): export transcript as Markdown (copy + download)#3126
HUQIANTAO wants to merge 1 commit into
esengine:main-v2from
HUQIANTAO:feat/export-session

Conversation

@HUQIANTAO
Copy link
Copy Markdown
Contributor

Many users paste Reasonix transcripts into GitHub issues, internal wikis, or design docs. There was no way to get a transcript out of the desktop app.

Add lib/exportSession.ts: a pure function that renders the items array to a Markdown document. Shape: title + metadata header, alternating '## User' / '## Assistant' sections, tool calls rendered as collapsible blocks, sub-agent calls nested under their parent, todo panels and exit_plan_mode cards skipped, compaction boundaries as blockquotes with collapsible summaries.

Two ways to use it from the topbar: single click copies the rendered Markdown to the clipboard; double click triggers a Blob download named reasonix-YYYY-MM-DD-HHMM.md.

@github-actions github-actions Bot added the v2 Go rewrite (1.x) — main-v2 branch, active development label Jun 4, 2026
Many users paste Reasonix transcripts into GitHub issues, internal
wikis, or design docs when filing a bug or sharing an investigation.
There was no way to get a transcript out of the desktop app — the
data lives in the Webview's React state and the on-disk session
files are a bespoke format.

Add lib/exportSession.ts: a pure function that renders the items
array to a Markdown document. The shape matches what a reader
expects:

  # <title>
  - model: <ref>
  - workspace: <cwd>
  - started: <iso>
  - ended: <iso>
  - duration: 12m 34s

  ## User
  ...

  ## Assistant
  ...

  ### `tool_name`
  ```json
  { ...args }
  ```
  **output**
  ```
  ...tool output...
  ```
  **error** (if any)
  ```
  ...error body...
  ```

Sub-agent calls (parentId-bearing tool items) are rendered nested
under the parent task call. Todo panels and exit_plan_mode cards
are skipped — they were already shown live in the UI and the
plan-mode approval card itself, so re-emitting them would
duplicate. Notices are ephemeral. Compaction boundaries are
emitted as a blockquote with a collapsible summary <details>.

Two ways to use it from the topbar:

  - Single click:  copies the rendered Markdown to the clipboard
                    (the common case — paste into Slack/GitHub).
  - Double click: triggers a Blob download named
                    reasonix-YYYY-MM-DD-HHMM.md. Works in the
                    Wails WebView (the OS save dialog surfaces
                    for the download).

A future SaveTextFile bridge binding can route to a native
SaveFileDialog without changing the rendering path.
@HUQIANTAO HUQIANTAO force-pushed the feat/export-session branch from dc98820 to 2308378 Compare June 4, 2026 16:52
@HUQIANTAO HUQIANTAO requested a review from SivanCola as a code owner June 4, 2026 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant