agent terminal: inline +/- diffs on Write and Edit tool calls

Write and Edit tool_use rows used to render as the bare file path. now
they're collapsed <details> blocks with the actual change inside —
Write shows every content line prefixed '+', Edit shows old_string as
'-' lines then new_string as '+' lines. summary carries the file path
+ counts ('→  Edit /foo · -3 +5'). lines colored via diff-add /
diff-del / diff-ctx; click to expand the full body.

renderFileWriteEdit returns null for any other tool so the existing
flat-row path (fmtToolUse) is untouched.
This commit is contained in:
müde 2026-05-15 20:23:22 +02:00
parent 2413d664a1
commit bc87ff80d2
3 changed files with 80 additions and 10 deletions

View file

@ -42,15 +42,6 @@ Pick anything from here when relevant. Cross-cutting design notes live in
`GET /api/state` (`status: "thinking" | "idle" | "compacting" |
"napping"`). JS just renders. Drops the
derive-from-events-and-pray code path.
- **Terminal: inline diffs for Write/Edit.** Today a `Write` /
`Edit` tool-use row just shows the file path. Render the actual
change inline in the terminal: for `Edit`, a small `+`/`-`
per-line diff between `input.old_string` and `input.new_string`;
for `Write`, the first few lines of `input.content` (it's all
"+"). Keep collapsed by default (`<details>` like the existing
tool_result rollups), expand to full diff on click. Color via
the same `.diff-add` / `.diff-del` classes the dashboard
approval diff already uses.
- **Terminal: `/model` slash command.** Operator-typeable model
override from the terminal. Depends on the model-override work
above; once an override mechanism exists, wire a `/model <name>`