Skip to content

Conversation

@MustardBell
Copy link
Contributor

@MustardBell MustardBell commented Jul 29, 2025

Major architectural refactoring to improve code organization:

  • Extracted ProjectManager class from mainWindow.py (~300 lines)
    • Moved project lifecycle methods: loadProject, closeProject, saveDatas
    • Moved timer management: saveTimer, saveTimerNoChanges
    • Moved data management: loadEmptyDatas, loadDatas
    • Moved unsaved changes handling: handleUnsavedChanges
    • Updated all calling code to use projectManager interface

  • manuskript/projectManager.py - Project lifecycle management
  • manuskript/tests/test_projectManager.py - Basic ProjectManager tests (2 tests)
  • manuskript/tests/test_projectManager_timer.py - Comprehensive timer tests (9 tests)

  • manuskript/mainWindow.py - Removed ~300 lines, added projectManager integration
  • manuskript/ui/welcome.py - Updated to use projectManager interface
  • manuskript/settingsWindow.py - Updated timer access via projectManager
  • manuskript/tests/conftest.py - Updated test fixtures for new interface

  • Added 11 new unit tests total covering ProjectManager functionality
  • Comprehensive timer testing with proper Qt mocking
  • All existing tests continue to pass (50 total tests)
  • Tests validate both positive and negative scenarios

  • Reduced mainWindow.py complexity (2000+ -> 1700 lines)
  • Improved separation of concerns
  • Better testability with isolated components
  • Foundation for further architectural improvements

Major architectural refactoring to improve code organization:

- **Extracted ProjectManager class** from mainWindow.py (~300 lines)
  - Moved project lifecycle methods: loadProject, closeProject, saveDatas
  - Moved timer management: saveTimer, saveTimerNoChanges
  - Moved data management: loadEmptyDatas, loadDatas
  - Moved unsaved changes handling: handleUnsavedChanges
  - Updated all calling code to use projectManager interface

- `manuskript/projectManager.py` - Project lifecycle management
- `manuskript/tests/test_projectManager.py` - Basic ProjectManager tests (2 tests)
- `manuskript/tests/test_projectManager_timer.py` - Comprehensive timer tests (9 tests)

- `manuskript/mainWindow.py` - Removed ~300 lines, added projectManager integration
- `manuskript/ui/welcome.py` - Updated to use projectManager interface
- `manuskript/settingsWindow.py` - Updated timer access via projectManager
- `manuskript/tests/conftest.py` - Updated test fixtures for new interface

- Added 11 new unit tests total covering ProjectManager functionality
- Comprehensive timer testing with proper Qt mocking
- All existing tests continue to pass (50 total tests)
- Tests validate both positive and negative scenarios

- Reduced mainWindow.py complexity (2000+ -> 1700 lines)
- Improved separation of concerns
- Better testability with isolated components
- Foundation for further architectural improvements
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant