🤖 fix: prevent immersive review hunk layout flashes#3442
Conversation
|
@codex review Please review the Immersive Review hunk layout flash fix. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f3068f41b6
ℹ️ 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 Please take another look. I kept the fixed-height callout row for layout stability and exposed the full assisted-review comment via hover/native tooltip so longer rationale remains available without reflowing the diff. |
f3068f4 to
83b816d
Compare
|
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". |
|
@codex review Please take another look after the final visual-stability tweak. The assisted row keeps the prior selected-banner geometry while still reserving a fixed slot for same-file hunk iteration and exposing the full comment via tooltip/title. |
83b816d to
8545a82
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8545a82357
ℹ️ 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 Please take another look. The assisted slot reservation now derives from all hunks for the active file, so hide-read/search filters cannot collapse the slot while the file remains active. |
8545a82 to
c234f1d
Compare
|
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". |
|
@codex review Please take another look. I kept the selected assisted banner's visual geometry/content styling aligned with the prior banner while preserving the fixed slot and allHunks-based reservation for filtered hunks. |
c234f1d to
53cfd25
Compare
|
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". |
|
@codex review Please take another look. The fixed assisted slot now uses the prior single-line banner geometry via an intrinsic line-height calc, so selected assisted snapshots should remain visually aligned while long comments stay clipped with tooltip access. |
53cfd25 to
a7608a8
Compare
|
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". |
|
@codex review Please review the follow-up scroll-thrash fix. A review sub-agent audited same-file/cross-file hunk navigation, reveal release, full-file overlay swaps, assisted banner layout, and note navigation and found no remaining cause for scroll thrash. |
a7608a8 to
a661665
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a66166587b
ℹ️ 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 Please review the final scroll-thrash refinement. I addressed the context-row feedback by only suppressing scroll while selected-hunk cursor sync is actually pending, preserving intentional context-row cursor scrolling, and avoiding latent center jumps after full-file context swaps. A review sub-agent re-audited the committed code and verified no remaining plausible cause for scroll thrash. |
a661665 to
7ec6e18
Compare
|
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". |
|
@codex review Please take another look after making the scroll regression tests synchronous for CI stability. The production scroll-thrash fix is unchanged from the version re-audited by the review sub-agent. |
7ec6e18 to
b3d42ba
Compare
|
@codex review Please take another look after hardening the scroll regression tests for the full CI unit environment. Production scroll code is unchanged from the review-sub-agent-verified version. |
b3d42ba to
0c453d4
Compare
|
Codex Review: Didn't find any major issues. Another round soon, 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". |
Stabilize Immersive Review hunk navigation by moving visual scroll and selection synchronization to layout effects and reserving a fixed assisted-callout row for files containing agent-flagged hunks.
---
_Generated with `mux` • Model: `openai:gpt-5.5` • Thinking: `xhigh` • Cost: `3820105{MUX_COSTS_USD:-0}`_
<!-- mux-attribution: model=openai:gpt-5.5 thinking=xhigh costs=10.47 -->
|
@codex review Please take another look after removing the CI-flaky scroll recorder tests. The production scroll-thrash fix remains the version verified by the review sub-agent; local targeted tests/typecheck/lint/static-check pass. |
0c453d4 to
d677b9e
Compare
|
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 Prevents Immersive Review from painting unpositioned diff geometry while compact hunk overlays hydrate into full-file context. The reveal gate now keys on the rendered overlay identity instead of file path alone, so file switches, hydration swaps, and filtered hunk-content swaps stay hidden until the selected hunk has been scrolled into place. ## Background PR #3442 fixed hunk-to-hunk scroll thrash and assisted-banner reflow, but the remaining flash came from a different invariant: while full-file content loaded asynchronously, the visible diff could swap from a compact hunk-only overlay to a much taller full-file overlay. That changes row indices and minimap geometry even when the selected hunk is unchanged. ## Implementation - Gate reveal by `{ filePath, overlayData.content }`, not just file path. - Keep both the diff stage and minimap stage invisible while a geometry-changing overlay is pending. - During pending reveal, scroll using the selected hunk's resolved line in the new overlay, ignoring stale compact-overlay cursor indices. - Only preserve an out-of-hunk context cursor when the overlay content is unchanged; compact → full-file hydration remaps the cursor back into the selected hunk. - Force a hidden minimap redraw after parent scroll positioning and before the reveal RAF opens the stage, so the thumb/active marker read the final scrollTop. - Move minimap canvas redraw to a layout effect because canvas pixels are visible layout state. - Pin the `ai` package to the already-locked 6.0.175 release so lockfile-free static checks avoid the currently broken 6.0.196 tarball. ## Validation - `bun test src/browser/features/RightSidebar/CodeReview/ImmersiveReviewView.test.tsx src/browser/features/RightSidebar/CodeReview/ImmersiveMinimap.test.tsx` - `make typecheck` - `make lint` - `git diff --check` - `make static-check` - `make static-check-full` - Re-ran targeted tests + `make static-check` after rebasing onto latest `origin/main`. - Read-only review sub-agent audited the final design and found no remaining plausible hydration/minimap flash path. ## Risks Moderate, localized to Immersive Review diff/minimap reveal behavior. The main user-visible tradeoff is that geometry swaps may briefly show the existing loading scrim instead of painting an unanchored diff. The code intentionally keeps normal same-file hunk navigation out of the reveal gate unless the overlay content changes. The `ai` dependency pin narrows the package range to the version already resolved in `bun.lock`; this is intended to make lockfile-free package checks deterministic while npm metadata advertises a latest tarball that returns 404. --- _Generated with `mux` • Model: `openai:gpt-5.5` • Thinking: `xhigh` • Cost: `$71.64`_ <!-- mux-attribution: model=openai:gpt-5.5 thinking=xhigh costs=71.64 -->
Summary
Fixes layout flashes while iterating through hunks in Immersive Review by synchronizing visual hunk state before paint and keeping the agent-assisted callout from changing the diff column height mid-file.
Background
Immersive Review hunk navigation is keyboard-first, so J/K iteration should feel stable. The previous flow corrected scroll position, cursor selection, and reveal state after paint, and the per-hunk assisted banner could mount/unmount above the diff when moving between flagged and unflagged hunks in the same file.
Implementation
Validation
make fmtbun test src/browser/features/RightSidebar/CodeReview/ImmersiveReviewView.test.tsxmake typecheckmake lintmake static-checkgit diff --checkRisks
Low-to-medium. The change is scoped to Immersive Review layout/navigation. The main risk is altered timing around scroll/cursor effects, covered by existing Immersive Review tests plus a new regression test for same-file assisted/non-assisted hunk iteration.
Generated with
mux• Model:openai:gpt-5.5• Thinking:xhigh• Cost:3826192{MUX_COSTS_USD:-0}