refactor: route conflict resolution through the diff workspace

Use the active DiffState, native FilePicker and existing diff input,
layout, focus, source navigation and scrolling paths for Resolution.
Delete separate resolver filtering, file-list rendering and scroll APIs.
Keep projections, source choices, History and guarded jj saves distinct.

Verify native parity for picker remaps, current-file selection, excerpt
initialization, folded search, wheel focus, layouts, buffer transitions
and per-file viewports. All 932 tests pass; actual terminal smoke covers
Space-e explorer, Down/Enter file selection and guarded confirmed save.
Clippy completes with existing warnings only.

Size exception: 1197 implementation added/deleted lines excluding tests
and docs; input routing, native buffer lifecycle and rendering are kept
as one coherent cutover, without a parallel legacy resolver path.
This commit is contained in:
Valdemar Lorenzen
2026-10-15 09:53:45 +02:00
parent 4aff22377f
commit 168e12160a
8 changed files with 1231 additions and 802 deletions
+2
View File
@@ -80,6 +80,8 @@ Each comparison owns its split/unified mode and split axis; startup defaults app
The resolver owns a dedicated native tab with an editable Draft and frozen read-only Alternatives projected from the current raw working buffer. Projection replaces only conflict regions; automatically merged text and pre-existing outside edits remain identical across initial alternatives. Native undo includes initial seeding. Resolution reuses DiffState alignment, excerpts, highlighting and viewport mapping, including equal-text editing. A separate read-only History uses the original jj inputs/bases; native buffer identity and frontend offsets retain draft/view state. `resolve` reads all alternating Git-backed `jj:trees` terms. Background guarded saves retain checkout/disk validation and jj snapshot/status authority; no presentation change bypasses these write guards.
Resolution exposes its projected comparison through the same active DiffState and native FilePicker as ordinary diffs. Pane labels and writability are explicit comparison properties; file selection, bindings, native navigation, layout and scrolling share the existing interaction path. Conflict state owns only projections, source choices and guarded save/check metadata; there is no separate resolver filter or file-list renderer.
`Editor::scroll_distance()` supplies the session-wide optional edge margin. The TUI applies it to document/diff visual rows and unwrapped text columns, and retains independent picker offsets across navigation frames. Picker windows exclude their fixed chrome and align whole multi-row entries. File projections carry a monotonic viewport revision, so catalog/filter/expansion changes invalidate picker identity without hashing the entire catalog on every redraw. Metadata-only status changes do not move the viewport. Explicit LSP/wrap-toggle anchors and detached wheel views retain precedence.
Mouse wheel input uses the last rendered document/panel rectangles for hit-testing. Document offsets and explorer scroll state remain frontend-owned; three-row wheel steps never become document cursor motions. Manual document views persist until logical caret-reveal, caret/selection, mode, revision, or buffer changes; offscreen primary and browsing-selection cursors are not placed. Hover wheel input reuses the existing editor-owned popup scrolling.