Skip to content

refactor: align keyboard shortcuts with macOS HIG (PR 1/20)#959

Closed
datlechin wants to merge 3 commits intomainfrom
refactor/hig-pr1-keyboard-shortcuts
Closed

refactor: align keyboard shortcuts with macOS HIG (PR 1/20)#959
datlechin wants to merge 3 commits intomainfrom
refactor/hig-pr1-keyboard-shortcuts

Conversation

@datlechin
Copy link
Copy Markdown
Member

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

  • Cmd+N now opens "New Connection..." instead of "Manage Connections" (matches HIG "Cmd+N = New X"). Manage Connections moves to the File menu without a default shortcut. (audit P0)
  • Added "New Window" item with Cmd+Ctrl+N that opens a fresh editor window for the most recently active connection (or the welcome window when no connection is active). (audit P0: "No 'New Window' anywhere in the menu")
  • Cmd+D = Duplicate Row. Save as Favorite moves to Cmd+Shift+D (matches Safari "Add to Favorites"). (audit P0)
  • Removed system-shortcut conflicts from default bindings:
    • Cmd+Y (Quick Look) — Show History moved to Cmd+Option+H
    • Cmd+Option+Delete (Empty Trash) — Truncate Table now has no default; menu entry stays
    • Cmd+Ctrl+C (Color Picker / VoiceOver "Read All") — Switch Connection now has no default; menu entry stays
    • Cmd+L (URL bar / Add Link, also collided with Cmd+Shift+L = Format Query) — Explain with AI now has no default; menu entry stays
  • Find submenu in the Edit menu with Find (Cmd+F), Find Next (Cmd+G), Find Previous (Cmd+Shift+G), Use Selection for Find (Cmd+E), Jump to Selection (Cmd+J). All five route through EditorEventRouter to the focused SQL editor. The CodeEditSourceEditor wrapper exposes findNextMatch / findPreviousMatch / setFindText as public methods so the menu can drive the existing find panel. (audit P1)
  • View menu Show/Hide labels flip with state. "Toggle Sidebar / Inspector / Filters / History / Results" become "Show X" / "Hide X" based on current visibility, matching Apple's pattern (Finder, Mail, Xcode). (audit P0)
  • "Save Changes" renamed to "Save" in the File menu, matching TextEdit/Pages/Xcode. (audit P1)

Implementation notes

  • Five new ShortcutAction cases: newConnection, newWindow, find, findNext, findPrevious, useSelectionForFind, jumpToSelection. Each is rebindable via Settings > Keyboard.
  • Five new visibility-state computed properties on MainContentCommandActions (isSidebarVisible, isInspectorVisible, isFilterPanelVisible, isHistoryPanelVisible, isResultsVisible) so the View menu can decide between Show/Hide labels at menu render time.
  • Toolbar tooltip for "Toggle Query History" updated from Cmd+Y to Cmd+Option+H to reflect the new shortcut.

Out of scope (deferred)

Test plan

  • Cmd+N opens the New Connection form (not the Welcome window)
  • Cmd+Ctrl+N opens a new editor window for the active connection
  • File menu: "Manage Connections..." opens the welcome window
  • File menu: "Save" replaces "Save Changes", still disabled with no pending changes
  • Cmd+D duplicates the selected row in the data grid
  • Cmd+Shift+D saves the current query as a favorite (or duplicates the line in the SQL editor when focus is in the editor — same as before)
  • Cmd+Y no longer toggles history; Cmd+Option+H does
  • Cmd+Option+Delete no longer truncates a table; the menu entry still works
  • Cmd+Ctrl+C no longer switches connection; the menu entry still works
  • Cmd+L no longer triggers Explain with AI; the menu entry still works
  • Edit > Find submenu shows Find, Find Next (Cmd+G), Find Previous (Cmd+Shift+G), Use Selection for Find (Cmd+E), Jump to Selection (Cmd+J). Find Next / Find Previous step through matches when the find panel is active
  • View menu shows "Hide Sidebar" when the sidebar is open and "Show Sidebar" when collapsed; same for Inspector / Filters / History / Results
  • Toolbar tooltip on the History button now reads ⌥⌘H instead of ⌘Y
  • Verified manually (build/lint/tests run by reviewer)

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

https://github.com/TableProApp/TablePro/blob/a0fb38eb6bea9c9989e8bd4edfbcd18eaed3c5ed/TableProApp.swift#L126-L129
P2 Badge 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".

@datlechin datlechin closed this May 1, 2026
@datlechin datlechin deleted the refactor/hig-pr1-keyboard-shortcuts branch May 1, 2026 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant