Keybinding presets, first-run picker and import/export on the current keymap system

#319 · closed · 1 comments

View on GitHub ↗

uzayer

## Goal Finish the parts of #79 that the current keybinding system does not have yet, porting from #227 where it already solved them. ## Context The action registry (`src/features/keybindings/lib/actions.ts`), profiles in `~/.config/atlas/keybindings.json` and the Settings → Keybindings editor already shipped in `edb7600a` (0.3.1+). #227 built a parallel system on `config.toml` `[keymap]`; it is closed, but these pieces of it are still missing and should be ported onto the existing system rather than rewritten. Keep `keybindings.json` as the file format. ## Scope - **IDE presets**: VS Code/Cursor and Zed at minimum (JetBrains to be decided), as sparse overlays on the defaults. They should fit the existing profile model, e.g. "new profile from preset" (#227: `lib/presets.ts`). - **First-run picker**: ask which editor the user is coming from (Atlas default / VS Code/Cursor / Zed / Decide later), ask only once, and make the choice reversible in Settings (#227: `keymap-onboarding.tsx`, marker in `state.json`). - **`mod` token**: ⌘ on macOS and Ctrl elsewhere, so one preset entry is right on both. Today `cmd` also matches Ctrl, which is looser than it should be. - **Reserved-key warnings** in the recorder for keys macOS reserves (⌘H, ⌘M, ⌘Q, ⌘Space, ⌘Tab, ⌘\`) (#227: `lib/reserved.ts`). - **Import/export** of a profile via the clipboard, in a documented, versioned format (#227: `lib/keymap-file.ts`). - **Scope from the focused pane's tab**, not `document.activeElement`: clicking a non-focusable element moves pane focus without moving DOM focus (#227: `use-keybinding-dispatcher.ts`, `use-action-handlers.ts`). - **Native Window ▸ Close Tab accelerator follows a rebind** (#227: `use-native-close-tab-accelerator.ts`). ## Out of scope - Multi-key sequences (`cmd+k cmd+s`, Linear-style `g c`): separate issue. - Moving the remaining hand-written `keydown` handlers onto the registry: separate issue. ## Acceptance - Every preset resolves with no hard conflicts on macOS and on non-macOS. - The first-run choice is persisted and visible and changeable in Settings. - An exported profile imports back unchanged; action ids from a newer build are kept, not dropped. - `docs/reference/keybindings.md` documents presets, `mod` and the import/export format. Follow-up to #79; ports from #227 (credit @Albab-Hasan).

Comments

uzayer

shipped in 0.3.4