Skip to content

Key declarations come from metaclass_registry - #314

Merged
trissim merged 1 commit into
mainfrom
claude-a/key-declarations-shared
Nov 16, 2026
Merged

trissim merged 1 commit into
mainfrom
claude-a/key-declarations-shared

Conversation

@trissim

@trissim trissim commented Nov 16, 2026

Copy link
Copy Markdown

Key declarations now come from metaclass_registry.key_declarations (OpenHCSDev/metaclass-registry#14), and Textual's copy is deleted. A client without Textual (the Qt client) can declare Toad's actions together with their keys.

  • textual/keys.py: KeyDeclarationType, KeyInvocation, KeyTitle and KeyDeclaration are gone (-120 lines). Their abstract bindings_for, Textual's projection of a declaration into bindings, stays here as BindingDeclaration. DOM key families and NavigationCommand use it.
  • EditingMode(InputMode) and VimMode(EditingMode, ModalInputMode): which mode a key belongs to now lives in the shared module, and the engine behaviour (bindings, cursor shape, document edits) stays in _editing.py. modal moved to the identity classes.
  • Every importer is repointed (binding.py, dom.py, navigation.py, two tests). There are no re-exports. Touched files also dropped four unused imports.

Checks: pytest over the binding, keymap, key, navigation and text_area tests gives 447 passed and 3 failed. The same 3 test_editor_state failures happen on unchanged main (/home/ts/wt/claude-a-textual-base).

🤖 Generated with Claude Code

https://claude.ai/code/session_016gZLdupVQyBzHTmHBC9Cyn

KeyDeclarationType, KeyInvocation, KeyTitle and KeyDeclaration live in
metaclass_registry.key_declarations (metaclass-registry #14), so a client without
Textual declares actions with their keys. EditingMode and VimMode subclass its
InputMode and ModalInputMode, which hold which mode a key belongs to; the engine
behaviour stays here. Every importer is repointed. bindings_for, Textual's projection
of a declaration into bindings, stays here as BindingDeclaration, which DOM key families
and NavigationCommand use.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016gZLdupVQyBzHTmHBC9Cyn
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.

1 participant