fix: unify sidebar and data grid save pipelines#344
Merged
Conversation
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughRefactored SQL generation to use a unified pipeline: extracted a centralized helper method in DataChangeManager, replaced per-row statement generation with a changes array approach in sidebar save flow, improved change detection logic in command actions, and added keyboard shortcut handling for committing cell edits. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
Comment |
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
saveSidebarEdits) had its own parallel statement generation pipeline that only handled Redis specifically and fell through toSQLStatementGeneratorfor everything else. When data grid edits synced to the sidebar viaexternallyModifiedColumns, Cmd+S took the sidebar path (checked before data grid path), generating SQLUPDATEstatements for NoSQL databases like etcd/MongoDB.DataChangeManager.generateSQL(for:)as a parameterized entry point, route sidebar edits through it. Both data grid and sidebar now use the same plugin dispatch → NoSQL guard → SQL fallback pipeline.saveChanges()now checkschangeManager.hasChangesbeforeeditState.hasEdits, so data grid edits always use the data grid save path.CellFieldEditor.performKeyEquivalentcommits inline edits on Cmd+S before menu fires (mirrors existingOverlayTextViewbehavior).Before (165 lines, 4 duplication points in SidebarSave):
PluginRowChangeconstruction, ownSQLStatementGeneratorsetup, dead Redis-specific code, no coverage validationAfter (54 lines, 0 duplication):
[RowChange], callschangeManager.generateSQL(for:)— one lineTest plan
Summary by CodeRabbit
Release Notes
New Features
Improvements