Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- Data grid now serves the row count from its existing cache instead of recomputing it on every layout pass, reducing CPU churn while scrolling large result sets.
- Typing in the sidebar table search stays responsive on databases with thousands of tables; filtering runs after a short pause instead of on every keystroke.

### Fixed
Expand Down
4 changes: 1 addition & 3 deletions TablePro/Views/Results/DataGridCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ final class TableViewCoordinator: NSObject, NSTableViewDelegate, NSTableViewData
let cellFactory = DataGridCellFactory()
let cellRegistry: DataGridCellRegistry
let columnPool = DataGridColumnPool()
let tableRowsController = TableRowsController()
let selectionController = GridSelectionController()
var overlayEditor: CellOverlayEditor?
var overlayViewer: CellOverlayViewer?
Expand Down Expand Up @@ -234,7 +233,6 @@ final class TableViewCoordinator: NSObject, NSTableViewDelegate, NSTableViewData
}
tableView.reloadData()
}
tableRowsController.detach()
delegate = nil
activeFKPreviewPopover?.close()
clearFKPreviewState()
Expand Down Expand Up @@ -713,7 +711,7 @@ final class TableViewCoordinator: NSObject, NSTableViewDelegate, NSTableViewData
// MARK: - NSTableViewDataSource

func numberOfRows(in tableView: NSTableView) -> Int {
sortedIDs?.count ?? tableRowsProvider().count
sortedIDs?.count ?? cachedRowCount
}
}

Expand Down
2 changes: 0 additions & 2 deletions TablePro/Views/Results/DataGridView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ struct DataGridView: NSViewRepresentable {
context.coordinator.tableView = tableView
installSelectionOverlay(tableView: tableView, coordinator: context.coordinator)
context.coordinator.attachScrollObservers(scrollView: scrollView)
context.coordinator.tableRowsController.attach(tableView)
context.coordinator.tableRowsProvider = tableRowsProvider
context.coordinator.tableRowsMutator = tableRowsMutator
context.coordinator.paginationOffsetProvider = paginationOffsetProvider
Expand Down Expand Up @@ -426,7 +425,6 @@ struct DataGridView: NSViewRepresentable {
coordinator.persistColumnLayoutToStorage()
coordinator.settingsCancellable = nil
coordinator.themeCancellable = nil
coordinator.tableRowsController.detach()
}

func makeCoordinator() -> TableViewCoordinator {
Expand Down
12 changes: 4 additions & 8 deletions TablePro/Views/Results/Extensions/DataGridView+CellCommit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,10 @@ extension TableViewCoordinator {
in: tableView,
schema: identitySchema
) else { return }
if case .cellChanged = delta {
tableRowsController.apply(.cellChanged(row: row, column: tableColumnIndex))
} else {
tableView.reloadData(
forRowIndexes: IndexSet(integer: row),
columnIndexes: IndexSet(integer: tableColumnIndex)
)
}
tableView.reloadData(
forRowIndexes: IndexSet(integer: row),
columnIndexes: IndexSet(integer: tableColumnIndex)
)
}

@discardableResult
Expand Down
54 changes: 0 additions & 54 deletions TablePro/Views/Results/TableRowsController.swift

This file was deleted.

156 changes: 0 additions & 156 deletions TableProTests/Views/Results/TableRowsControllerTests.swift

This file was deleted.

Loading
Loading