Repository navigation
fix(mecatui): render live keymap affordances - #467
Merged
Merged
Conversation
Co-Authored-By: Juan Antonio Osorio <[email protected]>
There was a problem hiding this comment.
Pull request overview
This PR makes mecatui’s user-visible keybinding affordances “live” by deriving rendered chord strings from the active keymap (rather than hardcoded literals), so operator overrides are accurately reflected across the TUI and its documentation.
Changes:
- Routed footer, inline-card affordances, overlays, and permission/plan dialogs through shared “help key markings” derived from the active keymap.
- Updated multiple overlays (agents/team/MCP/models/sessions/worktrees/schedule/skills/soul/usermodel/effort) to render navigation and action hints from live bindings while preserving genuinely local literal controls.
- Expanded docs and tests to cover keymap-affordance liveness across the additional surfaces.
Reviewed changes
Copilot reviewed 35 out of 35 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| user-docs/what-you-get/mecatui.md | Documents which visible controls follow remapped key bindings vs. remain literal. |
| docs/tui.md | Updates the remapping and permission-modal sections to reflect live affordance rendering behavior. |
| cmd/mecatui/ui/worktrees.go | Makes worktrees overlay footer/navigation hints use live keymap markings. |
| cmd/mecatui/ui/welcome/welcome.go | Allows the welcome prompt hint to display the live submit chord. |
| cmd/mecatui/ui/view.go | Threads live keymarkings into overlay renderers and updates footer strings to be keymap-derived. |
| cmd/mecatui/ui/usermodel.go | Uses live Close marking in the user-model overlay footer hint. |
| cmd/mecatui/ui/update.go | Makes quit-armed hints and various “press enter” status strings use the live submit/quit bindings. |
| cmd/mecatui/ui/team.go | Updates team overlay roster/focus/tasks/findings hints to use live navigation/action markings. |
| cmd/mecatui/ui/soul.go | Uses live scroll/close markings in the soul overlay footer hint. |
| cmd/mecatui/ui/skills.go | Updates skills overlay hints to combine literal arrows with live keymap-backed scroll/close markings. |
| cmd/mecatui/ui/skills_test.go | Adjusts test helpers for the updated skills rendering signature (helpKeys). |
| cmd/mecatui/ui/sessions.go | Updates sessions overlay hints to use live Choose/Tab/Close markings. |
| cmd/mecatui/ui/schedule.go | Uses live Choose/Close markings where applicable; keeps schedule’s local single-letter controls literal. |
| cmd/mecatui/ui/render_wrap_test.go | Updates renderer construction to include default help key markings. |
| cmd/mecatui/ui/render_cache_test.go | Updates renderer construction to include default help key markings for cache vs. fresh comparisons. |
| cmd/mecatui/ui/quit_test.go | Updates quit-guard tests to validate the new binding-derived quit hint. |
| cmd/mecatui/ui/permission.go | Makes permission modal and plan-review affordances derive mnemonics/labels from live approval bindings. |
| cmd/mecatui/ui/models.go | Updates models picker hints to use live keymap markings (while keeping literal arrows for filtering safety). |
| cmd/mecatui/ui/models_test.go | Adjusts tests for updated models rendering signature (helpKeys). |
| cmd/mecatui/ui/model.go | Computes keymap markings early for placeholder text and renderer construction. |
| cmd/mecatui/ui/mcp.go | Threads live keymarkings through MCP overlay/panels and collapse markers. |
| cmd/mecatui/ui/mcp_test.go | Adds targeted test coverage for MCP resource preview collapse marker behavior. |
| cmd/mecatui/ui/help.go | Extends help-key markings to cover additional overlays and approval/navigation affordances. |
| cmd/mecatui/ui/footer.go | Updates team/subagent/parallel footer affordances to use the live Agents chord; adds shared approval-label helpers. |
| cmd/mecatui/ui/emptystate_test.go | Updates empty-state rendering calls for new overlay signatures (helpKeys). |
| cmd/mecatui/ui/effort.go | Updates effort picker footer hints to use live navigation/choose/close markings. |
| cmd/mecatui/ui/diff_test.go | Updates renderer construction to include default help key markings. |
| cmd/mecatui/ui/background_subagent_test.go | Updates agents overlay subagent roster/focus rendering calls for new signatures (helpKeys). |
| cmd/mecatui/ui/argsummary_test.go | Adjusts a test to use the renderer method for result body rendering. |
| cmd/mecatui/ui/agents_overlay.go | Updates agents overlay (subagents/parallel/teams) navigation hints to use live keymap markings. |
| cmd/mecatui/ui/agents_overlay_test.go | Updates footer-tier tests to pass the live Agents marking into the new footer helpers. |
| cmd/mecatui/ui/agents_inventory.go | Uses live scroll/close markings in agents inventory overlay footer hints. |
| cmd/mecatui/ui/agents_inventory_test.go | Adjusts tests for updated agents-inventory rendering signature (helpKeys). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-Authored-By: Juan Antonio Osorio <[email protected]>
The plan-review action bar glued the LIVE approval chord onto the word's
stem ("[" + approvalMnemonic(hk.allow) + "]pprove & run"). For a bare-rune
rebind that read as a typo ("[Y]pprove & run"), and for a MODIFIED chord
(e.g. Allow: ctrl+y — legal because the approval keys are not in the
validator's globalOpen bare-rune set) it rendered the outright broken
"[ctrl+y]pprove & run".
Route the three buttons through a new planApprovalButtonLabel helper that
mirrors the generic modal's approvalButtonLabel default-vs-override split:
the DEFAULT a/w/d chords keep the historical word-embedded form
("[A]pprove & run" / "[W] auto-accept edits" / "[D] iterate")
byte-for-byte, and any override degrades to an honest standalone form
("[Y] approve & run" / "[ctrl+y] approve & run"). A bare-rune rebind now
reads "[Y] approve & run" instead of the prior wordplay "[Y]pprove & run",
matching the generic modal and the PR's documented behaviour.
Tests: TestPlanReviewActionBarModifiedChordDegrades pins the modified-chord
regression (fails on the unfixed branch with "[ctrl+y]pprove & run");
TestPlanReviewActionBarDefaultBytesUnchanged is the golden-safety guard for
the default wordplay; TestPlanReviewActionBarReflectsKeyOverride now expects
the bare-rune standalone form and asserts the stem is never glued.
Co-Authored-By: Juan Antonio Osorio <[email protected]>
Co-Authored-By: mecatl <[email protected]>
Contributor
|
Looks good -- one thing missing and I had mecatl make a quick patch. |
jbeda
added a commit
that referenced
this pull request
Aug 12, 2026
…ttings.yaml (#481) Issue #459: mecatui and mecated shared one operator settings file (~/.config/mecatl/settings.yaml) whose schema is server-owned and parsed strictly, while mecatui read its single keymap: key out of the same file via a separate lenient decoder the server silently dropped — the early "git regret model" (one config namespace read by two binaries, scope invisible from the file). Give mecatui its own client-owned settings file at ~/.config/mecatui/settings.yaml (the XDG config tree, matching the existing mecatui/themes dir). v1 moves only keymap: — the one key with an existing decoder and users (#455/#460/#467); the strict top-level clientSettings schema is designed to grow additive fields (theme, UI behaviour) as small follow-ups without re-designing. - New file parses STRICTLY (yaml.NewDecoder + KnownFields(true), the daemonconfig idiom): an unknown top-level key or a multi-document file is a startup error naming the file; raw YAML syntax errors are not wrapped through (CWE-209 — they embed the offending source line). - The legacy server file stays LENIENT (plain Unmarshal tolerates the server's permissions:/guardrails:/models: siblings) for back-compat: an operator's existing keymap: keeps working. - Precedence, per action (a higher layer rebinds only the actions it names): CLI --keymap > client file > legacy server file. No env form for keymap exists, so the chain is three layers. - A legacy keymap: fires a one-line stderr deprecation WARN at startup (pre-alt-screen, direct write not slog) pointing at the new home. - The legacy parser now applies the same TypeError-vs-syntax split as the strict reader so a wrong-typed keymap: value no longer leaks a truncated slice of the offending value into the returned error (CWE-209; flagged by the panel's security axis and pinned by a regression test). Docs: docs/tui.md "Remapping keys" and user-docs/what-you-get/mecatui.md now name the client file as primary, document the three-layer precedence, and note the legacy deprecation. Server-scoped docs/configuration-reference.md and the configgen skeleton are untouched (the server schema is unchanged; configref regen is a no-op). llms.txt regen is a no-op (index only). Deferred (out of scope, per the issue): theme/UI-flag/env-knob settings layer, a client configgen reference generator (until a second key lands), a MECATUI_KEYMAP env form, the typed client->server spawn payload, and #456 live-reload. Verification: task lint (0 issues), task test (full suite, -race), go run ./cmd/mecademo (full offline session), task site:build, task docs:check (0 broken links). 14 new offline tests cover path resolution, strict/lenient decode, precedence, per-action merge, legacy-only back-compat (merged map equals the pre-split two-layer output), the deprecation WARN firing exactly once, and the CWE-209 no-leak regression. Closes #459 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.
Summary
Closes #457
Verification
task lintgo test ./cmd/mecatui/ui/ ./cmd/mecatui/ui/welcome/ -count=1task test:goldentask docstask site:buildgo run ./cmd/mecademoA later independent
task testrerun hit the host's/tmpdisk quota. Re-running with a repo-localTMPDIRmade the changed TUI packages pass but invalidated unrelated tests that intentionally require a temporary directory outside a Git repository. CI remains the authoritative full-suite run.