Part of #304, which stays open. This replaces #317 with the key layout the owner chose.
Keys:
- / opens search (the command palette) from anywhere except a text field, as on GitHub.
- Ctrl K (⌘K on a Mac) opens the keyboard shortcuts, and so does ?.
- Both work everywhere except in text fields.
- Inside a text field, Ctrl K stays the field's own, e.g. inserting a link in Chat's editor.
- Nothing else in the app or the desktop app binds Ctrl K.
What shows the keys:
- The search fields show /.
- The account menu shows Ctrl K beside Keyboard shortcuts.
- The shortcuts dialog lists both keys.
- The Ask panel used to catch Ctrl K to refocus its box. It now catches / instead.
Helpers: lib/shortcut.ts now has PALETTE_KEY, shortcutsKeyLabel and modKeyLabel. modKeyLabel also gives the sidebar's Ctrl B label. inTextField, usePaletteShortcut and useShortcutsKey live in components/command-palette.tsx.
Docs: these guides now say which key does what: workspaces, search, Ask, desktop, and Work's index.
Checks:
tscis clean.- 1,173 web tests pass, including the updated shortcut tests.
- Prettier is clean.