feat(settings): Keymap category — preset select (T-451)

The keybindings-ui extension contributes a Keymap SettingsCategory: a preset
select (Default / Vim / VS Code / JetBrains) reading the active preset from
kKeymapPresetSetting. Picking one routes through a new schema affordance —
SettingsField.applyCommandPrefix — running `keymap.preset.<value>`, which calls
KeymapService.setPreset to persist and reload the layered keymap live. The
prefix path keeps the engine generic: settings a subsystem applies via a
command (rather than a bare key write) declare the prefix; the scope tag and
current-value read still use the key.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-17 12:51:14 +02:00
co-authored by Claude Opus 4.8
parent 7aab93e776
commit 727fe8fdd4
8 changed files with 118 additions and 1 deletions
+8
View File
@@ -52,6 +52,7 @@ class SettingsField {
this.min,
this.max,
this.fileCommand,
this.applyCommandPrefix,
});
final String key;
@@ -73,6 +74,13 @@ class SettingsField {
/// For [SettingsFieldKind.file]: the command id the row's button invokes.
final String? fileCommand;
/// For [SettingsFieldKind.select]: when set, picking option `<value>` runs
/// the command `<applyCommandPrefix><value>` instead of writing [key]
/// directly — for settings a subsystem applies via a command (and only then
/// persists). The current value is still read from [key], so the scope tag
/// and selection still work. Example: `'keymap.preset.'` → `keymap.preset.vim`.
final String? applyCommandPrefix;
}
/// A carded group of fields (surface.md "sectioned cards"). [label] is the