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
12 changes: 6 additions & 6 deletions .github/hub-ratchet-baseline.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"MenuValidationContext stored properties": 87,
"menu validation `case #selector` arms": 117,
"MenuValidationContext stored properties": 86,
"menu validation `case #selector` arms": 116,
"ShortcutAction cases": 98,
"TabType cases": 9,
"SettingsPane cases": 12,
"ActiveSheet cases": 18,
"ActiveSheet cases": 17,
"LaunchIntent cases": 16,
"shell extensions named for a module or engine": 11,
"MainContentCoordinator+ files": 67,
"app types AppDelegate names": 66,
"app types AppDelegate names": 65,
"files under TablePro/ named for BigQuery": 0,
"files under TablePro/ named for Beancount": 0,
"files under TablePro/ named for Cassandra": 0,
Expand All @@ -17,7 +17,7 @@
"files under TablePro/ named for CockroachDB": 0,
"files under TablePro/ named for Dameng": 0,
"files under TablePro/ named for Databend": 0,
"files under TablePro/ named for DuckDB": 3,
"files under TablePro/ named for DuckDB": 2,
"files under TablePro/ named for DynamoDB": 3,
"files under TablePro/ named for Elasticsearch": 1,
"files under TablePro/ named for etcd": 2,
Expand All @@ -36,7 +36,7 @@
"files under TablePro/ named for Snowflake": 0,
"files under TablePro/ named for Spanner": 0,
"files under TablePro/ named for SQL Server": 2,
"files under TablePro/ named for SQLite": 11,
"files under TablePro/ named for SQLite": 10,
"files under TablePro/ named for SurrealDB": 1,
"files under TablePro/ named for Teradata": 0,
"files under TablePro/ named for TiDB": 0,
Expand Down
9 changes: 1 addition & 8 deletions TablePro/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
}

