| … | … | @@ -505,14 +505,13 @@ export default function DiffPanel({ | |
| 509 | - | const diffFileKeys = renderableFileEntries.map((file) => file.fileKey); | |
| 508 | + | const renderableFileEntries = renderableFiles.map((file, index) => ({ | |
| 509 | + | ...getCachedFileEntry(file), | |
| 510 | + | fileKey: diffFileKeys[index]!, | |
🟡 Medium components/DiffPanel.tsx:510
When a refresh crosses the preview truncation threshold, collapsed files lose their saved fold state and expand. diffFileKeys[index] uses placeholder identities such as ...\0change for truncated previews, while the same file has a parsed identity such as ...\0new in a small preview, so the stored key no longer matches. Normalize file identities across both preview modes or migrate the saved keys when the mode changes.
🤖 Copy this AI Prompt to have your agent fix this:
| 1 | In file @apps/web/src/components/DiffPanel.tsx around line 510: |
| 2 | |
| 3 | When a refresh crosses the preview truncation threshold, collapsed files lose their saved fold state and expand. `diffFileKeys[index]` uses placeholder identities such as `...\0change` for truncated previews, while the same file has a parsed identity such as `...\0new` in a small preview, so the stored key no longer matches. Normalize file identities across both preview modes or migrate the saved keys when the mode changes. |
Confirmed. Fixed in 1b1b9dad62 by changing the approach: collapsed files load in the background again, as on main, so search, tree status and fold state behave as before. The panel now only waits until its open transition ends before loading, and starts no new loads while closing.
Sorry, I'm unable to act on this request because you do not have permissions within this repository.
| … | … | @@ -42,15 +49,29 @@ export function useReviewFilePatches({ | |
| 51 | 72 | ignoreWhitespace, | |
| 52 | 73 | scope, | |
| 53 | - | requested, | |
| 74 | + | indices: placeholders.flatMap((file, index) => (isFileExpanded(file) ? [index] : [])), | |
🟠 High diffs/useReviewFilePatches.ts:74
Searching a diff for text in a collapsed file reports no match, and collapsing a previously loaded file removes its matches. indices includes only expanded files, so collapsed files are represented by empty placeholders; search scans the supplied items' additionLines and deletionLines, and onRevealSearchMatch cannot load a file until a match exists. Preserve searchable content for collapsed files or add a search-triggered loading path.
🤖 Copy this AI Prompt to have your agent fix this:
| 1 | In file @apps/web/src/components/diffs/useReviewFilePatches.ts around line 74: |
| 2 | |
| 3 | Searching a diff for text in a collapsed file reports no match, and collapsing a previously loaded file removes its matches. `indices` includes only expanded files, so collapsed files are represented by empty placeholders; search scans the supplied items' `additionLines` and `deletionLines`, and `onRevealSearchMatch` cannot load a file until a match exists. Preserve searchable content for collapsed files or add a search-triggered loading path. |
Confirmed. Fixed in 1b1b9dad62 by changing the approach: collapsed files load in the background again, as on main, so search, tree status and fold state behave as before. The panel now only waits until its open transition ends before loading, and starts no new loads while closing.
Sorry, I'm unable to act on this request because you do not have permissions within this repository.
| … | … | @@ -107,20 +104,7 @@ export function useReviewFilePatches({ | |
| 121 | - | isPartial: true, | |
| 122 | - | cacheKey: `${scope}:${file.path}:pending`, | |
| 123 | - | }; | |
| 107 | + | return placeholders[index]!; | |
🟡 Medium diffs/useReviewFilePatches.ts:107
Collapsing a loaded added or deleted file changes its tree status to modified, and it stays wrong while collapsed. Removing its query leaves patches.get(index) empty, so this fallback replaces the fetched metadata with a placeholder whose type is "change"; retain the loaded metadata when the query is removed.
🤖 Copy this AI Prompt to have your agent fix this:
| 1 | In file @apps/web/src/components/diffs/useReviewFilePatches.ts around line 107: |
| 2 | |
| 3 | Collapsing a loaded added or deleted file changes its tree status to modified, and it stays wrong while collapsed. Removing its query leaves `patches.get(index)` empty, so this fallback replaces the fetched metadata with a placeholder whose `type` is `"change"`; retain the loaded metadata when the query is removed. |
Confirmed. Fixed in 1b1b9dad62 by changing the approach: collapsed files load in the background again, as on main, so search, tree status and fold state behave as before. The panel now only waits until its open transition ends before loading, and starts no new loads while closing.
Sorry, I'm unable to act on this request because you do not have permissions within this repository.