refactor: align keyboard shortcuts with macOS HIG (PR 1/20)#959
refactor: align keyboard shortcuts with macOS HIG (PR 1/20)#959
Conversation
There was a problem hiding this comment.
💡 Codex Review
https://github.com/TableProApp/TablePro/blob/a0fb38eb6bea9c9989e8bd4edfbcd18eaed3c5ed/TableProApp.swift#L126-L129
Resolve New Window from existing sessions before welcome fallback
openNewMainWindow() only derives connectionId from the focused command actions or the current keyWindow, then immediately falls back to WelcomeWindowFactory.openOrFront(). In windows where keyWindow is not a main editor window (for example Settings or the connection form), this path opens Welcome even if other editor windows/connections are already active, so File → New Window does not reliably create a new editor window for an existing connection.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Summary
PR 1 of the HIG audit refactor stream. Targets the Top-priority list from
docs/refactor/hig-audit/01-menus-shortcuts.md. Scope is bounded to keyboard shortcut and menu rewording. Other audit findings are deferred to later PRs in the sequence.Fixes applied
EditorEventRouterto the focused SQL editor. The CodeEditSourceEditor wrapper exposesfindNextMatch/findPreviousMatch/setFindTextas public methods so the menu can drive the existing find panel. (audit P1)Implementation notes
ShortcutActioncases:newConnection,newWindow,find,findNext,findPrevious,useSelectionForFind,jumpToSelection. Each is rebindable via Settings > Keyboard.MainContentCommandActions(isSidebarVisible,isInspectorVisible,isFilterPanelVisible,isHistoryPanelVisible,isResultsVisible) so the View menu can decide between Show/Hide labels at menu render time.Cmd+YtoCmd+Option+Hto reflect the new shortcut.Out of scope (deferred)
Test plan
Cmd+Nopens the New Connection form (not the Welcome window)Cmd+Ctrl+Nopens a new editor window for the active connectionCmd+Dduplicates the selected row in the data gridCmd+Shift+Dsaves the current query as a favorite (or duplicates the line in the SQL editor when focus is in the editor — same as before)Cmd+Yno longer toggles history;Cmd+Option+HdoesCmd+Option+Deleteno longer truncates a table; the menu entry still worksCmd+Ctrl+Cno longer switches connection; the menu entry still worksCmd+Lno longer triggers Explain with AI; the menu entry still works⌥⌘Hinstead of⌘Y