🤖 refactor: clean up immersive review reveal performance#3473
🤖 refactor: clean up immersive review reveal performance#3473ammar-agent wants to merge 2 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 Small follow-up: made the hydration/parent-echo regression tests robust in CI while preserving the same coverage. |
|
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". |
b91bff3 to
680081a
Compare
|
@codex review Follow-up only adjusts the new regression tests to avoid happy-dom/full-suite timing assumptions; production code unchanged from the addressed review round. |
|
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". |
680081a to
36ce904
Compare
|
@codex review I replaced the happy-dom hydration assertions with a real Electron frame-sampling regression. It reproduces the vertical jump as overlayTopRange=7283 before the fix and now passes with the reveal overlay pinned to the scrollport while hidden hydration scrolls underneath. |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. ℹ️ 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". |
36ce904 to
12295b2
Compare
|
@codex review Follow-up for user-reported m-key tearing: added an Electron frame-sampling E2E for mark-read iteration overlay sizing. It failed before the fix with a 598px overlay/scrollport height mismatch and now passes after sizing the reveal overlay to the scrollport. |
|
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". |
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 -->
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". |
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. The branch still includes the original immersive hunk-iteration perf benchmark, and now also removes the remaining compact-diff/full-file flash path and adds real Electron coverage for minimap and same-file J/K stability.
Background
Immersive review was still visibly flashy during file switches, mark-read advancement, and compact-to-full hydration. The old flow scattered reveal state across file-loading effects, highlight callbacks, scroll layout effects, sticky measured overlays, and full-content string keys inside
ImmersiveReviewView, which made it easy to render or reveal intermediate geometry.Implementation
contentKeyidentity, highlight readiness, and reveal scheduling intouseImmersiveOverlay.ImmersiveDiffRevealLoadingState.ResizeObserver/height state and stale first-frame coverage risk.useHighlightedDiffavoid rebuilding fallback chunks on preloaded cache hits and avoid redundant state churn.textContentreads.Validation
bun test src/browser/features/RightSidebar/CodeReview/ImmersiveReviewView.test.tsxbun test src/browser/features/Shared/DiffRenderer.test.tsx src/browser/features/Shared/SelectableDiffRenderer.dragSelect.test.tsxmake typecheckmake static-checkmake 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:openai:gpt-5.5-pro• Thinking:xhigh• Cost:$1249.04