From 799f81391c92be2f95da53d0b45d22d847a6f13a Mon Sep 17 00:00:00 2001 From: 844196 <844196@users.noreply.github.com> Date: Thu, 3 Sep 2026 22:58:54 +0900 Subject: [PATCH] fix: Match the built-in F1-F12 key symbols to @cliffy/keycode's lower-case names @cliffy/keycode reports function keys as "f1"-"f12", but DEFAULT_KEY_SYMBOLS spelled them "F1"-"F12", so the lookup in getKeySymbol always missed and fell back to the raw key name. Renamed the twelve entries to lower case to match, and added an e2e regression test asserting a lowercase-keyed binding (e.g. `key: f1`) renders its built-in glyph, so a reintroduced casing mismatch fails the suite instead of only being caught by eye. Closes #65 Co-Authored-By: Claude Sonnet 5 --- e2e/tests/07_render.bats | 14 ++++++++++++++ src/schema.ts | 24 ++++++++++++------------ 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/e2e/tests/07_render.bats b/e2e/tests/07_render.bats index daaeb3f..389fe93 100644 --- a/e2e/tests/07_render.bats +++ b/e2e/tests/07_render.bats @@ -77,6 +77,20 @@ YAML assert_line --index 1 ' ⏎ ➜ Enter' } +@test "a built-in function key symbol resolves for a lowercase key" { + write_bindings <<'YAML' +- key: f1 + type: command + desc: Help + buffer: man wk +YAML + start_wk_session + wait_for_screen 'Help' + + run capture_screen + assert_line --index 1 ' 󱊫 ➜ Help' +} + @test "symbols.keys can be overridden from config" { write_config <<'YAML' symbols: diff --git a/src/schema.ts b/src/schema.ts index fa8a356..2f9f660 100644 --- a/src/schema.ts +++ b/src/schema.ts @@ -146,18 +146,18 @@ const DEFAULT_KEY_SYMBOLS: Record = { pagedown: '⇟', insert: '⎀', delete: '⌦', - F1: '󱊫', - F2: '󱊬', - F3: '󱊭', - F4: '󱊮', - F5: '󱊯', - F6: '󱊰', - F7: '󱊱', - F8: '󱊲', - F9: '󱊳', - F10: '󱊴', - F11: '󱊵', - F12: '󱊶', + f1: '󱊫', + f2: '󱊬', + f3: '󱊭', + f4: '󱊮', + f5: '󱊯', + f6: '󱊰', + f7: '󱊱', + f8: '󱊲', + f9: '󱊳', + f10: '󱊴', + f11: '󱊵', + f12: '󱊶', } export const ContextSchema = z.looseObject({