func applicationWillTerminate(_ notification: Notification) {
persistOpenConnectionsForRecovery()
SessionRecoveryTracker.saveOnQuit()
/// Synchronously, because an actor hop at terminate may never be scheduled: a session killed
/// mid-reply used to come back with its last turn missing.
AgentSessionRegistry.shared.persistSynchronouslyForTermination()
Expand All @@ -211,13 +211,6 @@ class AppDelegate: NSObject, NSApplicationDelegate {
RemoteSQLiteTransportManager.shared.terminateAllProcessesSync()
}

private func persistOpenConnectionsForRecovery() {
let connectionIds = SessionRecoveryTracker.connectionIds()
let origin = AppActivationPolicyController.shared.origin
guard RecoveryConnectionList.shouldSaveOnQuit(connectionIds, origin: origin) else { return }
LastOpenConnectionsStorage.shared.save(connectionIds: connectionIds)
}

@objc func handleSystemDidWake(_ notification: Notification) {
SQLFolderWatcher.shared.reload()
}
Expand Down
8 changes: 8 additions & 0 deletions TablePro/Core/Storage/SessionRecoveryTracker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,12 @@ enum SessionRecoveryTracker {
guard !MainContentCoordinator.isAppTerminating, let storage else { return }
storage.save(connectionIds: connectionIds())
}

static func saveOnQuit() {
let ids = connectionIds()
guard let storage,
RecoveryConnectionList.shouldSaveOnQuit(ids, origin: AppActivationPolicyController.shared.origin)
else { return }
storage.save(connectionIds: ids)
}
}
52 changes: 25 additions & 27 deletions TableProTests/Core/Menu/ChromeSnapshot.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
{"path": "File", "separator": true},
{"path": "File > Backup Dump…", "action": "backupDatabase:"},
{"path": "File > Restore Dump…", "action": "restoreDatabase:"},
{"path": "File > Server-Side Export…", "action": "serverSideExport:"},
{"path": "Edit"},
{"path": "Edit > Undo", "identifier": "shortcut.undo", "action": "undo:", "key": "z", "modifiers": ["command"]},
{"path": "Edit > Redo", "identifier": "shortcut.redo", "action": "redo:", "key": "z", "modifiers": ["shift", "command"]},
Expand Down Expand Up @@ -96,35 +95,35 @@
{"path": "Edit", "separator": true},
{"path": "Edit > Restore Previous Values…", "identifier": "shortcut.restorePreviousValues", "action": "restorePreviousValues:"},
{"path": "Edit", "separator": true},
{"path": "Edit > Data"},
{"path": "Edit > Data > Insert Row Above", "action": "dataFileInsertRowAbove:"},
{"path": "Edit > Data > Insert Row Below", "action": "dataFileInsertRowBelow:"},
{"path": "Edit > Data > Delete Rows", "action": "dataFileDeleteSelectedRows:"},
{"path": "Edit > Data", "identifier": "edit.data", "hidden": true},
{"path": "Edit > Data > Insert Row Above", "action": "dataFileInsertRowAbove:", "hidden": true},
{"path": "Edit > Data > Insert Row Below", "action": "dataFileInsertRowBelow:", "hidden": true},
{"path": "Edit > Data > Delete Rows", "action": "dataFileDeleteSelectedRows:", "hidden": true},
{"path": "Edit > Data", "separator": true},
{"path": "Edit > Data > Add Column…", "action": "dataFileAddColumn:"},
{"path": "Edit > Data > Insert Column Left", "action": "dataFileInsertColumnLeft:"},
{"path": "Edit > Data > Insert Column Right", "action": "dataFileInsertColumnRight:"},
{"path": "Edit > Data > Rename Column…", "action": "dataFileRenameColumn:"},
{"path": "Edit > Data > Split Column…", "action": "dataFileSplitColumn:"},
{"path": "Edit > Data > Merge Columns…", "action": "dataFileMergeColumns:"},
{"path": "Edit > Data > Delete Column", "action": "dataFileDeleteColumn:"},
{"path": "Edit > Data > Add Column…", "action": "dataFileAddColumn:", "hidden": true},
{"path": "Edit > Data > Insert Column Left", "action": "dataFileInsertColumnLeft:", "hidden": true},
{"path": "Edit > Data > Insert Column Right", "action": "dataFileInsertColumnRight:", "hidden": true},
{"path": "Edit > Data > Rename Column…", "action": "dataFileRenameColumn:", "hidden": true},
{"path": "Edit > Data > Split Column…", "action": "dataFileSplitColumn:", "hidden": true},
{"path": "Edit > Data > Merge Columns…", "action": "dataFileMergeColumns:", "hidden": true},
{"path": "Edit > Data > Delete Column", "action": "dataFileDeleteColumn:", "hidden": true},
{"path": "Edit > Data", "separator": true},
{"path": "Edit > Data > Fill Down", "action": "dataFileFillDown:"},
{"path": "Edit > Data > Set Cells to Value…", "action": "dataFileSetCellsToValue:"},
{"path": "Edit > Data > Trim Whitespace", "action": "dataFileTrimWhitespace:"},
{"path": "Edit > Data > Change Case"},
{"path": "Edit > Data > Change Case > UPPERCASE", "action": "dataFileChangeCase:"},
{"path": "Edit > Data > Change Case > lowercase", "action": "dataFileChangeCase:"},
{"path": "Edit > Data > Change Case > Title Case", "action": "dataFileChangeCase:"},
{"path": "Edit > Data > Replace in Column…", "action": "dataFileReplaceInColumn:"},
{"path": "Edit > Data > Remove Duplicate Rows…", "action": "dataFileRemoveDuplicates:"},
{"path": "Edit > Data > Fill Down", "action": "dataFileFillDown:", "hidden": true},
{"path": "Edit > Data > Set Cells to Value…", "action": "dataFileSetCellsToValue:", "hidden": true},
{"path": "Edit > Data > Trim Whitespace", "action": "dataFileTrimWhitespace:", "hidden": true},
{"path": "Edit > Data > Change Case", "hidden": true},
{"path": "Edit > Data > Change Case > UPPERCASE", "action": "dataFileChangeCase:", "hidden": true},
{"path": "Edit > Data > Change Case > lowercase", "action": "dataFileChangeCase:", "hidden": true},
{"path": "Edit > Data > Change Case > Title Case", "action": "dataFileChangeCase:", "hidden": true},
{"path": "Edit > Data > Replace in Column…", "action": "dataFileReplaceInColumn:", "hidden": true},
{"path": "Edit > Data > Remove Duplicate Rows…", "action": "dataFileRemoveDuplicates:", "hidden": true},
{"path": "Edit > Data", "separator": true},
{"path": "Edit > Data > Column Statistics…", "action": "dataFileShowStatistics:"},
{"path": "Edit > Data > Search All Columns", "action": "dataFileSearchAllColumns:"},
{"path": "Edit > Data > Column Statistics…", "action": "dataFileShowStatistics:", "hidden": true},
{"path": "Edit > Data > Search All Columns", "action": "dataFileSearchAllColumns:", "hidden": true},
{"path": "Edit > Data", "separator": true},
{"path": "Edit > Data > Switch First Row Between Header and Data", "identifier": "shortcut.toggleHeaderRow", "action": "dataFileToggleHeaderRow:", "key": "h", "modifiers": ["shift", "command"]},
{"path": "Edit > Data > File Properties…", "action": "dataFileShowProperties:"},
{"path": "Edit > Data > Import into Table…", "action": "dataFileImportIntoTable:"},
{"path": "Edit > Data > Switch First Row Between Header and Data", "identifier": "shortcut.toggleHeaderRow", "action": "dataFileToggleHeaderRow:", "key": "h", "modifiers": ["shift", "command"], "hidden": true},
{"path": "Edit > Data > File Properties…", "action": "dataFileShowProperties:", "hidden": true},
{"path": "Edit > Data > Import into Table…", "action": "dataFileImportIntoTable:", "hidden": true},
{"path": "View"},
{"path": "View > Show Sidebar", "identifier": "shortcut.toggleTableBrowser", "action": "toggleSidebar:", "key": "0", "modifiers": ["command"]},
{"path": "View > Show Inspector", "identifier": "shortcut.toggleInspector", "action": "toggleInspector:", "key": "i", "modifiers": ["option", "command"]},
Expand Down Expand Up @@ -347,7 +346,6 @@
"com.TablePro.toolbar.results",
"com.TablePro.toolbar.export",
"com.TablePro.toolbar.import",
"com.TablePro.toolbar.dashboard",
"com.TablePro.toolbar.history",
"com.TablePro.toolbar.addRow",
"com.TablePro.toolbar.restorePreviousValues",
Expand Down
15 changes: 2 additions & 13 deletions TableProTests/Core/Menu/ChromeSnapshotTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -94,20 +94,9 @@ private enum ChromeSnapshot {
"""
}

// MainMenuBuilder.build assigns NSApp's Services, Window and Help menus. The app's own are put
// back so the test host keeps the menu bar it launched with.
private static func menuBarEntries() -> [String] {
let app = NSApplication.shared
let services = app.servicesMenu
let windows = app.windowsMenu
let help = app.helpMenu
defer {
app.servicesMenu = services
app.windowsMenu = windows
app.helpMenu = help
}
let menu = MainMenuBuilder.build(keyboard: KeyboardSettings())
return entries(in: menu, path: [], appKitOwned: app.servicesMenu)
let built = MainMenuBuilder.build(keyboard: KeyboardSettings())
return entries(in: built.bar, path: [], appKitOwned: built.servicesMenu)
}

// AppKit fills the Services menu and appends open windows to the Window menu, so neither is
Expand Down
Loading