Files
stack/docs/scratchpads/BUG-CLI-scratchpad.md
Jason Woltje 3f8553ce07
Some checks failed
ci/woodpecker/push/ci Pipeline failed
fix(cli): TUI polish — Ctrl+T, React keys, clipboard, version (#205)
Co-authored-by: Jason Woltje <jason@diversecanvas.com>
Co-committed-by: Jason Woltje <jason@diversecanvas.com>
2026-03-17 02:40:18 +00:00

1.7 KiB

BUG-CLI Scratchpad

Objective

Fix 4 CLI/TUI polish bugs in a single PR (issues #192, #193, #194, #199).

Issues

  • #192: Ctrl+T leaks 't' into input
  • #193: Duplicate React keys in CommandAutocomplete
  • #194: /provider login false clipboard claim
  • #199: TUI shows hardcoded version "0.0.0"

Plan and Fixes

Bug #192 — Ctrl+T character leak

  • Location: packages/cli/src/tui/app.tsx
  • Fix: Added ctrlJustFired ref. Set synchronously in Ctrl+T/L/N/K handlers, cleared via microtask. In the onChange wrapper passed to InputBar, if ctrlJustFired.current is true, suppress the leaked character and return early.

Bug #193 — Duplicate React keys

  • Location: packages/cli/src/tui/components/command-autocomplete.tsx
  • Fix: Changed key={cmd.name} to key={${cmd.execution}-${cmd.name}} for uniqueness.
  • Also: packages/cli/src/tui/commands/registry.tsgetAll() now deduplicates gateway commands that share a name with local commands. Local commands take precedence.

Bug #194 — False clipboard claim

  • Location: apps/gateway/src/commands/command-executor.service.ts
  • Fix: Removed the \n\n(URL copied to clipboard) suffix from the provider login message.

Bug #199 — Hardcoded version "0.0.0"

  • Location: packages/cli/src/cli.ts + packages/cli/src/tui/app.tsx
  • Fix: cli.ts reads version from ../package.json via createRequire. Passes version: CLI_VERSION to TuiApp in both render calls. TuiApp has new optional version prop (defaults to '0.0.0'), passes it to TopBar instead of hardcoded "0.0.0".

Quality Gates

  • CLI typecheck: PASSED
  • CLI lint: PASSED
  • Prettier format:check: PASSED
  • Gateway lint: PASSED