Skip to content

fix(tui): show every file in a multi-file edit permission - #67535

Open
ambujone wants to merge 1 commit into
anomalyco:devfrom
ambujone:fix/multi-file-permission-diff
Open

ambujone wants to merge 1 commit into
anomalyco:devfrom
ambujone:fix/multi-file-permission-diff

Conversation

@ambujone

@ambujone ambujone commented Dec 1, 2026 •

Copy link
Copy Markdown

Issue for this PR

Fixes #55337

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

This picks up #55344 by @drakeo338, which the stale-PR bot closed, and builds on its approach.

The edit permission prompt read only metadata.files[0], so an apply_patch touching several files asked "Edit " and showed one diff. The others were approved without being shown.

permission.ts now returns each file's own diff, and the session prompt, the mini footer (including mono) and the Rust mini footer render one diff per file under its path. The combined patch can't be shown instead, because the diff renderer draws only the first file of a multi-file patch. Single-file edits look the same as before.

How did you verify your code works?

From packages/tui: the four permission test files (52 pass; 5 fail without the fix) and the full suite (3 failures in session-find and dialog-shell-output also fail on dev). From packages/cli-rs: cargo test -p opencode-ui -p opencode-mini, with two new tests (one existing editor test fails the same way on dev), clippy and fmt. bun run check passed.

Screenshots / recordings

No screenshot; the render tests above cover the multi-file layout.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Prepared with Claude Code.

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I reproduced the bug on the base: a four-file patch asked "Edit src/alpha.ts" and showed only alpha's diff. With this change the prompt reads "Edit 4 files" and shows each file's path with its own diff in a scrolling area. Single-file edits look the same as before. The TUI permission tests pass (52) and tsc -b in packages/tui is clean. I couldn't run the Rust tests because cargo isn't installed here, but the Rust code mirrors the TypeScript change.

Public API: unchanged. PermissionPresentation only gains an optional files field, and it is internal to the TUI.

No blocking concerns.

Before

After

The permission prompt for an edit read only metadata.files[0], so a patch
touching several files showed one diff under "Edit <first file>". Expose
each file's own diff and render them under their paths, in the session
prompt, the mini footer (including mono) and the Rust mini footer. The
combined diff can't be used instead because the diff renderer only draws
the first file of a multi-file patch.

Fixes anomalyco#55337

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-authored-by: drakeo338 <[email protected]>
@ambujone
ambujone force-pushed the fix/multi-file-permission-diff branch from fa7332e to 4540306 Compare December 3, 2026 13:30

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This push only rewrites the commit message to credit @drakeo338. The code is identical to what I reviewed before, so my earlier review still stands and I have no new concerns. Public API: unchanged.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Apply Patch / Edit permission view only shows the first file

1 participant