Skip to content

feat(desktop): add markdown format option to session export - #10703

Merged
DOsinga merged 3 commits into
aaif-goose:mainfrom
harrykamboj1:feat/session-export-markdown
Aug 4, 2026
Merged

feat(desktop): add markdown format option to session export#10703
DOsinga merged 3 commits into
aaif-goose:mainfrom
harrykamboj1:feat/session-export-markdown

Conversation

@harrykamboj1

@harrykamboj1 harrykamboj1 commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Session History's Download action only produced JSON, which is useful for re-import but not for reading or sharing a transcript. This adds a format picker (JSON / Markdown) to that button and wires Markdown through to the same formatter the CLI already uses for goose session export --format markdown, so both paths produce identical output.

The formatter lived in goose-cli, which the ACP server (in the goose crate) cannot depend on without a dependency cycle, so it moves to goose/src/session/export_markdown.rs and both crates now share it. The move is a pure relocation — git records it as a 92% rename and the 33 unit tests move unchanged.

Changes:

  • Shared formatter: goose-cli/src/session/export.rsgoose/src/session/export_markdown.rs, alongside export_session_to_markdown from goose-cli/src/commands/session.rs. No Cargo.toml edits.
  • ACP: ExportSessionRequest gains a format field (SessionExportFormat, #[serde(default)], defaults to Json), so clients omitting it still receive JSON. Regenerated acp-schema.json and ui/sdk/src/generated/.
  • New SessionManager::export_session_markdown. export_session and the SessionStorage trait are untouched, so Nostr sharing and diagnostics are unaffected.
  • Desktop: the Download button becomes a dropdown, setting the right MIME type and file extension per format.
  • i18n: three new keys added to en.json and all 15 translated catalogs.

Notes for reviewers:

  • Markdown uses the user-visible projection (Conversation::user_visible_messages()), matching CLI output byte-for-byte and excluding assistant-only content.
  • Markdown is a read-only artifact by design — Import Session accepts JSON formats only, which the menu wording reflects.
  • Empty sessions export a "no messages" placeholder over ACP rather than erroring. CLI behavior is unchanged.
  • The 15 locale translations are derived from existing export wording in each catalog (e.g. sessions.toast.exported, sessions.action.export) so punctuation stays language-correct. A native-speaker glance at ko and hi would be welcome.

Testing

Automated:

  • cargo test -p goose --lib session::export_markdown — 33 relocated tests plus a new markdown_export_handles_empty_conversation
  • cargo test -p goose-sdk-types --lib custom_requests — asserts a request without format defaults to JSON, and that markdown deserializes
  • cargo test -p goose-cli --lib, cargo fmt --check, cargo clippy --workspace --all-targets -- -D warnings
  • just check-acp-schema — generated files in sync with the Rust types
  • pnpm run lint:check (typecheck + eslint + i18n-check + locale validation across all 15 locales) and pnpm run test:run — 592 passing

Manual:

  • Exported the same session as Markdown from the UI and via goose session export --format markdown, then diffed the two files
  • Verified JSON export is unchanged, "View JSON" in the in-session menu still works (proves the default reached the old call site), and an empty session exports the placeholder without an error toast

Related Issues

Fixes #10253
Discussion: N/A

Screenshots/Demos (for UX changes)

Screenshot 2026-07-26 at 6 45 12 PM

@The-Best-Codes

Copy link
Copy Markdown
Collaborator

Merge conflicts!

@alexhancock alexhancock self-assigned this Jul 30, 2026
@DOsinga
DOsinga enabled auto-merge August 4, 2026 19:46
@DOsinga
DOsinga disabled auto-merge August 4, 2026 20:04
@DOsinga
DOsinga added this pull request to the merge queue Aug 4, 2026
Merged via the queue into aaif-goose:main with commit 06f218c Aug 4, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Copy conversation as Markdown from the chat top menu (Desktop)

4 participants