You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] Code review fails with "FileDiff: loadDiffFiles is required" when expandUnchanged is on (@pierre/diffs 1.5.2) #2264
Code review does not open. The page fails with this error:
Uncaught Error: FileDiff: loadDiffFiles is required to load full files for a partial diff
Setup: the review is opened from Pi with the diff type since-base and diffOptions.expandUnchanged: true in ~/.plannotator/config.json. The working tree is large, with about 80 changed paths, some staged and some unstaged.
In 1.5.2, FileDiff.loadFilesIfNecessary() throws when the diff is partial (isPartial and type change / rename-*) and options.loadDiffFiles is not set. It runs on render() when expandUnchanged is on, and also from expandHunk(), revealLine() and updateExternalDiff().
Plannotator never passes loadDiffFiles. It loads the full file itself through /api/file-content. When that does not work, the file stays partial: no content is returned, or the content does not match the patch ("file changed since the diff was captured"). With expandUnchanged on, the library then throws, and the page fails.
Workaround
Set "expandUnchanged": false in ~/.plannotator/config.json. Also clear the plannotator-diff-expand-unchanged key in the browser storage if it is set there. Clicking "expand" on such a file can probably still cause the same error.
Possible fix
Pass a loadDiffFiles callback that uses /api/file-content, or
do not set expandUnchanged (and hide the expand controls) for diffs that are still partial.
Same bug in another project:anomalyco/opencode#52263 (and #52213). OpenCode Desktop broke the same way after it moved to the same @pierre/diffs version.
I found the cause with an AI agent by reading the shipped review-editor.html bundle and @pierre/diffs/dist/components/FileDiff.js. I did not build a minimal repro.
Activity
PassionZale commentedon Oct 29, 2026