Private
Public Access
0
0
Commit Graph

7 Commits

Author SHA1 Message Date
ed 163b12493b 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).
2026-06-26 06:59:30 -04:00
ed ba3eb0c090 refactor(multiple): continue Phase 6 Optional[T] elimination (batch 2)
Phase 6: Eliminate Optional[T] returns - BATCH 2 of 7
Before: 7 more Optional[T] returns removed
After:  0 in command_palette.py, diff_viewer.py, fuzzy_anchor.py,
        multi_agent_conductor.py, patch_modal.py, app_controller.py
Delta:  -7 sites (cumulative: -15 of 30)

Specific changes:
- src/command_palette.py:50: CommandRegistry.get() returns Command (zero-init
  sentinel: id="", title="", category="uncategorized", action=lambda: None)
- src/diff_viewer.py:117: get_line_color returns "" when no marker prefix
- src/fuzzy_anchor.py:40: FuzzyAnchor.resolve_slice returns (-1, -1) sentinel
  (replaced 3x `return None` with `return (-1, -1)`)
- src/multi_agent_conductor.py:64: WorkerPool.spawn returns threading.Thread()
  (empty sentinel, not started) when pool is full
- src/patch_modal.py:33: PatchModalManager.get_pending_patch returns
  PendingPatch; class has EMPTY_PATCH sentinel; field type changed from
  Optional[PendingPatch] to PendingPatch; 2x `= None` reset replaced with
  `= EMPTY_PATCH`
- src/app_controller.py:4414: _confirm_and_run returns "" when not approved
  (was Optional[str] returning None)

Test updates:
- tests/test_diff_viewer.py:95: get_line_color(" context") == ""
- tests/test_fuzzy_anchor.py:42,59: assert result == (-1, -1)
- tests/test_parallel_execution.py:31: t3 sentinel is now unstarted thread
  (check via not t3.is_alive())
- tests/test_patch_modal.py:9,31,78: get_pending_patch() == "" sentinel check

Verification:
- audit_weak_types --strict: OK (107 <= 112 baseline)
- 22+ tests pass (test_diff_viewer, test_fuzzy_anchor,
  test_parallel_execution, test_patch_modal, test_command_palette)
- py_check_syntax: OK on all changed files

REMAINING: ~15 Optional[T] returns in:
- src/external_editor.py (3)
- src/file_cache.py (7)
- src/diff_viewer.py: parse_hunk_header (1)
- src/models.py: ExternalEditorConfig.get_default (1)
- src/project_manager.py: load_track_state (1)
- src/session_logger.py: log_tool_call (1)
- src/app_controller.py: _pending_mma_spawn, _pending_mma_approval (2)
2026-06-26 05:07:35 -04:00
ed 31a8949d64 feat(style): Fix 1-space indentation in 27 files
Files corrected:
- src/fuzzy_anchor.py (18 violations)
- src/patch_modal.py (14 violations)
- scripts/extract_symbols.py (4 violations)
- scripts/tasks/download_fonts.py (8 violations)
- tests/: 23 files with indentation issues

All files verified with py_compile. Remaining 4 files
(test_api_events.py, test_discussion_takes_gui.py,
test_gui_updates.py, test_headless_service.py) have complex
multi-line with statements that require manual correction.
2026-05-16 03:00:20 -04:00
ed 8bb9287dfe refactor(ui): cull unused UI helpers and redundant modules 2026-05-10 11:50:00 -04:00
ed 125cbc6dd0 feat(patch): Add patch application and backup functions
- Add create_backup() to backup files before patching
- Add apply_patch_to_file() to apply unified diff
- Add restore_from_backup() for rollback
- Add cleanup_backup() to remove backup files
- Add 15 unit tests for all patch operations
2026-03-07 00:14:23 -05:00
ed 99a5d7045f feat(diff): Add diff rendering helpers for GUI
- Add get_line_color() to classify diff lines
- Add render_diff_text_immediate() for immediate mode rendering
- Add tests for rendering functions
2026-03-07 00:13:10 -05:00
ed 130001c0ba feat(diff): Add diff parser for unified diff format
- Create src/diff_viewer.py with parse_diff function
- Parse unified diff into DiffFile and DiffHunk dataclasses
- Extract file paths, hunk headers, and line changes
- Add unit tests for diff parser
2026-03-07 00:12:06 -05:00