refactor: extract PaginationCoordinator and RowEditingCoordinator#1127
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase 4 step 4. Two more focused coordinators extracted from MainContentCoordinator's 5 extension files (~903 LOC moved). Same pattern as PR #1125 (FilterCoordinator + QueryExecutionCoordinator). State stays on
tabManager.tabsand is mutated via themutate(tabId:)API from PR #1124.Extracted
PaginationCoordinator (Core/Coordinators/PaginationCoordinator.swift, 221 LOC)
+Pagination.swift(~77 LOC) ++LoadMore.swift(~150 LOC).[weak self, parent](avoids the dangling-unowned-parent bug PR refactor: extract FilterCoordinator and QueryExecutionCoordinator #1125 had to follow up).RowEditingCoordinator (Core/Coordinators/, 3 files, 682 LOC)
+SaveChanges.swift(314 LOC) and+Discard.swift(127 LOC).[weak self, parent]or[parent].Forwarders
22 thin forwarders kept on existing extension files so views and tests compile unchanged:
Out of scope
MainContentCoordinator+TabSwitch.swift(audit score -10, undo manager coupling). Stays for now.runQuery,executeQueryInternal, etc.) stay on MainContentCoordinator.assemblePendingStatementsandfkEnableStatementsstay on parent — RowEditingCoordinator+SaveChanges accesses viaparent.X. Tests reference them directly, not in scope to relocate.Verification
grep -nE "Task \\{|Task\\(" TablePro/Core/Coordinators/Pagination*.swift TablePro/Core/Coordinators/RowEditing*.swiftshows every Task uses[parent]capture.TableProTests/Core/Storage/QueryHistoryManagerTests.swift(type 'NSNotification.Name?' has no member 'queryHistoryDidUpdate') is unrelated to this refactor — file unchanged vs main.Commits
Test plan