Repository navigation
Conversation
The edit permission read only metadata.files[0], so approving an apply_patch touching several files showed one diff. Expose all files and render each one.
Read the label from the file entry (file, filePath, relativePath) instead of the positional resource, which was wrong when a move made resources longer than files. Show the mini footer diffs with the same per-file header, and fall back to the combined diff when an entry has no patch.
There was a problem hiding this comment.
This looks good. I ran the reproduction script from #55337 on the base and on this branch, both from source. On the base the prompt read Edit src/alpha.ts and showed only alpha's diff. With this change it reads Edit 3 files and shows each file's diff under its own path label, with a scrollbar for the rest. The metadata it reads (file and patch on each entry) matches what the patch tool sends, including the target path for moves. The new tests and the nearby permission tests pass, and typecheck in packages/tui passes.
Public API: unchanged. The new files field on PermissionPresentation is internal to the TUI.
One concern, noted inline: in mono mode the per-file labels are dropped, so several diffs are shown with nothing saying which file each belongs to.
There was a problem hiding this comment.
In mono mode this joins every file's diff into lines without the file path, so a multi-file prompt shows several diffs with nothing saying which file each one is. The title only says Edit N files. Could each diff be preceded by its file path, as the non-mono rendering does? Otherwise mono users still can't tell which files they are approving.
There was a problem hiding this comment.
Pushed 6eb7374: mono-mode multi-file edit permission prompts now show each file's path above its diff, as the non-mono view does.
In mono mode the multi-file edit prompt listed every diff with nothing saying which file it belonged to. Put the file path before each diff, as the non-mono rendering does.



Issue for this PR
Closes #55337
Type of change
What does this PR do?
The edit permission prompt read only
metadata.files[0], so approving anapply_patchthat touched several files showed a single diff. It now exposes every file and renders each diff under its own file label (also in the mini footer), falling back to the combined diff when an entry has no patch.How did you verify your code works?
Added tests in
packages/tui/test; before the change 4 of 5 failed, after it all 5 pass on the committed HEAD.AI-assisted (Claude Code); I reviewed and tested the change.
Screenshots / recordings
None; I did not capture a recording.
Checklist