Repository navigation
feat(tui): rebindable keys — CLI flag, validator, YAML settings, and runtime dispatch - #222
Merged
Merged
Conversation
…runtime dispatch Wire the full rebindable-keys pipeline for mecatui: - cmd/mecatui/config.go: --keymap CLI flag (repeatable, Action=chord[,chord2]) - cmd/mecatui/main.go: keyOverridesFromConfig() parses flag values into the map[string][]string the ui layer expects; applyKeyOverridesToDeps() plumbs them through Deps.KeyOverrides. - cmd/mecatui/ui/keys.go: keyMap struct with all ~30 named bindings, defaultKeys() establishing defaults, and applyKeyOverrides() returning a copy of the keyMap with overridden chords + rebuilt help short keys. - cmd/mecatui/ui/model.go: Deps.KeyOverrides field (nil = no overrides); New() calls applyKeyOverrides(defaultKeys(), deps.KeyOverrides) so the live keys reflect CLI overrides from turn zero. - cmd/mecatui/keymap/validator.go + _test.go: ValidateActions() rejects unknown action names at load time so a typo --keymap Foo=bar fails early rather than silently ignoring. - cmd/mecatui/keymap_wiring_yaml.go: operator-settings.yaml reader (future use; inert until wired into the flag-resolution chain — reads keymap: block from settings.yaml alongside the CLI). - .gitignore: fix bare 'mecatui' pattern to '/mecatui' so it doesn't shadow the cmd/mecatui/ directory tree. The welcome splash + help overlay still hardcode some keys; that follow-up landed as 666ec22. Co-Authored-By: mecatl <[email protected]> feat(tui): show live key bindings on welcome splash and help overlay The rebindable-keys system (--keymap) was wired through the CLI/config/keymap pipeline and applied to runtime dispatch, but the welcome screen (doggo mascot + wordmark + affordances) and the '?' help overlay still hardcoded 'ctrl+a' for the agents overlay key and 'home/end' for scroll-jump key markings. Changes: - zeroStateRows() now takes an agentsKey parameter so the welcome splash shows the live binding instead of the literal 'ctrl+a'. - renderHelpOverlay() and helpBody() accept agentsKey + jumpKey strings consumed from the model's keyMap via agentsKeyMarking() and the new jumpKeyMarking() methods. - Removed the dead currentJumpMarking() placeholder. - Both legacyZeroStateBody() and zeroStateAffordanceRows() call m.agentsKeyMarking(). - Test helper m_helpBody() updated to pass the default key values. With default key bindings the output is byte-identical (all golden tests pass). With --keymap Agents=ctrl+k the splash and overlay now show ctrl+k. Co-Authored-By: mecatl <[email protected]>
JAORMX
approved these changes
Jun 30, 2026
- gci import ordering in keys.go, model.go, validator.go, validator_test.go - gocyclo: refactor applyKeyOverrides from 30+ if-blocks into a data-driven setter map loop (complexity 35 → ~6) - revive: add package comment to keymap/validator.go; simplify if-return at the end of Validate() to a single return - staticcheck S1009: drop nil check on ov (len(nil map) is 0) - unused: remove dead approval var - Regenerate llms.txt via matlatl (stale from doc changes in this branch) Co-Authored-By: mecatl <[email protected]>
- gci import ordering in keys.go, model.go, validator.go, validator_test.go - gocyclo: refactor applyKeyOverrides from 30+ if-blocks into a data-driven setter map loop (complexity 35 → ~6) - revive: add package comment to keymap/validator.go; simplify if-return at the end of Validate() to a single return - staticcheck S1009: drop nil check on ov (len(nil map) is 0) - unused: remove dead approval var - Regenerate llms.txt via matlatl (previous commit had stale content from a failed go run — the CI's matlatl binary produced a clean file) Co-Authored-By: mecatl <[email protected]>
staticcheck SA5011 does not see t.Fatal/t.Fatalf as terminal and warns on subsequent nil dereference across the whole codebase. Adding 'return' after each nil-check guard resolves the CI Lint failure. Files fixed (11 files, 16 sites): - internal/adapter/anthropic/multimodal_test.go - internal/adapter/anthropic/stream_test.go - internal/adapter/mcpperf/mcpperf_test.go - internal/adapter/memory/loop_search_integration_test.go - internal/adapter/permconfig/claudeimport_test.go - internal/adapter/permconfig/guardrails_test.go - internal/adapter/permconfig/models_project_test.go - internal/adapter/permconfig/models_test.go - internal/adapter/permconfig/subagent_test.go - internal/adapter/providercatalog/catalog_test.go - internal/cliconfig/cliconfig_test.go Co-Authored-By: mecatl <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Wire the full rebindable-keys pipeline for mecatui:
The welcome splash + help overlay still hardcode some keys; that follow-up landed as 666ec22.
feat(tui): show live key bindings on welcome splash and help overlay
The rebindable-keys system (--keymap) was wired through the CLI/config/keymap pipeline and applied to runtime dispatch, but the welcome screen (doggo mascot + wordmark + affordances) and the '?' help overlay still hardcoded 'ctrl+a' for the agents overlay key and 'home/end' for scroll-jump key markings.
Changes:
With default key bindings the output is byte-identical (all golden tests pass). With --keymap Agents=ctrl+k the splash and overlay now show ctrl+k.