stacklok / stacklok/mecatl

mecatui: live-reload operator settings (keymap) without restart

Open
#456 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

tui
Dominant language
Go
Stars
152
Forks
16
Avg merge
14h 48m
Merged PRs (30d)
536

Description

Problem

mecatui reads the operator-tier keymap: overrides from ~/.config/mecatl/settings.yaml exactly once at startup — applyKeyOverridesToDeps in cmd/mecatui/main.go runs before tea.NewProgram, bakes the result into ui.Deps.KeyOverrides, and ui.New applies it at construction (model.go). There is no re-read path: no fsnotify watch, no /reload palette command, no signal handler. An operator who edits settings.yaml must quit and relaunch mecatui to pick up a keybinding change.

Why it's worth fixing

Keybinding remapping is an iterative, taste-driven activity — an operator trying to find a comfortable home for Agents/Effort (e.g. to free ctrl+a/ctrl+e for line editing, see #455) will want to try a chord, feel it, and adjust. A full restart per iteration is friction that discourages the very configurability the feature offers.

Possible shapes (design TBD)

  • A /reload palette command that re-reads settings.yaml, re-validates the keymap, and swaps m.keys in place (rebuilding help markings).
  • An fsnotify watch on the settings file that does the same automatically on save.
  • Either must handle: an invalid edited file (keep the last-good keymap + surface a loud warning, don't crash or drop bindings), and chords whose action is mid-overlay (e.g. remapping CancelChild while the agents overlay is open).

Scope note

The validator (keymap.Parse/keymap.Validate) and the override application (applyKeyOverrides) already exist and are pure — the work is the reload trigger + safe in-place swap + a warning surface, not new keymap machinery. See #455 for the documentation side of the keymap feature.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read cmd/mecatui/main.go and model.go, starting at applyKeyOverridesToDeps and ui.New to trace how key overrides are loaded and applied. Define a reload trigger and safe in-place swap using the existing validator, preserving the last-good keymap and surfacing invalid-file warnings, including when an overlay is active.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.