Skip to content

Commit cd81f16

Browse files
committed
fix: add index shifting for batch row insertion redo, remove dead stub
1 parent 76bae91 commit cd81f16

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

TablePro/ContentView.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -431,10 +431,6 @@ struct ContentView: View {
431431
}
432432
}
433433

434-
private func saveCurrentSessionState() {
435-
// State is automatically saved through bindings
436-
}
437-
438434
// MARK: - Persistence
439435

440436
private func deleteConnection(_ connection: DatabaseConnection) {

TablePro/Core/ChangeTracking/DataChangeManager.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -665,6 +665,11 @@ final class DataChangeManager {
665665
action: action, needsRowRemoval: true, needsRowRestore: false, restoreRow: nil
666666
)
667667
} else {
668+
// Shift existing rows up for each insertion point (ascending order)
669+
for rowIndex in rowIndices.sorted() {
670+
shiftRowIndicesUp(from: rowIndex)
671+
}
672+
668673
for (index, rowIndex) in rowIndices.enumerated().reversed() {
669674
guard index < rowValues.count else { continue }
670675
let values = rowValues[index]

0 commit comments

Comments
 (0)