Repository navigation
Phase 0 (9/9): operator TUI — extract keymap (pure-data, 2932→2894) - #43
Closed
Pal Lakatos-Toth (pallakatos) wants to merge 2 commits into
Closed
Pal Lakatos-Toth (pallakatos) wants to merge 2 commits into
Pal Lakatos-Toth (pallakatos) wants to merge 2 commits into
Conversation
Per docs/implementation-plan.md §4.2 (monotonic-decrease LOC budget) and §6 item 12 (Phase 0 decomposition slice #2). Pure-data extraction, no runtime behaviour change. cli/src/commands/operator.ts: 2932 -> 2894 lines (Phase 0 cap 2900). cli/src/commands/operator/keymap.ts (new, 88 lines) - BINDINGS: canonical 17-row key-binding table with (key, action, scope) triples. Scope enum: global|agents|egress|cluster|topology| overlay. - statusBarForAgents({focusedPanel, viewMode}) — builds the agents status bar with exact blessed markup identical to the previous inline copy. - statusBarForTopology(), statusBarForCluster() — the two simpler view modes. - Zero runtime deps: no blessed, no commander, no I/O. Makes the module safe to unit-test without a TTY harness. cli/src/commands/operator/keymap.test.ts (new, 57 lines) - 6 tests: BINDINGS invariants (expected keys present, every binding has non-empty fields + valid scope) + exact blessed-markup substrings for all three view modes. operator.ts changes - 35-line layout+keyboard doc-comment trimmed (content relocated to keymap.ts jsdoc). - 3 inline status-bar 'setContent' blocks (~24 lines) replaced by calls into the new helpers. - One new import statement. Verification - wc -l operator.ts : 2894 (< 2900 cap) - npm run typecheck (cli) : clean - npm run build (cli) : clean - npx vitest operator/keymap : 6 passed - tests/compat npm test : 11 passed / 8 todo (UNCHANGED from pre-extraction baseline — operator TUI harness unaffected) - All 5 non-signoff CI gates : PASS Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Approved by repository maintainer for Phase 0 merge. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Collaborator
Author
|
Closing in favor of an integrated validation on the |
Pal Lakatos-Toth (pallakatos)
deleted the
phase0/operator-tui-keymap-extract
branch
April 27, 2026 12:58
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.
Phase 0 · operator TUI — extract keymap to a pure module
First decomposition slice on
cli/src/commands/operator.ts. Pure-data extraction, zero behavioural change.cli/src/commands/operator/keymap.ts(new, 88 lines)BINDINGS— 17-row pure-data table of key → label → action pairs.statusBarForAgents | statusBarForTopology | statusBarForCluster— byte-identical blessed-markup strings to what operator.ts produced inline.cli/src/commands/operator.tsstatusBar.setContentblocks.Tests
cli/src/commands/operator/keymap.test.ts— 6 unit tests (tables aren't empty, labels are stable, status-bar strings match fixtures).operator-tui.spec.ts: 11 passed / 8 todo (unchanged — zero regression).Security
docs/security-audits/2026-04-24-phase0-operator-keymap-extract.md— refactor-only audit; re-audit trigger: any binding whose label changes behaviour.Known tight-fit
6 lines of slack under the Phase 0 cap. Phase 1 target is 2000; decomposition must continue via TUI render / input / data / overlays splits.
Stack
PR 9/9 — final Phase 0 PR. Bases on
phase0/kubectl-convert-skeleton(PR 8).