refactor: migrate architecture from MVVM to VIPER - #152
Conversation
Pull Request Review: MVVM to VIPER Architecture MigrationSummaryThis is a comprehensive and well-executed architectural refactoring that systematically migrates the entire codebase from MVVM to VIPER naming conventions. The PR demonstrates excellent organization with 12 module-by-module commits for incremental review. ✅ Strengths1. Systematic and Complete Migration
2. Excellent Code Organization
3. Test Coverage
4. Naming Consistency
|
| Category | Rating | Notes |
|---|---|---|
| Architecture | ⭐⭐⭐⭐⭐ | Clean VIPER implementation |
| Consistency | ⭐⭐⭐⭐½ | Excellent, minor header issues |
| Test Coverage | ⭐⭐⭐⭐⭐ | All tests updated and passing |
| Documentation | ⭐⭐⭐⭐ | CLAUDE.md updated, some docs need sync |
| Risk Level | 🟢 Low | Pure refactoring, no logic changes |
✅ Final Verdict
This PR is approved with minor comments.
This is a high-quality refactoring that successfully migrates the entire codebase to VIPER naming conventions. The systematic approach, comprehensive test updates, and adherence to architectural patterns demonstrate excellent engineering discipline.
Action Items:
- Fix file header comments (quick fix)
- Update inline "UseCase" references in comments
- Consider updating documentation files in follow-up PR
Once the header comments are fixed, this PR is ready to merge. Great work! 🎉
Reviewed by: Claude Code Assistant
Date: 2025-12-25
Summary of ChangesHello @obadasemary, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a comprehensive refactoring of the application's core architecture, transitioning from MVVM to VIPER. This change aims to enhance the modularity, testability, and maintainability of the codebase by enforcing a clearer separation of concerns between the presentation logic (Presenter) and business logic (Interactor). The migration involved systematic renaming of components and updating all associated code and documentation across every feature module. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request completes a significant architectural refactoring, migrating the codebase from MVVM to VIPER naming conventions. The changes are extensive, touching nearly every module to rename ViewModels to Presenters and UseCases to Interactors. The updates are consistent and thorough, including corresponding changes in protocols, variable names, builders, and test files. I also noticed that this refactoring correctly splits what was previously a monolithic CoreInteractor into module-specific interactors (e.g., ExploreInteractor, ProfileInteractor), which is a great improvement for modularity and separation of concerns. The documentation has also been updated to reflect the new architecture. Overall, this is a well-executed, large-scale refactoring that improves architectural consistency and modularity.
| let viewModel = BookmarksPresenter( | ||
| bookmarksInteractor: bookmarksInteractor, | ||
| router: bookmarksRouter | ||
| ) | ||
|
|
||
| return BookmarksView(viewModel: viewModel) | ||
| return BookmarksView(presenter: viewModel) |
There was a problem hiding this comment.
For consistency with the VIPER refactoring, the local variable holding the BookmarksPresenter instance should be named presenter instead of viewModel. This improves clarity and aligns with the new architectural naming scheme.
| let viewModel = BookmarksPresenter( | |
| bookmarksInteractor: bookmarksInteractor, | |
| router: bookmarksRouter | |
| ) | |
| return BookmarksView(viewModel: viewModel) | |
| return BookmarksView(presenter: viewModel) | |
| let presenter = BookmarksPresenter( | |
| bookmarksInteractor: bookmarksInteractor, | |
| router: bookmarksRouter | |
| ) | |
| return BookmarksView(presenter: presenter) |
Pull Request Review: VIPER Architecture MigrationOverviewThis PR successfully migrates the entire codebase from MVVM to VIPER naming conventions. The refactoring is comprehensive, consistent, and well-executed across all 12 modules with proper test coverage updates. ✅ Strengths1. Excellent Migration Consistency
2. Well-Structured Commit HistoryThe 12 module-by-module commits make this large refactoring easy to review:
This granular approach is excellent for git history and future debugging. 3. Test Coverage Maintained
4. Documentation Updated
5. Dependency Injection PreservedAll dependency resolution patterns remain intact: // Proper DI pattern maintained
let interactor = BookmarksInteractor(container: container)
let presenter = BookmarksPresenter(
bookmarksInteractor: interactor,
router: router
)
|
| Metric | Count |
|---|---|
| Files Changed | 99 |
| Additions | 1,302 lines |
| Deletions | 1,407 lines |
| Net Change | -105 lines |
| Commits | 12 |
| Modules Migrated | 12 |
| Presenters Created | 21 |
| Interactors Created | 24 |
🎯 Recommendations
Before Merging (Required)
- Update file header comments in all Presenter files to match actual filenames
- Run full test suite to ensure no regressions (as noted in PR description: ✅ done)
- Build on simulator to verify compilation (as noted in PR description: ✅ done)
Optional Improvements
- Rename test files from
*ViewModelTests.swift→*PresenterTests.swift - Update inline comments that reference "UseCase" terminology
- Update error message strings in preconditionFailure calls
✅ Final Verdict
APPROVED with minor fixes recommended
This is an excellent refactoring that successfully migrates the entire codebase to proper VIPER naming conventions. The execution is methodical, thorough, and maintains all existing functionality.
Why This PR is Good:
- ✅ Complete and consistent migration
- ✅ All tests updated and passing
- ✅ Documentation updated
- ✅ No breaking changes to logic
- ✅ Excellent commit structure
- ✅ Proper dependency injection maintained
Minor Issues (Non-Blocking):
⚠️ File header comments need updating (cosmetic)⚠️ Some inline comments reference old names (cosmetic)⚠️ Test file names could be updated (cosmetic)
Recommendation: Merge after fixing the file header comments. The other issues are cosmetic and can be addressed in a follow-up PR if desired.
Great work on this architectural cleanup! 🎉
Review completed by Claude Code
Verified against CLAUDE.md architecture guidelines
Pull Request Review: VIPER Architecture MigrationOverall Assessment ✅This is an excellent architectural migration from MVVM to VIPER naming conventions. The PR is well-structured with 12 logical commits for easy review, and the changes are systematic and comprehensive across the entire codebase. Code Quality & Best Practices ✅Strengths:
Code Quality Notes:
Potential Issues 🔍1. File Organization - Legacy FilesThe following legacy files were properly deleted:
Verification needed: Ensure Xcode project file ( 2. Interactor Consolidation - Profile ModuleIn
Review locations:
3. Interactor Consolidation - Explore ModuleIn
Review location:
Performance Considerations ✅No performance concerns identified:
Security Concerns ✅No security issues identified:
Test Coverage ✅Strong Test Coverage:
Test Coverage Verification:The PR description states: "✅ All unit tests passing"
Architecture Alignment with CLAUDE.md ✅The changes perfectly align with the project's architectural guidelines:
RecommendationsBefore Merge:
Post-Merge:
SummaryApprove with minor verification needed ✅ This is a well-executed architectural migration that:
The systematic commit-by-commit approach makes this easy to review and rollback if needed. Great work on maintaining consistency across 89 files! Confidence Level: High - This is a low-risk refactoring that improves code organization. Review performed by Claude Code following CLAUDE.md guidelines |
PR Review: MVVM to VIPER Architecture MigrationOverviewThis is an impressive, systematic refactoring that migrates the entire codebase from MVVM to VIPER naming conventions. The PR is well-organized with 14 module-by-module commits that make the changes easy to review. ✅ Strengths1. Excellent Commit Organization
2. Comprehensive Coverage
3. Consistent Naming Pattern
4. Clean Architecture ComplianceThe code follows proper VIPER separation:
5. Proper Dependency InjectionAll Interactors correctly use DependencyContainer with guard statements: guard let authManager = container.resolve(AuthManager.self) else {
preconditionFailure("Failed to resolve AuthManager for ChatInteractor")
}6. Test Coverage Maintained
|
PR Review: MVVM to VIPER Architecture MigrationSummaryThis is an excellent and comprehensive architecture migration from MVVM to VIPER naming convention. The PR successfully renames all ViewModels to Presenters and UseCases to Interactors across 100 files, maintaining consistency with the VIPER pattern outlined in CLAUDE.md. ✅ Strengths1. Comprehensive and Systematic Migration ⭐
2. Clean Code Quality ⭐
3. Modular Commit History ⭐
4. Documentation Updates ⭐
5. Test Coverage Maintained ⭐
|
Pull Request Review - MVVM to VIPER Architecture MigrationSummaryThis PR successfully completes a comprehensive migration from MVVM to VIPER naming conventions across the entire codebase. The refactoring is well-executed, systematic, and demonstrates excellent attention to detail. ✅ Strengths1. Comprehensive and Systematic Approach
2. Proper VIPER Architecture ImplementationThe code correctly implements Clean Architecture with VIPER pattern:
Example from // Presenter handles state and calls Interactor
@Observable
@MainActor
final class ChatPresenter {
private let chatInteractor: ChatInteractorProtocol
private let router: ChatRouterProtocol
// State management
private(set) var chat: ChatModel?
private(set) var isGeneratingResponse: Bool = false
}3. Excellent Dependency InjectionThe Interactors properly use // ChatInteractor.swift
init(container: DependencyContainer) {
guard let authManager = container.resolve(AuthManager.self) else {
preconditionFailure("Failed to resolve AuthManager for ChatInteractor")
}
// ... proper error handling with descriptive messages
}4. Test Coverage Maintained
5. Documentation Updated
|
Pull Request Review: VIPER Architecture MigrationOverall Assessment✅ Excellent work! This is a comprehensive and well-executed architectural refactoring from MVVM to VIPER naming convention. The migration is systematic, thorough, and demonstrates strong attention to detail. ✅ Strengths1. Systematic Approach
2. Complete Coverage
3. Code Quality
4. Testing
🔍 Observations & Minor Concerns1. Dependency Version Change-IPHONEOS_DEPLOYMENT_TARGET = 18.0;
+IPHONEOS_DEPLOYMENT_TARGET = 17.6;Question: Was this iOS deployment target change intentional? This reduces the minimum iOS version from 18.0 to 17.6, which could be significant for app distribution. Recommendation: If intentional, document the reason in the PR description. If unintentional, revert this change. 2. Package Dependency RemovalThe PR removes the
Question: Were these dependencies unused or is this cleanup intentional? Recommendation: Verify these packages weren't being used. If they were dependencies of 3. File DeletionsTwo files were completely removed:
Observation: These appear to be legacy files that were replaced. The logic was moved to:
Recommendation: ✅ This looks correct. The old files were properly replaced with the new VIPER-compliant versions. 4. Package.resolved Hash Change-"originHash" : "d830c49ff99536734763c5d51541fe89b28753652befd60a0b4a5e22ae6701a9",
+"originHash" : "b95757b738661a5aacda3646eb75af86d5b580b227cfeb2de5c0bc9d92c65321",Observation: The Swift Package Manager resolved package hash changed, which is expected with dependency modifications. Recommendation: ✅ This is normal and expected. 🎯 Code Quality HighlightsConsistent Naming PatternThe refactoring follows a clear pattern: // Before (MVVM)
ViewModel -> Presenter
UseCase -> Interactor
viewModel -> presenter
useCase -> interactor
// After (VIPER) - Example
AboutView(
presenter: AboutPresenter(
aboutInteractor: AboutInteractor(container: container),
router: AboutRouter(router: router)
)
)Proper Protocol Updates// Protocol naming updated consistently
protocol AboutUseCaseProtocol -> protocol AboutInteractorProtocol
protocol ChatUseCaseProtocol -> protocol ChatInteractorProtocolTest Variable Renaming// Tests updated comprehensively
let useCase = BookmarksUseCase() -> let interactor = BookmarksInteractor()🚀 Performance Considerations✅ No performance impact expected. This is purely a naming/structural refactoring with no algorithmic or architectural changes. 🔒 Security Considerations✅ No security concerns identified. The refactoring:
📋 Test Coverage✅ Excellent test coverage maintenance:
Example test updates:
✅ Final RecommendationsBefore Merging:
Post-Merge:
📊 Summary
🎉 ConclusionThis is an exemplary refactoring PR. The systematic approach, comprehensive test coverage, and attention to detail make this a low-risk, high-value change. The codebase will be more consistent and easier to understand with proper VIPER terminology. Recommended Action: ✅ Approve after addressing the iOS deployment target question Great work! 🚀 |
Code Review: VIPER Architecture MigrationOverviewThis PR successfully migrates the entire codebase from MVVM to VIPER naming conventions across 106 files. The migration is comprehensive and well-executed with only minor issues that should be addressed. ✅ Strengths
|
Pull Request Review: MVVM to VIPER Architecture MigrationOverviewThis is a comprehensive and well-executed refactoring that migrates the entire codebase from MVVM to VIPER naming conventions. The PR systematically renames ✅ Strengths1. Excellent Organization & Commit Structure
2. Comprehensive Migration
3. Proper VIPER Architecture Adherence
4. Test Coverage Maintained
5. Code Quality Compliance
|
Pull Request Review: MVVM to VIPER Architecture MigrationOverall AssessmentVerdict: Approved with Minor Suggestions ✅ This is an excellent and thorough refactoring. The migration from MVVM to VIPER naming conventions has been executed systematically across all 105 files with strong consistency and attention to detail. Strengths1. Consistent Naming Convention ⭐
2. Excellent Test Coverage ⭐⭐The test migration is comprehensive:
3. Documentation Updates ⭐
4. SwiftLint Compliance ✅
5. Modular Commit Strategy ⭐The 12 module-by-module commits make this PR easy to review and trace changes if needed. Code Quality ObservationsDependency Injection PatternThe
Example from guard let authManager = container.resolve(AuthManager.self) else {
preconditionFailure("Failed to resolve AuthManager for ChatsInteractor")
}This is a valid design choice for the service locator pattern being used. Architecture AdherenceAll changes follow the documented VIPER pattern from CLAUDE.md:
Minor Suggestions (Non-Blocking)1. Xcode Project File AnomalyIn -AFSC00022E7F000000000002 /* Configuration in Frameworks */,
+AFSC00032E7F000000000003 /* Configuration in Frameworks */,This appears to be an Xcode auto-generated change and is harmless, but worth noting if you see unexpected project file changes in the future. 2. Test Coverage ConsiderationWhile existing tests were updated, consider adding tests for:
This is not a blocker for this PR, but could be a future enhancement. Security & Performance✅ No security concerns identified
✅ No performance regressions expected
Test Plan VerificationAccording to the PR description, all tests pass:
Recommendation: Verify the CI/CD pipeline passes before merging. Final RecommendationAPPROVE ✅ This PR demonstrates:
The VIPER architecture migration is complete and production-ready. Excellent work on maintaining consistency across 105 files! Suggested Next Steps (Post-Merge)
Great job on this migration! 🚀 |
PR Review: MVVM to VIPER Architecture MigrationOverviewThis is an excellent systematic refactoring that successfully migrates the entire codebase from MVVM to VIPER naming conventions. The PR is well-organized with 12 module-by-module commits, making it easy to review and track changes. ✅ Strengths1. Comprehensive and Systematic Approach
2. Excellent Code Organization
3. Strong Testing Coverage
4. Adherence to VIPER PrinciplesThe migration maintains proper VIPER separation:
5. Dependency Injection IntegrityAll Interactors properly use DependencyContainer with preconditionFailure for missing dependencies: guard let authManager = container.resolve(AuthManager.self) else {
preconditionFailure("Failed to resolve AuthManager for ChatInteractor")
}📋 Minor Issues Found1. Test Method Comments Still Reference "ViewModel"Several test methods have comments that reference "ViewModel" instead of "Presenter": Files affected:
Example: @Test("Presenter Initializes With Empty Bookmarks")
func testViewModelInitializesWithEmptyBookmarks() { // ⚠️ Still says "ViewModel" in nameRecommendation: Rename test method names from 2. Outdated "UseCase" References in Test CommentsSome test method comments still reference "UseCase" instead of "Interactor": Files affected:
Recommendation: Update test comment from "from UseCase" to "from Interactor". 3. GoogleSignInButtonViewModel Not AffectedFile 🔒 Security Review
🎯 Performance Considerations
🧪 Test Coverage
📚 Documentation Quality
🎨 Code Quality
💡 RecommendationsHigh Priority (Before Merge)None - the PR is ready to merge as-is. Low Priority (Optional Follow-up)
These are cosmetic issues that don't affect functionality. ✨ SummaryThis is an excellent refactoring that demonstrates:
The migration is complete, comprehensive, and maintains code quality throughout. The minor issues identified are purely cosmetic (outdated comments/test names) and don't affect functionality. Recommendation: ✅ APPROVE AND MERGE Great work on this migration! The codebase now has consistent VIPER naming that aligns perfectly with the architectural pattern. Reviewed using repository's CLAUDE.md guidelines for VIPER architecture standards. |
Code Review: MVVM to VIPER Architecture MigrationOverviewThis is a comprehensive and well-executed migration from MVVM to VIPER naming conventions. The PR successfully renames all ViewModels to Presenters and UseCases to Interactors across the entire codebase, including tests and documentation. ✅ Strengths1. Systematic Approach
2. Comprehensive Coverage
3. Code Quality
4. Test Coverage
🔍 Issues Found1. Test Description Comments Still Reference Old Naming
|
PR Review: Architecture Migration from MVVM to VIPEROverall Assessment ✅This is a well-executed architectural refactoring that successfully migrates the entire codebase from MVVM to VIPER naming conventions. The changes are systematic, consistent, and align perfectly with the project's architectural goals as documented in CLAUDE.md. Strengths:
Code Quality Review1. Architecture & Design ⭐⭐⭐⭐⭐Excellent - The migration follows VIPER principles correctly:
Example from ExploreInteractor.swift: init(container: DependencyContainer) {
guard let authManager = container.resolve(AuthManager.self) else {
preconditionFailure("Failed to resolve AuthManager for ExploreInteractor")
}
// ... proper dependency resolution with clear error messages
}2. Naming Conventions ⭐⭐⭐⭐⭐Perfect alignment with CLAUDE.md standards:
3. Code Consolidation ⭐⭐⭐⭐⭐Excellent cleanup work by consolidating duplicate implementations: Removed Files:
Consolidated into:
This reduces code duplication and complexity! 🎯 4. Test Coverage ⭐⭐⭐⭐⭐Comprehensive test updates across all modules: Test files updated:
Well-maintained:
5. Potential Issues & Concerns
|
Pull Request Review: MVVM to VIPER MigrationOverviewThis PR successfully migrates the entire codebase from MVVM to VIPER naming conventions. The refactoring is comprehensive, systematic, and well-executed with 105 files changed across all feature modules. ✅ Strengths1. Excellent Execution & Consistency
2. Architectural Integrity Maintained
3. Comprehensive Test Coverage
4. Documentation Updated
5. Proper Dependency ResolutionAll Interactors correctly use // Example from ChatInteractor.swift:48-69
init(container: DependencyContainer) {
guard let authManager = container.resolve(AuthManager.self) else {
preconditionFailure("Failed to resolve AuthManager for ChatInteractor")
}
// ... more dependencies
}🔍 Code Quality ObservationsExcellent Patterns Found1. Clean Separation of Concerns (ChatPresenter.swift, ChatInteractor.swift)
2. Proper Error Handling
3. Well-Structured Event Tracking
🟡 Minor Observations & Suggestions1. Empty InteractorsSome interactors are minimal placeholders: // OnboardingCommunityInteractor.swift:14-19
@MainActor
final class OnboardingCommunityInteractor {
init(container: DependencyContainer) {}
}Recommendation: This is acceptable for modules with minimal business logic, but consider whether these could eventually be consolidated or removed if they never gain functionality. 2. Inline Business Logic MigrationIn 3. Typo in CommentChatPresenter.swift:151 // if there is no chatm throw error (shold never happen)Suggestion: Minor typo: "chatm" → "chat", "shold" → "should" 4. Profile Module CleanupGood removal of redundant files:
This consolidation improves maintainability. 🔒 Security & Performance✅ No Security Concerns
✅ No Performance Regressions
📊 Test Coverage AssessmentUnit Tests (Modified: 6 test files)
Assessment: Test coverage maintained at same level as before. All existing tests passing. 🎯 Final VerdictSummaryThis is a high-quality architectural refactoring that:
Recommendation: ✅ APPROVEThis PR is ready to merge. The migration is thorough, well-tested, and maintains architectural integrity. The systematic approach (12 module-by-module commits) makes it easy to review and trace changes. 📝 Minor Improvements (Optional Follow-ups)These are not blockers but could be addressed in future PRs:
Great work on this systematic refactoring! 🎉 The codebase now has consistent VIPER naming that aligns with industry-standard Clean Architecture patterns. |
Rename AppViewModel → AppPresenter and AppViewUseCase → AppViewInteractor. Changes: - Rename AppViewUseCase.swift → AppViewInteractor.swift - Rename AppViewModel.swift → AppPresenter.swift - Update AppView.swift to use presenter - Update AppBuilder.swift with new naming - Update CoreBuilder.swift with new parameter names 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Rename ChatViewModel → ChatPresenter and ChatUseCase → ChatInteractor. Changes: - Rename ChatUseCase.swift → ChatInteractor.swift - Rename ChatViewModel.swift → ChatPresenter.swift - Update ChatView.swift to use presenter - Update ChatBuilder.swift with new naming 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Rename ChatsViewModel → ChatsPresenter and ChatsUseCase → ChatsInteractor. Also update ChatRowCell submodule naming. Changes: - Rename ChatsUseCase.swift → ChatsInteractor.swift - Rename ChatsViewModel.swift → ChatsPresenter.swift - Rename ChatRowCellUseCase.swift → ChatRowCellInteractor.swift - Rename ChatRowCellUseCaseProtocol.swift → ChatRowCellInteractorProtocol.swift - Rename ChatRowCellViewModel.swift → ChatRowCellPresenter.swift - Rename AnyChatRowCellUseCase.swift → AnyChatRowCellInteractor.swift - Update all views and builders with new naming 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Rename ProfileViewModel → ProfilePresenter and ProfileUseCase → ProfileInteractor. Remove legacy ProfileInteractor files and update tests. Changes: - Rename ProfileViewModel.swift → ProfilePresenter.swift - Delete ProfileUseCase.swift (replaced by ProfileInteractor.swift) - Delete ProdProfileInteractor.swift (legacy file) - Update ProfileView.swift to use presenter - Update ProfileBuilder.swift with new naming - Update test files (ProfileViewTests, AnyProfileInteractor, MockProfileInteractor) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Rename SettingsViewModel → SettingsPresenter and SettingsUseCase → SettingsInteractor. Changes: - Rename SettingsUseCase.swift → SettingsInteractor.swift - Rename SettingsViewModel.swift → SettingsPresenter.swift - Update SettingsView.swift to use presenter - Update SettingsBuilder.swift with new naming 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Rename AboutViewModel → AboutPresenter and AboutUseCase → AboutInteractor. Changes: - Rename AboutUseCase.swift → AboutInteractor.swift - Rename AboutViewModel.swift → AboutPresenter.swift - Update AboutView.swift to use presenter - Update AboutBuilder.swift with new naming 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Rename all Onboarding ViewModels → Presenters and UseCases → Interactors. Changes: - OnboardingIntro: Rename UseCase/ViewModel → Interactor/Presenter - OnboardingCommunity: Rename UseCase/ViewModel → Interactor/Presenter - OnboardingColor: Rename UseCase/ViewModel → Interactor/Presenter - OnboardingCompleted: Rename UseCase/ViewModel → Interactor/Presenter - Update all views and builders with new naming 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Rename ViewModels → Presenters and UseCases → Interactors for auth flow. Changes: - Welcome: Rename WelcomeUseCase/ViewModel → WelcomeInteractor/Presenter - CreateAccount: Rename CreateAccountUseCase/ViewModel → CreateAccountInteractor/Presenter - Update all views and builders with new naming 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Rename ViewModels → Presenters and UseCases → Interactors for news features. Changes: - NewsFeed: Rename NewsFeedUseCase/ViewModel → NewsFeedInteractor/Presenter - NewsDetails: Rename NewsDetailsUseCase/ViewModel → NewsDetailsInteractor/Presenter - Bookmarks: Rename BookmarksUseCase/ViewModel → BookmarksInteractor/Presenter - Update all views, builders, and test files with new naming - Fix test Mock classes (MockNewsFeedInteractor, MockBookmarksInteractor) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Rename ViewModels → Presenters and UseCases → Interactors for remaining features. Changes: - Explore: Rename ExploreUseCase/ViewModel → ExploreInteractor/Presenter - CategoryList: Rename CategoryListUseCase/ViewModel → CategoryListInteractor/Presenter - DevSettings: Rename DevSettingsUseCase/ViewModel → DevSettingsInteractor/Presenter - CreateAvatar: Rename CreateAvatarUseCase/ViewModel → CreateAvatarInteractor/Presenter - Paywall: Rename PaywallUseCase/ViewModel → PaywallInteractor/Presenter - Update all views and builders with new naming 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Update UseCaseInitializationTests to use new Interactor naming. Changes: - Update test class references from UseCase to Interactor - Update all initialization tests with new naming 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Update project documentation to reflect VIPER architecture naming. Changes: - CLAUDE.md: Update architecture overview from MVVM to VIPER - Update feature structure pattern - Update data flow diagram - Update example code snippets - Update dependency injection examples - README.md: Update architecture description from MVVM to VIPER 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Update file header comments in all Presenter and Interactor files to reflect the actual filename instead of old MVVM naming. Changes: - Update 21 Presenter file headers (ViewModel.swift → Presenter.swift) - Update 1 Interactor file header (UseCase.swift → Interactor.swift) - Update comments in Builder files (UseCase → Interactor) - Update protocol documentation comments - Fix error domain references (ProfileViewModel → ProfilePresenter) - Fix precondition failure messages (CreateAvatarUseCase → CreateAvatarInteractor) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Auto-formatting applied file header comment fixes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Update all remaining useCase and ViewModel references in code and comments. Changes: - Fix AnyChatRowCellInteractor init parameter (useCase → interactor) - Update PaywallConfiguration comment (DevSettingsViewModel → DevSettingsPresenter) - Update NewsFeedInteractor comments (ViewModel → Presenter, UseCase → Interactor) - Fix all print statements in NewsFeedPresenter (ViewModel → Presenter) All references to old MVVM naming have been removed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Rename remaining test files from UseCase to Interactor naming. Changes: - BookmarksUseCaseTests.swift → BookmarksInteractorTests.swift - NewsDetailsUseCaseTests.swift → NewsDetailsInteractorTests.swift - UseCaseInitializationTests.swift → InteractorInitializationTests.swift - Update struct names and file headers in all renamed files All test files now use consistent VIPER naming. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Rename local variable names from useCase to interactor for consistency with VIPER naming convention. Update test descriptions. Changes: - Rename useCase → interactor in BookmarksInteractorTests - Rename useCase → interactor in NewsDetailsInteractorTests - Rename useCase → interactor in ProfileViewTests - Rename useCase → interactor in InteractorInitializationTests - Update test descriptions from "ViewModel" to "Presenter" All test variable names now use consistent VIPER naming. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
… tests Fix CI test failures caused by asynchronous operations not completing before assertions. - ProfileViewTests: Replace fixed 1-second sleeps with polling mechanism for delete operations - NewsDetailsPresenterTests: Use in-memory BookmarkManager for faster, more reliable tests - NewsDetailsInteractorTests: Use in-memory BookmarkManager to avoid SwiftData async save delays - All 134 unit tests now pass consistently - Fixes 3 failures in ProfileViewTests (delete avatar operations) - Fixes 8 failures in NewsDetails tests (bookmark toggle operations) The original tests used `Task.sleep(for: .seconds(1))` after async operations, which was insufficient in CI environments. The fix implements proper polling (up to 5 seconds) to wait for: - Avatar deletion to complete and update presenter state - Bookmark manager events to be tracked - SwiftData context saves to complete Using in-memory BookmarkManager for tests eliminates SwiftData async persistence delays. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
## Summary Fix remaining naming inconsistencies identified after VIPER migration. ## Changes 1. BookmarksBuilder.swift: Rename local variable `viewModel` to `presenter` (line 28) 2. NewsDetailsPresenterTests.swift: Update comment from "Mock NewsDetailsUseCase" to "Mock NewsDetailsInteractor" (line 189) ## Impact - Improves naming consistency across the codebase - Aligns all variable names with VIPER convention - Updates test file comments to match new architecture 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
## Issue After rebasing VIPER onto main, the Swift Configuration package dependency was lost from the Xcode project file, causing build failures. ## Fix - Add XCRemoteSwiftPackageReference for swift-configuration (v1.0.0) - Add Configuration product dependency to AIChat target - Add Configuration to Frameworks build phase - Update Package.resolved with Configuration package info ## Changes - Add package reference: https://github.com/apple/swift-configuration - Link Configuration framework to main target - All 138 tests passing 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Standardize presenter implementations in Settings and Profile modules to align with VIPER architecture patterns, ensuring consistent state management and view updates across the application.
Remove settingsUseCase property and update all references to use settingsInteractor directly for consistency with VIPER naming conventions. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Code Review: VIPER Architecture Migration 🔄OverviewThis is a comprehensive refactoring that migrates the entire codebase from MVVM naming convention to proper VIPER pattern naming. The PR affects 105 files with 1,578 additions and 1,690 deletions. ✅ Strengths1. Systematic and Thorough Approach
2. Consistent Naming Convention
3. Proper File Management
4. Test Coverage MaintainedAll test files properly updated:
5. Dependency Injection PatternAll interactors correctly use guard let authManager = container.resolve(AuthManager.self) else {
preconditionFailure("Failed to resolve AuthManager for ChatInteractor")
}✅ Follows the project's established pattern 6. Documentation UpdatedCommit "docs: update documentation for VIPER architecture" included ✅ 🔍 Code Quality AssessmentArchitecture Compliance
SwiftLint ComplianceBased on CLAUDE.md requirements:
Consistency
|
Summary
Complete migration of the architecture from MVVM to VIPER naming convention.
Changes Overview
ViewModelclasses toPresenterUseCaseclasses toInteractor*UseCaseProtocol→*InteractorProtocol)viewModel→presenter)Modules Migrated
Testing
Commits
This PR contains 12 module-by-module commits for easy review:
Test Plan
🤖 Generated with Claude Code