Skip to content

feat: add session PDF and image export#3572

Closed
SivanCola wants to merge 1 commit into
main-v2from
codex/session-export-save-dialog
Closed

feat: add session PDF and image export#3572
SivanCola wants to merge 1 commit into
main-v2from
codex/session-export-save-dialog

Conversation

@SivanCola

Copy link
Copy Markdown
Collaborator

Summary

  • Add export menu entries for PDF and PNG image alongside Markdown and JSON
  • Render session Markdown into a dedicated export surface for PDF/image output
  • Use native save dialogs so users can choose the export path before files are generated or written

Testing

  • npm run build (desktop/frontend)
  • go test -run '^$' . (desktop)

Notes

  • Full go test ./... under desktop/ was not used as a gate because existing TestSetEffortPersistsAndAutoClears fails on the current branch with provider effort persistence output unrelated to this change.

@SivanCola SivanCola requested a review from esengine as a code owner June 8, 2026 10:07
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@github-actions github-actions Bot added desktop Wails desktop app (desktop/**) v2 Go rewrite (1.x) — main-v2 branch, active development labels Jun 8, 2026
@SivanCola SivanCola force-pushed the codex/session-export-save-dialog branch from c96651a to 26cf155 Compare June 8, 2026 10:16

@esengine esengine left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice — rolling the PDF writer by hand (raster XObject + per-page CM offset for pagination) and rasterizing via SVG foreignObject instead of pulling in html2canvas + jspdf keeps us dependency-free, which is exactly the right call for this project. The AppBindings interface + mock are both updated, both locales are in sync, safeExportFilename guards path traversal, and the honest note about the unrelated pre-existing test failure is appreciated.

Merging. Two follow-ups worth a quick pass later (neither blocks):

  1. Surface export failures to the user. The whole export is wrapped in catch (err) { console.error(...) }, so on a user-initiated action a failure is invisible — they click Export and nothing happens. A small notice/toast on failure would fit our "don't silently swallow" stance.

  2. Verify the foreignObject path on older WebKit + KaTeX. Rendering a cloned surface through <foreignObject> to canvas is known to go blank or drop external resources on older Safari/WebKit (we've been bitten on macOS ≤12 before), and KaTeX's woff2 fonts referenced from the inlined CSS won't be fetched inside the SVG sandbox, so math may fall back to box glyphs. Worth a spot-check on a mac build and, if it's an issue, embedding the KaTeX font as a data URL.

Thanks!

@esengine esengine enabled auto-merge (squash) June 11, 2026 01:45
@esengine

Copy link
Copy Markdown
Owner

Approved and auto-merge is armed, but GitHub now shows a conflict — a couple of sibling desktop PRs (#3886, #3888) just landed and touched App.tsx and the locale files this PR also edits. Could you rebase onto the latest main-v2? It should merge automatically once the conflict is resolved. Thanks!

auto-merge was automatically disabled June 11, 2026 03:04

Pull request was closed

@SivanCola SivanCola deleted the codex/session-export-save-dialog branch June 11, 2026 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

desktop Wails desktop app (desktop/**) v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants