feat(toolpath-desktop): chat transcript + Edit-tool diffs#34
Merged
eliothedeman merged 1 commit intomainfrom Apr 22, 2026
Merged
feat(toolpath-desktop): chat transcript + Edit-tool diffs#34eliothedeman merged 1 commit intomainfrom
eliothedeman merged 1 commit intomainfrom
Conversation
… diffs
Adds a Claude-style chat transcript as the primary Preview view, with the
existing DAG hidden behind a "Graph view" toggle. Changes span the Tauri
frontend, shared conversation derivation, and the Claude-specific deriver.
Desktop / frontend
- ChatView.svelte: HEAD-path transcript. User messages render as
right-aligned road-wash bubbles, assistants as left-aligned water-wash
bubbles with model label. Tool invocations fold inline inside the
parent assistant bubble (Claude emits them as siblings that don't
advance HEAD; tree.ts now attaches them via the assistant's
toolInvocations field rather than scattering them as separate cards).
- Markdown rendering (marked + DOMPurify) for user / assistant / thinking
bodies, plus a compact variant used inside graph cards so headings,
code blocks and lists stay on scale with body text.
- StepTree.svelte: searchable sidebar with filter tabs (all / on HEAD /
dead ends), DFS tree connectors, actor-coloured names. Short UUIDs on
face, full id on title tooltip.
- Graph view now scrolls + zooms (CSS `zoom` for correct scrollbar
bounds), with a - / % / + toolbar and ⌘/ctrl + wheel.
- Role palette unified across chat + cards + tree: user → road, agent
→ water.
- pg-card: dropped the UUID header, serif message body with fade mask
+ line clamp, tool-use chips, kind-specific shapes for tool / system
steps.
- lib/classify.ts: shared step classification (user / assistant / tool
/ system) reading structural.type + role. Avoids the tree↔viz import
cycle.
Derivation / Rust
- toolpath-convo: new `file_write_diff(tool_name, input, path)` +
`unified_diff(path, before, after)` exported from derive.rs. Handles
Edit (old_string/new_string), Write (content), and MultiEdit (per-hunk
with `# edit N/total` headers). Conversation-path derivations populate
ArtifactChange.raw with the unified diff and keep structured
before/after/edits in structural.extra.
- toolpath-claude: tool.invoke steps for file-write tools (Edit / Write
/ MultiEdit / NotebookEdit) now also carry ArtifactChange.raw via
file_write_diff. MultiEdit added to the file_write category match arm.
- Tests: unit tests for Edit / Write / MultiEdit diff generation in
toolpath-convo; end-to-end test in toolpath-claude that exercises
derive_path with an Edit tool use.
|
🔍 Preview deployed: https://367b8171.toolpath.pages.dev |
This was referenced Apr 22, 2026
eliothedeman
added a commit
that referenced
this pull request
Apr 22, 2026
…tenChatHead Regression coverage for two pure-TS modules added in #34 that hit real bugs during development — both would have been caught by a ~20-line test. Wires up Vitest as the frontend test runner (Node environment, no jsdom needed for these pure-TS tests). classify.ts: five cases covering user / assistant / tool / system branches plus readStructural's preference for conversation-type payloads over sibling file artifacts. tree.ts: five cases covering flattenChatHead's HEAD-chain lineariser, the tool.invoke sibling attachment, the non-tool-sibling filter, the bare-Step fallback, and the detached-HEAD fallback. Closes #40
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.
Summary
Turns the Preview into a native-Claude-style chat transcript (primary) with the DAG graph hidden behind a toggle, and teaches the Claude/convo derivers to actually capture file-edit diffs so the UI has something to show.
tree.tsattaches them via a newtoolInvocationsfield instead of scattering them as loose cards). Markdown bodies viamarked+DOMPurify.−/%/+zoom (CSSzoomso the scroll container sees correct bounds),⌘/ctrl + wheelpinch-zoom, resizable pane.toolpath-convonow exportsfile_write_diff/unified_diff(viasimilar). Handles Edit (old/new_string), Write (content), MultiEdit (per-hunk with# edit N/totalheaders). Bothtoolpath-convo::derive_pathandtoolpath-claude::derive_pathpopulateArtifactChange.rawfor file-write tools, so inline diff blocks render in the chat + theInspectorside panel. Previously every file-edit tool was emitted withraw: None.lib/classify.ts(user / assistant / tool / system) breaks the import cycle betweenviz.tsandtree.tsand stays in lockstep withStructuralChange's#[serde(flatten)]shape.Test plan
cargo test --workspace(all green; adds 3 unit tests intoolpath-convofor Edit/Write/MultiEdit + an end-to-end test intoolpath-claudeprovingderive_pathemits a unified diff for an Edit tool use)cargo clippy -p toolpath-convo -- -D warningsbun run check(0 errors; 4 pre-existing a11y warnings inBrowseClaude.svelte/BrowsePi.svelte)bun run build