refactor: wave 2 high-impact consolidation#189
Merged
Conversation
- Extract SQLStatementScanner from 3 duplicate FSM implementations - Move AI provider resolution (resolveProvider/resolveModel) to AIProviderFactory - Add DatabaseType.beginTransactionSQL computed property, replacing 5 switches + 1 helper - Centralize 12 scattered notification names into AppNotifications.swift - Fix MySQL/MariaDB getting BEGIN instead of START TRANSACTION in table operations and SQL preview - Fix SQLContextAnalyzer missing block comment, double-quote, and backtick handling - Fix flaky history tests caused by clearAllHistory cross-suite interference
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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
Wave 2 of the refactoring plan from REFACTOR_TRACKER.md. Consolidates the highest-impact code duplication across 4 independent items, each touching different files with no overlap.
DUP-1: Extract SQLStatementScanner
SQLStatementScannerenum consolidates 3 duplicate SQL statement-boundary FSMs into oneMainContentCoordinator,MainContentCoordinator+MultiStatement, andSQLContextAnalyzer/* */), double-quote, and backtick handlingDUP-2: Move AI provider resolution to AIProviderFactory
resolveProvider(for:settings:)andresolveModel(for:config:settings:)toAIProviderFactoryInlineSuggestionManagerandAIChatViewModel(~60 lines)DUP-3: Add DatabaseType.beginTransactionSQL
MainContentCoordinator+TableOperationsandMainContentCoordinator+SQLPreviewgave MySQL/MariaDB"BEGIN"instead of"START TRANSACTION"NOTIF-1: Centralize notification names
Notification.Nameextensions from 6 files into newAppNotifications.swiftTest fixes
QueryHistoryStorage/HistoryDataProvidertests caused byclearAllHistory()cross-suite interferenceQueryHistoryStorage(isolatedForTesting:)andQueryHistoryManager(isolatedStorage:)for test isolationStats
Test plan
SQLStatementScannerTestspassSQLContextAnalyzerTestspass (43 tests)xcodebuild buildsucceeds