Skip to content

Conversation

Copy link

Copilot AI commented Dec 8, 2025

The codebase lacked documentation on keybind implementation locations and architecture. This adds comprehensive technical documentation.

Changes

  • KEYBINDS.md: Documents the three-layer keybind architecture

    • Utility layer (src/util/keybind.ts): Parsing/matching logic for keybind strings
    • Context layer (src/cli/cmd/tui/context/keybind.tsx): Solid.js provider with leader key state management
    • Configuration layer (src/config/config.ts): Zod schema defining 40+ configurable keybinds
  • Includes architecture diagram, usage patterns, all available keybinds with defaults, and guide for adding new keybinds

  • README.md: Added reference link to documentation

Example usage pattern documented:

import { useKeybind } from "@tui/context/keybind"

const keybind = useKeybind()

// Match keyboard events
if (keybind.match("app_exit", event)) {
  // handle exit
}

// Display to user
const exitKey = keybind.print("app_exit") // "ctrl+c"
Original prompt

where are keybinds implemented?


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Implement keybinds functionality Document keybind implementation architecture Dec 8, 2025
Copilot AI requested a review from thdxr December 8, 2025 01:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants