From b6f678b1f543bf4598e72b69ad82e03146a922b8 Mon Sep 17 00:00:00 2001 From: Ngo Quoc Dat Date: Wed, 23 Sep 2026 13:47:56 +0700 Subject: [PATCH] fix(settings): name Command-[ Outdent and Command-] Indent to match the editor --- CHANGELOG.md | 1 + TablePro/Models/UI/KeyboardShortcutModels.swift | 4 ++-- TableProTests/Models/KeyboardShortcutTests.swift | 15 +++++++++++++++ docs/features/keyboard-shortcuts.mdx | 8 ++++---- 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e2e438bd59..9146394d24 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -321,6 +321,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Destination folder and the first database reading as one path in the backup result sheet. (#3046) - Only the last line of a failed backup's error shown, which on `pg_dump` is the hint rather than the cause. - Backup failure reported as an exit code alone when the tool wrote its message and exited at once. +- Indent and Outdent named the wrong way round for Command-[ and Command-] in Settings > Keyboard. ### Security diff --git a/TablePro/Models/UI/KeyboardShortcutModels.swift b/TablePro/Models/UI/KeyboardShortcutModels.swift index 6ad73391a4..626997e32a 100644 --- a/TablePro/Models/UI/KeyboardShortcutModels.swift +++ b/TablePro/Models/UI/KeyboardShortcutModels.swift @@ -333,8 +333,8 @@ extension ShortcutAction { /// editor-context binding. static let editorBuiltIns: [(key: BoundKey, name: String)] = [ (.character("/", command: true), String(localized: "Toggle Comment")), - (.character("[", command: true), String(localized: "Indent")), - (.character("]", command: true), String(localized: "Outdent")), + (.character("[", command: true), String(localized: "Outdent")), + (.character("]", command: true), String(localized: "Indent")), (.character("d", command: true, shift: true), String(localized: "Duplicate Line")), (.character("k", command: true, shift: true), String(localized: "Delete Line")), (.special(.space, control: true), String(localized: "Show Completions")), diff --git a/TableProTests/Models/KeyboardShortcutTests.swift b/TableProTests/Models/KeyboardShortcutTests.swift index d3deaedf88..0cbf95c162 100644 --- a/TableProTests/Models/KeyboardShortcutTests.swift +++ b/TableProTests/Models/KeyboardShortcutTests.swift @@ -55,6 +55,21 @@ struct ShortcutActionDefaultsTests { } } +@Suite("Editor built-in shortcut names") +struct EditorBuiltInNameTests { + @Test("Command-[ is Outdent and Command-] is Indent") + func bracketsAreNamedAsTheEditorMapsThem() { + #expect( + ShortcutAction.reservedConflict(for: .character("[", command: true), context: .editor) + == String(localized: "Outdent") + ) + #expect( + ShortcutAction.reservedConflict(for: .character("]", command: true), context: .editor) + == String(localized: "Indent") + ) + } +} + @Suite("Default shortcut hygiene") struct DefaultShortcutHygieneTests { @Test("No default uses Control without Command") diff --git a/docs/features/keyboard-shortcuts.mdx b/docs/features/keyboard-shortcuts.mdx index 8816753709..ff48c1a224 100644 --- a/docs/features/keyboard-shortcuts.mdx +++ b/docs/features/keyboard-shortcuts.mdx @@ -3,13 +3,13 @@ title: Keyboard Shortcuts description: Every keyboard shortcut in TablePro, plus how to rebind them in Settings > Keyboard --- -Focus decides what a key does: `Cmd+[` indents in the SQL editor and pages back in the data grid, and neither one shadows the other. Everything here is the shipped default, and most of it is rebindable in **Settings > Keyboard**. +Focus decides what a key does: `Cmd+[` outdents in the SQL editor and pages back in the data grid, and neither one shadows the other. Everything here is the shipped default, and most of it is rebindable in **Settings > Keyboard**. ## Same key, different pane | Key | In the SQL editor | In the data grid | |-----|-------------------|------------------| -| `Cmd+[` and `Cmd+]` | Indent and outdent | Previous and next page | +| `Cmd+[` and `Cmd+]` | Outdent and indent | Previous and next page | | `Cmd+F` | Find in the text | Find in the loaded rows | | `Cmd+Delete` | Delete to the start of the line | Delete the selected rows | | `Option+Delete` | Delete the previous word | Truncate the tables selected in the sidebar | @@ -65,8 +65,8 @@ The grid meanings come back the moment you click into the grid, and `Delete` on | Action | Shortcut | |--------|----------| | Toggle comment | `Cmd+/` | -| Indent | `Cmd+[` | -| Outdent | `Cmd+]` | +| Indent | `Cmd+]` | +| Outdent | `Cmd+[` | | Duplicate line | `Cmd+Shift+D` | | Delete line | `Cmd+Shift+K` | | Move line up | `Option+Up` |