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 @@ -35,6 +35,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- Result-grid cells on rows marked for deletion keep their dropdown / date / JSON / blob chevron visible at reduced opacity instead of hiding it, so the cell type is still legible while clearly inactive. Click on the dimmed chevron is a no-op; FK arrow navigation is unchanged. Matches the macOS HIG "disabled appearance" guideline.
- Foreign key navigation from a table with unsaved edits opens the referenced table in a new window tab to preserve the edit buffer. Closing that new tab no longer wipes the original tab's data grid. Previously the new tab's teardown broadcast a connection-scoped event that other coordinators on the same connection received, causing them to release their cell data.
- Tables sidebar refreshes automatically after a successful SQL import; the refresh notification now fires after the success sheet's dismissal animation, so the main window is key when the observer runs (#1114)
- PostgreSQL connections honor the import dialog's "Disable foreign key checks" option via `SET session_replication_role = replica` (requires REPLICATION role or superuser; managed Postgres typically rejects it) (#1114)
Expand Down
15 changes: 13 additions & 2 deletions TablePro/Views/Results/Cells/DataGridCellView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ final class DataGridCellView: NSView {

private static let chevronNormal = makeAccessoryImage("chevron.up.chevron.down", pointSize: 10, color: .secondaryLabelColor)
private static let chevronEmphasized = makeAccessoryImage("chevron.up.chevron.down", pointSize: 10, color: .alternateSelectedControlTextColor)
private static let chevronDisabled = makeAccessoryImage("chevron.up.chevron.down", pointSize: 10, color: .tertiaryLabelColor)
private static let fkArrowNormal = makeAccessoryImage("arrow.right.circle.fill", pointSize: 14, color: .secondaryLabelColor)
private static let fkArrowEmphasized = makeAccessoryImage("arrow.right.circle.fill", pointSize: 14, color: .alternateSelectedControlTextColor)

Expand Down Expand Up @@ -263,7 +264,7 @@ final class DataGridCellView: NSView {
let y = (bounds.height - size.height) / 2
return NSRect(x: x, y: y, width: size.width, height: size.height)
case .dropdown, .boolean, .date, .json, .blob:
guard isEditableCell, !visualState.isDeleted else { return .zero }
guard isEditableCell else { return .zero }
let size = NSSize(width: 12, height: 14)
let x = bounds.maxX - DataGridMetrics.cellHorizontalInset - size.width
let y = (bounds.height - size.height) / 2
Expand All @@ -280,7 +281,13 @@ final class DataGridCellView: NSView {
case .foreignKey:
image = onEmphasizedSelection ? Self.fkArrowEmphasized : Self.fkArrowNormal
case .dropdown, .boolean, .date, .json, .blob:
image = onEmphasizedSelection ? Self.chevronEmphasized : Self.chevronNormal
if visualState.isDeleted {
image = Self.chevronDisabled
} else if onEmphasizedSelection {
image = Self.chevronEmphasized
} else {
image = Self.chevronNormal
}
}
image.draw(in: rect, from: .zero, operation: .sourceOver, fraction: 1.0, respectFlipped: true, hints: nil)
}
Expand All @@ -300,6 +307,10 @@ final class DataGridCellView: NSView {
accessoryDelegate?.dataGridCellDidClickFKArrow(row: cellRow, columnIndex: cellColumnIndex)
return
case .dropdown, .boolean, .date, .json, .blob:
guard !visualState.isDeleted else {
super.mouseDown(with: event)
return
}
accessoryDelegate?.dataGridCellDidClickChevron(row: cellRow, columnIndex: cellColumnIndex)
return
case .text:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ extension TableViewCoordinator {
let cellState = DataGridCellState(
visualState: state,
isFocused: isFocused,
isEditable: isEditable && !state.isDeleted,
isEditable: isEditable,
isLargeDataset: isLargeDataset,
row: row,
columnIndex: columnIndex
Expand Down
Loading