refactor(gui_2,patch_modal): merge diff_viewer ops into gui_2; data classes (DiffHunk/DiffFile) move to patch_modal.py alongside PendingPatch; git rm src/diff_viewer.py

Per spec FR1 + Phase 1.4 + architecture feedback (data != view):
  - Data classes DiffHunk, DiffFile -> src/patch_modal.py (alongside PendingPatch; all patch-domain data)
  - Operations parse_diff/parse_hunk_header/get_line_color/apply_patch_to_file (called by gui_2) -> src/gui_2.py
  - GUI is a pure view; data lives elsewhere; no new files per AGENTS.md

Tests: tests/test_diff_viewer.py imports from src.gui_2 (parse_diff/apply_patch_to_file) and src.patch_modal (DiffFile/DiffHunk).
This commit is contained in:
ed
2026-06-26 06:59:30 -04:00
parent b10b5bae87
commit 163b12493b
4 changed files with 160 additions and 177 deletions
+2 -2
View File
@@ -2,8 +2,8 @@ import pytest
import tempfile
import os
from pathlib import Path
from src.diff_viewer import (
parse_diff, DiffFile, DiffHunk, parse_hunk_header,
from src.gui_2 import (
parse_diff, DiffFile, DiffHunk, parse_hunk_header,
get_line_color, apply_patch_to_file
)