Repository navigation
Conversation
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.
The history Export button now writes a self-contained markdown file. Tool entries keep their full input beside the output with the same Done, Failed, and Running wording as the tool cards, assistant thinking is kept, and the file opens with the session title, working folder, and model before downloading under a title-and-date filename.
Part of #4
Closes #41
What changed:
src/renderer/export-session.tsadds a puresessionExportMarkdownandsessionExportFilename. Tool sections use the card status wording, fence input and output with a fence that widens past any backticks inside, and keep theNo input.andNo output.wording for empty sides. User text sits under You, assistant text and thinking sit under Pi, and an empty selection says so instead of writing a bare heading.src/renderer/App.tsxbuilds the export through the helper with the previewed session title, working folder, and model, and downloads under the generated filename. The blob, anchor, and revoke flow are unchanged.tests/unit/export-session.test.tsadds seven tests covering a full document match, failed and running status, empty input and output, backtick fence widening, the empty selection, and filename slugs with their fallback.Verified:
bun install --frozen-lockfilepassedbun run lintpassed, 0 warnings and 0 errorsbun run typecheckpassed across renderer, main, and preload configsbun run test:unitpassed, 81 tests. The new tests arewrites the full conversation with context and tool input,marks failed and running tools with the card wording,keeps an empty input and output readable,widens the fence when the output holds backticks,handles an empty selection and a blank title,builds the name from the title and export day, andfalls back when the title has no usable words.mise exec -- bun run test:integrationpassed, 46 tests. A bare-shell run shows 6 failures inSettingsView.test.tsxfrom a localStorage setup error, and the same 6 fail on cleanorigin/mainat 1a1c91e in this environment, so they are pre-existing here and not caused by this change.mise run buildpassed aftermise trustfor this worktree, ending in a successful Vite bundle.bun run test:e2eblocked in this environment. Electron fails to launch and all 43 e2e tests skip with 5 failed files and 3 errors, matching the earlier runs on this machine. Noted once here and not retried.Proof:
bun /tmp/proof-export.tsprinted the exact file a user downloads. The transcript sits under.tmp/proof/export-sample.txtlocally and the sample output is pasted in full below.Known gaps and follow-ups:
diffLinesin a later slice if reviewers want it.