Skip to content

Multi-chord phrases (e.g. "Ctrl+K, Ctrl+C") can be parsed but never bound, looked up or executed #135

Description

@matt-edmondson

What's missing

Phrase is a public type with parsing support: Phrase.Parse, Phrase.FromStrings and IKeybindingService.ParsePhrase. The binding model, though, only holds single chords:

  • Profile.Chords is a Dictionary<string, Chord> (Keybinding/Models/Profile.cs:73).
  • Every KeybindingService bind, find and execute API takes a Chord.
  • The JSON repository stores one chord per command.

Nothing can bind a phrase to a command or match input against one. There is also no way to track a partially typed sequence, where a prefix chord is pressed and the next chord is awaited.

The documentation says otherwise:

  • CLAUDE.md says profiles "Store mappings from CommandId to Phrase".
  • README.md:239 says the demo shows "Phrase binding and lookup".
  • Keybinding.Demo/MusicalDemo.cs:37-39 builds Ctrl+R, R and Ctrl+K, Ctrl+C phrases, but it only prints them.

Why it matters

Chord sequences such as VS/VS Code-style Ctrl+K, Ctrl+C are the headline example for the Phrase type. A consumer who follows the docs will find they can't be used. #134 (a phrase string silently parsed as a single chord) makes this worse, because the attempt fails without any error.

Suggested scope / acceptance criteria

  • Store a Phrase per command. A single chord is a one-chord phrase, so existing chord APIs keep working as thin wrappers.
  • Add BindPhrase(commandId, phrase), FindCommandByPhrase(phrase), and a way to execute a phrase.
  • Optionally, add prefix matching so a host can tell "sequence in progress" from "no match".
  • Serialise bindings as a list of chords, and keep reading the existing single-chord {"notes":[...]} format.
  • If this isn't planned, correct the CLAUDE.md, README and demo claims instead.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions