fix dead default keymap from undefined focus intents

default.yaml bound tab/shift+tab to focus.next/focus.previous, intent
ids absent from builtinIntents. parseIntentId returns null, so
KeymapLayer.fromYaml throws — and KeymapService.load catches that and
sets _preset = null. The whole default preset was silently dropped at
boot: palette, quick-open, find-in-files, and zoom bindings never fired.

It went unnoticed because every keymap_service_test injects a synthetic
bundle; the shipped asset was never parsed in a test. Add focus.next ->
NextFocusIntent and focus.previous -> PreviousFocusIntent (Flutter-
provided, for correct Tab widget traversal), and a test that reads every
real assets/keymaps/*.yaml through the loader so a future typo fails CI
instead of disabling the keymap.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-01 20:50:49 +02:00
co-authored by Claude Opus 4.8
parent 2e323990df
commit 4aa24a9898
6 changed files with 112 additions and 0 deletions
+6
View File
@@ -119,6 +119,12 @@ class InvokeCommandIntent extends Intent {
final Map<String, Intent Function()> builtinIntents = {
'activate': () => const ActivateIntent(),
'dismiss': () => const DismissIntent(),
// Widget-level focus traversal (Tab / Shift+Tab). These are
// Flutter-provided, like activate/dismiss — bound by id so the
// default preset integrates with the framework's focus system. They
// are distinct from the panel-to-panel cycling below (F6).
'focus.next': () => const NextFocusIntent(),
'focus.previous': () => const PreviousFocusIntent(),
'focus.nextPanel': () => const FocusNextPanelIntent(),
'focus.previousPanel': () => const FocusPreviousPanelIntent(),
'palette.open': () => const PaletteOpenIntent(),