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

### Fixed

- Opening a query tab no longer pulls keyboard focus away from the sidebar or another control; the editor takes focus only when nothing else holds it. VoiceOver now labels the SQL editor and the Clear and Format buttons. (#1490)
- The connection form opens with the Name field focused, Return or the Down arrow in the welcome search moves to the connection list, and focus returns to the list after a sheet closes, so you can set up a connection without the mouse. (#1490)
- Escape now dismisses search-based sheets and popovers (database switcher, quick switcher, column and connection pickers). Pressing Escape clears the search text first; a second Escape closes the sheet. (#1490)
- Running `EXPLAIN` or `EXPLAIN ANALYZE` typed in the editor now opens the plan viewer instead of squashing the plan into one truncated grid cell. (#1480)
Expand Down
2 changes: 2 additions & 0 deletions TablePro/Views/Editor/QueryEditorView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ struct QueryEditorView: View {
}
.buttonStyle(.borderless)
.help(String(localized: "Clear Query"))
.accessibilityLabel(String(localized: "Clear Query"))

// Format button
Button(action: formatQuery) {
Expand All @@ -108,6 +109,7 @@ struct QueryEditorView: View {
}
.buttonStyle(.borderless)
.help(String(localized: "Format Query (⇧⌘L)"))
.accessibilityLabel(String(localized: "Format Query"))
.optionalKeyboardShortcut(AppSettingsManager.shared.keyboard.keyboardShortcut(for: .formatQuery))

Divider()
Expand Down
3 changes: 2 additions & 1 deletion TablePro/Views/Editor/SQLEditorCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ final class SQLEditorCoordinator: TextViewCoordinator, TextViewDelegate {
// Auto-focus: make the editor first responder, then ensure a
// cursor exists. Order matters — setCursorPositions calls
// updateSelectionViews which guards on isFirstResponder.
if !self.isDestroyed, let window = textView.window {
if !self.isDestroyed, let window = textView.window,
window.firstResponder == nil || window.firstResponder === window {
window.makeFirstResponder(textView)
}
if controller.cursorPositions.isEmpty {
Expand Down
1 change: 1 addition & 0 deletions TablePro/Views/Editor/SQLEditorView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ struct SQLEditorView: View {
coordinators: [coordinator],
completionDelegate: completionAdapter
)
.accessibilityLabel(String(localized: "SQL query editor"))
.onChange(of: editorState.cursorPositions) { _, newValue in
guard let positions = newValue else { return }
// Skip cursor propagation when the editor doesn't have focus
Expand Down
Loading