fix(refresh): stop merge-view jitter and preserve session state - #563
Merged
Merged
Conversation
Add a dependency policy for worktree, index, HEAD, refs and buffer invalidations. Restrict the Git content cache to immutable object IDs and normalize missing merge-stage errors. This commit contains only the policy foundation and its tests; snapshot application and session scheduling remain separate changes.
Read all comparison inputs before applying changes, compare source contents, and validate working-buffer ticks. Update existing panes without reopening unchanged inputs or overwriting edited merge results. Centralize revision-buffer content population and reject stale virtual-file loads. Cover snapshot completion, dependency selection, failures, and missing sides.
Route watcher classifications, buffer events, panel refreshes, and the 500ms polling fallback through one session controller. Separate repository-list updates from comparison updates and merge-result initialization. Preserve symbolic source refs across commands, panels, file following, and layout changes. Retire per-view schedulers, reject stale callbacks, and clean up refresh ownership when buffers or tabs disappear. Update Explorer and History tests for coalescing, retry, fallback, and lifecycle behavior.
Add 124 real file/Git and embedded screen-grid cases across layouts, Explorer, History, standalone comparisons, merge Results, file following, and session lifecycle transitions. Require native watcher readiness, exercise the 500ms polling fallback and real process-exit failover, and verify stable panes throughout unrelated repository changes. Document the coverage and extend the screen harness for flushed-frame assertions.
Move panel data, comparison definitions, Git reads, and selection ownership into the session refresh controller. Explorer and History consume data notifications instead of managing refresh and file-loading workflows. Remove legacy refresh adapters and reuse the existing view renderers for in-place comparison updates. Preserve watcher classifications, the 500ms polling fallback, and edited merge Results. Add six architecture regression cases, migrate existing tests to session-owned data, and document the shared refresh flow. Verified all 114 spec files on Neovim 0.13-dev, 124 refresh E2Es on Neovim 0.12.3, the native build, and all 10 C tests.
Use isolated temporary repositories and worktrees for Git-backed tests, with deterministic reusable UI fixtures and cleanup guarantees. Expand the refresh matrix to 132 named scenarios and 544 E2E executions across native and polling backends, layouts, and merge configurations. Fix regressions exposed by the new scenarios in history queries, root commits, renamed paths, file reloads, revision buffers, and shared-buffer lifecycle. Document the main-to-branch behavioral coverage map and fixture reproduction workflow.
Separate unit, integration and E2E specs from shared support, fixtures and the test framework. Preserve all 1590 existing case registrations and add five discovery and directory-boundary checks. Add layer, directory and single-spec selection to both test entry points. Remove old helper paths and checkout-history dependencies, use registered command and keymap entry points in E2Es, and update CI, documentation and testing guidance. Validated all 123 specs on Neovim 0.13-dev, all 587 E2E executions on 0.12.3, targeted 0.12.3 integration and unit suites, C tests, formatting, CLI selection and reference audits. Production Lua and the keymap golden are unchanged.
esmuellert
enabled auto-merge
September 14, 2026 21:06
Coalesce fallback ticks while a selection, read or real invalidation is pending, preserving the 500ms interval and classified repository events. Add controller regressions and real delayed-Git E2Es. Isolate hand-authored gutter projections from the comparison controller, write atomic index-only fixture changes, keep literal-arrow paths in Git rather than invalid Windows filenames, and retire fixture-owned sessions before removing watched directories. Retain the strict upstream scrollbind probe as an explicit opt-in after Neovim reverted #41519; test CodeDiff scrollbind setup unconditionally. Bound Windows worker concurrency and whole-spec runtime, and report active workers during long runs.
Owner
Author
|
CI follow-up at e6d6678: PR Validation run 34900369664 has completed successfully (14/14 jobs), including the full 123-spec suite on both Windows architectures. All required checks are green; auto-merge remains enabled and still awaits the required review approval. The separate GitHub-managed Advanced Security AI run 34900367001 failed with a service-side CAPI 400 "The requested model is not supported"; it is not a required check, and no security check was disabled to obtain the Validation result. CodeQL and GitGuardian checks passed. |
yanuoma
approved these changes
Sep 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #558.
Stop merge-view jitter and repeated refresh/reinitialization by treating repository notifications as input invalidations, not instructions to reopen the selected comparison. Refresh only what changed, while keeping working buffers and editable merge Results authoritative.
This also consolidates refresh ownership, adds real-Git/Neovim regression coverage, and separates E2E, integration and unit tests.
Refresh model and ownership
worktree/index/head/refsclassifications and the 500 ms polling fallback, including native-process failure recovery.ui.refreshthe single controller.session.panel.dataowns list data, query parameters and selection; panel views consume notifications and keep only local presentation state.refresh/panel.luaandrefresh/inputs.lua, and reuse existing view renderers for in-place updates. Remove the oldauto_refresh, Explorer scheduler and per-panel refresh modules.Regressions caught by the expanded tests
->filenames and renamed index paths could be read incorrectly; status parsing now uses NUL-delimited paths.CI follow-up: e6d6678
The first cross-platform run exposed issues that were not visible on the initial fast local machine. These were reproduced and corrected rather than handled by weakening result assertions:
>filesystem path. The cases are not skipped on Windows.Upstream scrollbind distinction
Neovim reverted #41519 in 0c9012f, restoring its known tall-virtual-line oscillation. The previous
nvim-0.13test gate incorrectly assumed the fix was still present. The unchanged strict upstream assertion is now explicitly opt-in viaCODEDIFF_TEST_UPSTREAM_SCROLLBIND=1on a build carrying the fix; it was verified on the earlier fixed build. CodeDiff's own scrollbind setup remains mandatory. No new scrolling workaround or claim to fix Neovim's reverted behavior is included.Tests and fixtures
tests/unit/(13 files),tests/integration/(94 files) andtests/e2e/(16 files). Support, fixtures and framework implementation are separate.Validation
PR Validation run 34900369664 completed successfully: 14/14 jobs.
The desktop jobs use official Neovim nightly
v0.13.0-dev-1638+ge7e29d9b6d. Windows logs confirm the formerly failing arrow-path cases, slow-read cases, 30 gutter checks and 8 repository-helper checks actually executed and passed.Additional local validation:
make build, C tests 10/10, StyLua on changed paths andgit diff --checkpassed.Review notes and scope
The original seven commits remain intact, followed by the CI correction commit
e6d6678; no history was rewritten. The test-organization commit2dc5a5achanges no production Lua behavior. Most of the large file count is test relocation.Merge algorithms, filler placement/count rules, gutter implementation, highlight definitions and unrelated scrolling behavior are unchanged.
The matrix is behavioral evidence, not an absolute safety or exhaustive branch-coverage guarantee.