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:
@@ -206,7 +206,19 @@ class _Control extends StatelessWidget {
|
||||
case SettingsFieldKind.toggle:
|
||||
return _ToggleControl(checked: value == true, onChanged: _set);
|
||||
case SettingsFieldKind.select:
|
||||
return _SelectControl(field: field, value: value?.toString(), onPick: _set);
|
||||
return _SelectControl(
|
||||
field: field,
|
||||
value: value?.toString(),
|
||||
onPick: (v) {
|
||||
final prefix = field.applyCommandPrefix;
|
||||
if (prefix != null) {
|
||||
// Value selects a command (the subsystem applies + persists).
|
||||
ClideKernel.of(context).commands.execute('$prefix$v');
|
||||
} else {
|
||||
_set(v);
|
||||
}
|
||||
},
|
||||
);
|
||||
case SettingsFieldKind.text:
|
||||
return _EditControl(field: field, value: value?.toString() ?? '', numeric: false, onCommit: _set);
|
||||
case SettingsFieldKind.number:
|
||||
|
||||
Reference in New Issue
Block a user