feat(git): safely apply individual diff hunks (#3443)

Resolve the Changes-view conflict without reverting branch or commit comparisons. Pair canonical action patches with displayed blob identities, refresh all path views after mutation, exclude historical snapshots, and reject stale or multi-file patches at the server boundary.

Preserve CRLF bytes and make long hunk menus keyboard-reachable. Workspace type-check, lint and build passed; focused parser, menu, view and real Git regressions passed.
This commit is contained in:
Bohdan Triapitsyn
2026-09-09 19:39:28 +03:00
10 changed files with 662 additions and 72 deletions
+8
View File
@@ -0,0 +1,8 @@
import { test } from 'vitest';
import { exerciseDiffHunkActions } from '@openchamber/ui/components/views/DiffView.hunks.fixture';
// The actual view imports Vite asset globs. Run its UI-owned DOM fixture through
// the web renderer's transform pipeline instead of mocking those modules.
test('hunk actions refresh unchanged-status patches, survive full context and exclude historical diffs', () => exerciseDiffHunkActions());
test('full-context and action reads must describe the same file version', () => exerciseDiffHunkActions('cold'));
test('cached action patches cannot be paired with a newer full-context display', () => exerciseDiffHunkActions('cached'));