Commit Graph

2 Commits

Author SHA1 Message Date
fbdf450c14 Move drag_info from global to class attribute for better encapsulation
## Code Quality Improvements

### Global State Removal
- Eliminated global drag_info dictionary
- Moved drag_state management into TimeTracker class
- Removed all global drag_info dependencies

### Updated Components
- **ClickableCell constructor**: Added time_tracker parameter for proper reference
- **ClickableCell methods**: Updated to use self.time_tracker.drag_info
- **TimeTracker methods**: Updated on_global_drag() and on_global_up()
- **Instance creation**: Updated ClickableCell instantiation calls

### Benefits Achieved
- **Better Encapsulation**: State properly contained within class boundaries
- **Thread Safety**: Reduced race conditions from shared global state
- **Testability**: Individual instance testing now possible
- **Instance Isolation**: Multiple TimeTracker instances work independently
- **Maintainability**: Clearer code structure with explicit dependencies

### Verification
-  All drag functionality preserved (paint/erase operations)
-  Drag state management works correctly
-  Multiple instances properly isolated
-  All 6 existing test suites pass (no regressions)
-  New comprehensive test suite created and passing
-  Application starts and runs correctly

## Files Modified
- **time_tracker.py**: Global state removal and class attribute implementation
- **AGENTS.md**: Updated coding guidelines for class preferences
- **TODO.md**: Marked drag_info task as completed, updated progress
- **tests/test_drag_info_class_attribute.py**: New comprehensive test suite

## Testing
- Added complete test suite for drag_info functionality
- Tests verify global state removal and class attribute access
- Confirms multiple instance isolation
- Validates drag state management

Code quality significantly improved with zero functional regressions.
2025-10-29 17:38:00 -04:00
a564d430f8 Add comprehensive test suites for security fixes and features
- test_atomic_settings.py: Atomic write operation tests
- test_csv_quoting.py: CSV QUOTE_MINIMAL protection tests
- test_complete_csv_sanitization.py: Full field sanitization tests
- test_input_sanitization.py: Input validation and security tests
- test_alternating_colors.py: Visual enhancement tests
- test_mark_billed.py & test_mark_logic.py: Existing functionality tests

All tests passing with comprehensive security coverage.
2025-10-29 17:24:15 -04:00