🤖 refactor: clean up immersive review reveal performance#3473
🤖 refactor: clean up immersive review reveal performance#3473ammar-agent wants to merge 3 commits into
Conversation
|
@codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
1a2a1b2 to
065b797
Compare
|
@codex review Updated the perf scenario to wait until all rendered diff rows are syntax-highlighted before resetting profiler samples and measuring hunk iteration. |
|
Codex Review: Didn't find any major issues. What shall we delve into next? ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
065b797 to
e2ccc6d
Compare
|
@codex review Updated this from measurement-only to include the immersive review optimization. The new highlighted harness now reports TaskDuration 0.505s for 60 hunk iterations. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e2ccc6dc06
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
e2ccc6d to
c02d491
Compare
|
@codex review Addressed the read-action sync finding by committing the immersive-local selected hunk back to the parent before hunk read / mark-file-read actions, then revalidated the highlighted perf scenario at TaskDuration 0.565s. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c02d491434
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
c02d491 to
87f8f56
Compare
|
@codex review Addressed the unmount path by committing the immersive-local selected hunk in cleanup as well as on explicit exit/read actions. Revalidated the highlighted perf scenario at TaskDuration 0.739s. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 87f8f56eb8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
87f8f56 to
2e29f1b
Compare
|
@codex review Addressed the mark-file-read stale closure by making the parent handler consult |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2e29f1b412
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
2e29f1b to
dbcc416
Compare
|
@codex review Addressed the visible multi-line hunk range finding by applying an imperative selected-range highlight for J/K hunk jumps without re-rendering the syntax-highlighted diff tree. Revalidated at TaskDuration 0.570s. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dbcc416f01
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
dbcc416 to
3a5c82c
Compare
|
@codex review Addressed persisted selection during page teardown by persisting parent selected-hunk state on change, while immersive hot-path J/K iteration remains local. Revalidated at TaskDuration 0.561s. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3a5c82cc1c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
3a5c82c to
8a82d1c
Compare
|
@codex review Addressed parent teardown by writing the immersive-local selected hunk directly to persisted state during immersive cleanup, using a shared selected-hunk storage key helper. Revalidated at TaskDuration 0.605s. |
|
Codex Review: Didn't find any major issues. Nice work! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
8a82d1c to
10b3e2b
Compare
|
@codex review Addressed the viewport jump feedback by using nearest scroll alignment for same-file J/K hunk iteration while keeping centering for file switches, note jumps, undo, and overlay hydration. Revalidated the highlighted perf scenario at TaskDuration 0.569s. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 10b3e2b810
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
10b3e2b to
ef35ffd
Compare
|
Codex Review: Didn't find any major issues. Keep it up! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
12295b2 to
1aac2ab
Compare
|
@codex review Follow-up after three independent review sub-agents: addressed the remaining Shift+M stale-file flash path, updated stale reveal comments, and added a bounded fail-open for full-file hydration/highlight stalls. |
|
@codex review I refactored the immersive review reveal pipeline and expanded the Electron hydration coverage. Please review the updated branch. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 466e8cef81
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
466e8ce to
f663fb1
Compare
|
@codex review Addressed the same-file compact→full hydration gate: full-file-context waits now apply to any pending overlay content-key swap, not just file-path swaps, and I added a regression test for the same-file far-hunk-to-near-hunk transition. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f663fb1d3b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review Pushed the same-file hydration gate fix and regression test. Please take another look. |
f663fb1 to
1565ffc
Compare
|
Codex Review: Didn't find any major issues. Swish! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review Addressed the CRLF overlay feedback by normalizing hunk rows in compact overlay construction and added a regression test for CRLF hunk content. |
1565ffc to
20693e1
Compare
|
Codex Review: Didn't find any major issues. Delightful! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review One more small CI fix: the loading skeleton no longer exposes |
20693e1 to
a874b0b
Compare
|
Codex Review: Didn't find any major issues. Keep them coming! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Add a perf fixture and Electron profiling scenario that reproduces large-file immersive review hunk iteration across 60 J-key steps after the full-file diff is syntax highlighted. Optimize immersive hunk navigation to keep selection local while iterating, avoid per-step localStorage writes, and keep diff renderer callbacks stable so the highlighted diff tree is not re-rendered on each jump.\n\nOptimized highlighted baseline captured locally: 1,500-line file, 150 hunks, 1,650 rendered diff rows syntax-highlighted, 60 iterations, 300 ms wall time, 0.505 s TaskDuration, median 4.70 ms, p95 5.50 ms, max 12.60 ms.\n\n---\n\n_Generated with `mux` • Model: `openai:gpt-5.5` • Thinking: `xhigh` • Cost: `unknown`_\n\n<!-- mux-attribution: model=openai:gpt-5.5 thinking=xhigh costs=unknown -->
a874b0b to
b2831f5
Compare
|
@codex review Latest push rebases onto |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b2831f5c46
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
b2831f5 to
4c06a1e
Compare
|
@codex review Addressed the P2 (stale full-file cache when the file changes on disk). The full-file body cache is now keyed by
Added unit coverage: "re-reads the full-file body when the file's diff content changes" (same hunk id, changed content → re-read) alongside the existing "keeps same-file hunk-set changes instant without re-reading or re-covering". |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4c06a1e402
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Marking a hunk read (or any same-file hunk-set change) used to invalidate the full-file cache and replay the reveal skeleton. Key the file-content cache by (path, content-version), scope overlay deferral to genuine file switches, and gate the loading cover on file-path changes so same-file iteration reveals in place. The content-version is derived from the file's unfiltered diff content, so a real file change (tool edit / diff refresh) still busts the cache while mark-read filtering does not.
4c06a1e to
7b55af3
Compare
|
@codex review Addressed the second P2 (stale paint on same-path in-place edits).
which means |
|
Codex Review: Didn't find any major issues. 🎉 ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
Refactors immersive review's reveal pipeline so file-content hydration, overlay identity, highlight readiness, and reveal scheduling live behind a focused hook instead of the monolithic view, and removes the remaining flash paths. The loading cover is now reserved for genuine file switches: iterating hunks within one file — including marking hunks read while read hunks are hidden — is instant, with no loading skeleton. The branch still includes the original immersive hunk-iteration perf benchmark and real Electron coverage for minimap and same-file stability. Rebased onto
main.Background
Immersive review was still visibly flashy. Reveal state was scattered across file-loading effects, highlight callbacks, scroll layout effects, sticky measured overlays, and full-content string keys inside
ImmersiveReviewView, making it easy to render or reveal intermediate geometry. A concrete symptom remained after the first cleanup pass: when read hunks are hidden, marking a hunk read removes it from the visible hunk set, which (a) invalidated the full-file content cache because its key included the hunk signature, forcing a redundant file re-read, and (b) changed the overlaycontentKey, which the reveal cover was gated on — so every same-file mark-read replayed the full-screen loading skeleton even though the file was already on screen.Implementation
contentKeyidentity, highlight readiness, and reveal scheduling intouseImmersiveOverlay.ImmersiveDiffRevealLoadingState; it is an absolute scrollport sibling (noResizeObserver/measured height).(workspaceId, filePath)only. File bodies do not depend on the hunk set, so hunk-set changes (mark-read, filter toggles) no longer invalidate the cache or trigger a re-read; the overlay is rebuilt in-memory from the cached body plus the live hunks.isActiveFileRevealPending). The content-key pending state is retained only to re-run the hidden scroll pass that keeps the selected hunk in view across same-file rebuilds. Same-file overlay changes reveal in place; only switching to a different file shows the cover.useHighlightedDiffavoid rebuilding fallback chunks on preloaded cache hits and avoid redundant state churn.textContentreads.Validation
bun test src/browser/features/RightSidebar/CodeReview/ImmersiveReviewView.test.tsx(incl. new "keeps same-file hunk-set changes instant without re-reading or re-covering")bun test src/browser/features/Shared/DiffRenderer.test.tsx src/browser/features/Shared/SelectableDiffRenderer.dragSelect.test.tsxmake static-check/make buildxvfb-run -a env MUX_E2E_LOAD_DIST=1 MUX_E2E_SKIP_BUILD=1 PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 bun x playwright test --project=electron tests/e2e/scenarios/reviewHydration.spec.tsxvfb-run -a env MUX_E2E_RUN_PERF=1 MUX_PROFILE_REACT=1 MUX_E2E_LOAD_DIST=1 MUX_E2E_SKIP_BUILD=1 PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 bun x playwright test --project=electron tests/e2e/scenarios/perf.reviewHunkIteration.spec.ts tests/e2e/scenarios/perf.reviewMarkHunkRead.spec.tsRisks
useHighlightedDiffcache-hit change; covered by targeted shared diff renderer tests and static checks.Generated with
mux• Model:anthropic:claude-opus-4-8• Thinking:max• Cost:$1352.76