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.
Edit and write tool cards now render their Input as a line diff instead of one plain text block. Removed lines show with a minus prefix and a removed tone, added lines show with a plus prefix and an added tone, and unchanged lines stay plain. A write renders every file line as added.
Part of #2
Closes #39
What changed:
src/renderer/timeline.tscarries the structured payload on the tool entry. Edit keeps its old and new text and write keeps its content as new text against an empty old side, for both saved messages and live tool events. The plain input text is unchanged, so summaries and copying keep their current behaviour.src/renderer/components/WorkbenchControls.tsxadds a diff section for edit and write cards. It computes a line diff with a shared prefix check that falls back to a plain removed-then-added listing for very large inputs, keeps the Copy input button copying the exact plain input text, and keeps the long-text Show more and Show less toggle. Other tools keep the plain Input section.src/renderer/workbench.cssadds the diff row styles using the existing success and error tokens.Verified:
bun install --frozen-lockfilepassedbun run lintpassed, 0 warnings and 0 errorsbun run typecheckpassed across renderer, main, and preload configsbun run test:unitpassed, 74 tests. New tests arecarries old and new text for an edit tool call,carries write content as new text against an empty old side, andtool_execution_start carries edit old and new text.bun run test:integrationshows the new ToolCard tests passing, 40 passed with 6 failures inSettingsView.test.tsx. Those 6 failures reproduce on cleanorigin/mainat 9c0a66b in this environment with the same localStorage error, so they are pre-existing here and not caused by this change. Focused runbunx vitest run --project integration tests/integration/ToolCard.test.tsxpassed, 7 tests.mise run buildpassed aftermise trustfor this worktreebun 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 previous run on this machine. Noted once here and not retried.Proof:
.tmp/proof/tool-card-diff.png. The capture log recordedhasAdd: 1,hasDel: 1,hasContext: 1,hasCopyInput: 1,addText: +const after = 2;, anddelText: -const before = 1;. The screenshot shows the context line plain, the removed line in the removed tone with a minus prefix, the added line in the added tone with a plus prefix, and both Copy buttons. The PNG is kept under.tmp/proof/locally and is not committed, matching the scratch-capture rule for this repo. The temporary proof page was removed before committing.ToolCard.test.tsxarerenders edit input as a diff with added, removed, and context lines,renders write input as added lines, andcopies the exact plain input text from a diff card.Known gaps and follow-ups: