Code change
The agent proposes a code change and the person reads it before anything is written: each file’s diff in grey, with its line numbers, and one key that says how many files it will write.
Halden Freight’s invoices come out a cent off now and then. Can you fix it?
Use when
The agent wants to change code, config or any text file it can write. The person should read the change and decide, so nothing lands in their files on the agent’s word alone.
What it does
- Names the change and where it would be written: “Round VAT on each line”, “billing-api · main”.
- Shows each file it touches as a tab with how many lines it gains and loses, “invoice.ts +6 −2”; a raised thumb slides to the file shown, and the box eases to that file’s height.
- Draws the diff in grey, never red and green, which mean failed and done in this kit: lines taken out are soft with a “−”, lines added are white with a “+” on a faint wash, and the lines kept sit between the two.
- Folds the lines the change leaves alone into one row, “12 unchanged lines”, that opens them in place; its chevron points down and flips.
- Long lines wrap under themselves instead of running off the edge, so every character of the change stays in view on a phone.
- The white key says how many files it writes, “Apply 2 files”, says “Applying…” while it writes them, and never greys.
- Applied, the keys give way to a green check, “Applied”, the files by name, and Undo.
- If a file changed since the diff was written, nothing is written: a red “!” says which file, with one white key, “Show the new file”.
- A screen reader hears “Added:” or “Removed:” before each changed line, and each change of the card once.