Skip to content

fix(panel): remove dead Input onEscape callbacks — Escape cancels (#63) - #74

Merged
rz1989s merged 1 commit into
mainfrom
fix/63-dead-onescape
Aug 29, 2026
Merged

rz1989s merged 1 commit into
mainfrom
fix/63-dead-onescape

Conversation

@rz1989s

@rz1989s rz1989s commented Aug 29, 2026

Copy link
Copy Markdown
Member

Problem

FleetPanel.handleInput intercepts Escape in every modal branch (wf/steer/tiers/resume/sched/lc/run) before forwarding to the active Input — so pi-tui's Input.onEscape never fires. All 13 onEscape assignments in fleet-panel.ts were dead code, and several (link-input, sched-name, lc-name, lc-cwd) promised "Escape accepts the default" semantics that never existed in practice.

Fix (option (a) per the issue)

  • Remove all 13 dead onEscape callbacks.
  • Document the Escape policy as an invariant comment at the top of handleInput: Escape always cancels the active flow; defaults are accepted via Enter-on-blank.
  • Fix the stale SPEC-6-5 comment on lcCwdInput (claimed "Escape accepts the default").
  • Align SPEC-6-5 spec §3.5 to the shipped behavior: Escape cancels; accept-default is Enter-on-blank.

No behavior change

Blank-Enter already covered every accept-default path:

  • lc name: name.trim() || "default" · lc cwd: cwd.trim() || parentCwd
  • run link / fork link: todoIdRaw.trim() || undefined · fork task: task.trim() || run.task

The rendered prompts already say esc cancel — now the code matches.

Gates

  • pnpm typecheck — pass (standalone)
  • pnpm test:run — 722/722

Closes #63

The panel's handleInput intercepts Escape in every modal branch BEFORE the
active pi-tui Input sees it, so pi-tui's Input.onEscape never fired — all 15
assignments (link/task/lc*/sched*/resume/steer/tiers/wfPrompt) were dead code,
and several promised 'Escape accepts the default' semantics that never existed.

- remove all 15 dead onEscape callbacks
- remove the unreachable escape check in the lcRevising branch (same dead-code
  class — the panel-level intercept resolves the checkpoint as abort first)
- document the Escape policy in handleInput: Escape cancels; defaults via
  Enter-on-blank. Caveat documented: ctrl+c also matches tui.select.cancel but
  is forwarded (Input ignores control chars) — a no-op since this PR; pre-PR it
  could fire the execute-type onEscape callbacks (accidental launches), so the
  removal is also a safety improvement, not a pure no-op.
- fix the stale SPEC-6-5 comment on lcCwdInput
- align SPEC-6-5 spec §3.5 to the actual behavior: Escape cancels the run

Default paths unchanged: blank-Enter already accepted defaults on every step
that had an accept-default onEscape (name→'default', cwd→parentCwd,
link→undefined, fork task→run.task).

Closes #63
@rz1989s
rz1989s force-pushed the fix/63-dead-onescape branch from a1ebee2 to bb26981 Compare August 29, 2026 13:30
@rz1989s
rz1989s merged commit 7858c68 into main Aug 29, 2026
1 check passed
@rz1989s
rz1989s deleted the fix/63-dead-onescape branch August 29, 2026 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

panel: Input onEscape callbacks are dead code — handleInput intercepts Escape before the Input fires

1 participant