Centralize keyboard shortcuts following macOS HIG patterns#3
Closed
Centralize keyboard shortcuts following macOS HIG patterns#3
Conversation
- Create centralized KeyboardShortcuts.swift with all shortcut definitions - Add KeyCodes enum for consistent key code references - Add ShortcutDocumentation for help/settings display - Update OpenTableApp.swift to use KeyboardShortcuts enum - Add Query menu with Execute Query (⌘↩) and Format Query (⌘⇧L) - Refactor DataGridView, EditorTextView, ContentView, HistoryListViewController - Refactor SQLCompletionWindowController, NSViewController+SwiftUI - Update SidebarView and QueryTabBar to use centralized shortcuts - Update README.md with comprehensive keyboard shortcut documentation - Update CLAUDE.md to reflect new keyboard shortcut organization Co-authored-by: datlechin <56961917+datlechin@users.noreply.github.com>
Co-authored-by: datlechin <56961917+datlechin@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Refactor feature shortcuts to follow macOS pattern
Centralize keyboard shortcuts following macOS HIG patterns
Dec 23, 2025
datlechin
added a commit
that referenced
this pull request
Apr 28, 2026
- crates/app/src/services/structure_tracker.rs: per-tab DDL changeset
registry. Mirrors change_tracker.rs (thread-local registry keyed
by tab UUID, subscription channel, undo / redo stacks) but at the
schema-operation level. StructureOp covers CreateTable, RenameTable,
AddColumn, DropColumn, RenameColumn, AlterColumn, ReorderColumn
(MySQL only), AddIndex, DropIndex, AddForeignKey, DropForeignKey.
materialize() walks the op log and emits ordered DDL statements
per driver dialect. Statement ordering avoids dependency errors:
rename-table → drop-FK → drop-index → drop-column → rename-column
→ alter-column → add-column → reorder → add-index → add-FK. For
New mode (single CreateTable op) the fast path delegates straight
to build_create_table.
MySQL alter grouping: all AlterColumn ops on the same column
collapse into one MODIFY COLUMN reflecting the latest state, so
multi-attribute changes don't produce three statements that each
re-state the whole definition.
- crates/app/src/services/workspace_state.rs: extend WorkspaceTabRecord
with Structure { schema, table } variant for Edit-mode persistence.
New mode is intentionally not persisted (drafts for non-existent
tables shouldn't survive disconnect). Added #[serde(other)] Unknown
variant for forward-compat: an older binary reading newer state
silently drops unrecognised tab kinds rather than failing the
entire workspace load. clamp_connection retains-out Unknown
variants up front so they don't contribute to count or active_idx.
- crates/app/src/ui/app/workspace_tabs.rs: extend restore_workspace_tabs
with placeholder Structure / Unknown match arms (no-op for now;
the actual append_structure_tab wiring lands in the next milestone).
8 unit tests cover push/undo round-trips, clear, materialize ordering
across all op types, MySQL alter-grouping, Postgres per-attribute
emission, and registry tab-isolation.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
14 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Keyboard shortcuts were scattered across the codebase using hardcoded key codes and inline shortcut definitions, making them difficult to maintain and inconsistent with macOS conventions.
Changes
New
Core/KeyboardShortcuts.swiftKeyboardShortcutsenum: All SwiftUI menu shortcuts in one placeKeyCodesenum: AppKit key codes replacing magic numbersShortcutDocumentation: Structured shortcut info for help/settingsRefactored Views
DataGridView,EditorTextView,ContentView,HistoryListViewController,SQLCompletionWindowController,NSViewController+SwiftUI: Replace hardcoded key codes withKeyCodesenumSidebarView,QueryTabBar,QueryEditorView: UseKeyboardShortcutsfor menu itemsMenu Updates
Example
Before:
After:
Menu shortcuts:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.