Skip to content

diff: the dialog opens every file it lists, and says nothing when closed - #98555

Merged
poteat merged 4 commits into
mainfrom
poteat/diff-inline-earlier-files
Oct 1, 2026
Merged

poteat merged 4 commits into
mainfrom
poteat/diff-inline-earlier-files

Conversation

@poteat

@poteat poteat commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

Summary

TLDR: in the /diff dialog every listed file opens its diff; closing the dialog prints nothing

Notes

Without the fullscreen layout /diff opens a dialog that lists every changed file. A file edited before the session began, or a test or generated file such as a lockfile, stayed on "Loading diff…" when opened there. Closing the dialog with Esc printed "Diff dialog dismissed" under the plugin's name.

  • The dialog lists every changed file, but hunks were read only for the rows the docked pane draws: the session's files, and the earlier ones once their section is opened. The dialog has no such section to open, so those rows were never read.
  • Hunks are now read for the rows the pane's seat lists. Docked, nothing changes. In the dialog that is the five rows in view, read again as the selection moves the view; a row already read, or being read, is not asked for again.
  • Walking a dialog of twelve files from the first row to the last starts git eight times for hunks: once for the first five rows, once for each row that comes into view. No file is read twice.
  • A person closing the dialog prints nothing. /diff typed while the dialog is open still answers "Diff dialog dismissed".
  • The oldFiles test fixture takes the file names it answers for; its three existing callers are unchanged.

Test Plan

  • claude plugin test mods/diff passes: 210 pass, 0 fail
  • Without the fullscreen layout, in a repository with one file edited before the session and one after: /diff, move to the earlier file, Enter: its hunk shows
  • The same with a lockfile among the changes: its hunk shows
  • Twelve changed files, the selection walked from the first row to the last, Enter and Esc on the first, sixth and last: each shows its hunk; eight git processes for hunks, no file asked twice
  • Esc on the dialog prints nothing; /diff typed over it answers "Diff dialog dismissed"
  • With the fullscreen layout: the pane docks, a session file shows its hunk, the earlier files show theirs once "(show)" is pressed
  • A git that fails for one row: that row reads "Diff unavailable", the next row still opens

Revert-proof: 3 new tests fail with the two modules' changes reverted (the mod's own suite, run against the unchanged modules)

Changelog

@poteat
poteat merged commit 6160717 into main Oct 1, 2026
3 checks passed
konsta95 added a commit to konsta95/claude-code that referenced this pull request Oct 2, 2026
main now has poteat's anthropics#98555 as a squash commit (6160717) and two
changelog updates. anthropics#98555 and the bundle both change register.ts and
tests/fixtures/index.ts, and the merge has no conflict. In the close
handler the bundle's bookkeeping and anthropics#98555's dialog change sit two
lines apart; the result keeps both.

The merged tree passes the diff suite on Claude Code 2.1.284, 2.1.285,
2.1.286 and 2.1.287 (409 pass, 0 fail on each), the mods typecheck, and
the other mods' suites on 2.1.287.

Co-authored with a harness running Claude and Codex teams.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: a8a0b1ef-4a1b-460a-a37b-2b32fa7f2909
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.

2 participants