Commit a70f796
committed
fix(review): remount DiffViewer on mode switch to invalidate stale content
Switching between Branch diff and PR Diff for the same file and base
didn't trigger a file-content refetch — the useEffect deps (filePath,
oldPath, reviewBase) were all unchanged. But the two modes compute
different "old" content (base tip vs merge-base ancestor), so Pierre
could mismatch or show wrong expansion context.
Fix: expose activeDiffBase through ReviewState and include it in the
ReviewDiffPanel key. Mode changes now remount DiffViewer, which clears
the cached content and fetches fresh. Same trade-off as the existing
reviewBase-keyed remount (scroll position resets on mode switch).
For provenance purposes, this commit was AI assisted.1 parent ca11628 commit a70f796
3 files changed
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1128 | 1128 | | |
1129 | 1129 | | |
1130 | 1130 | | |
| 1131 | + | |
1131 | 1132 | | |
1132 | 1133 | | |
1133 | 1134 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
32 | 36 | | |
33 | 37 | | |
34 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| |||
0 commit comments