Skip to content

FIX: keep command Escape bursts inside session detail - #95

Merged
merefield merged 1 commit into
mainfrom
fix/goal-escape-navigation
Nov 4, 2026
Merged

merefield merged 1 commit into
mainfrom
fix/goal-escape-navigation

Conversation

@merefield

Copy link
Copy Markdown
Owner

Why

While backing out of /goal in terminal session detail, a rapid/repeated Escape sequence could dismiss the command menu, blur the composer, then navigate back to the session list. During a working turn, the underlying composer could instead receive an unintended interrupt. A regression test reproduced leaving detail on the third unmarked Escape before the fix.

Changes

  • Keep command dismissal in its own input layer: all three terminal command-menu Escape paths arm the same session-scoped dismissal guard.
  • Absorb recognised held-key repeats and a rapid Escape burst after dismissal rather than forwarding it to the composer or session-detail navigation.
  • Use a 250 ms quiet-period fallback for terminals without key-release/repeat metadata, extending it for subsequent Escape events. This deliberately treats rapid unmarked Escapes as one dismissal; it does not permanently disable Escape.
  • An explicit Escape release, another key, paste, or mouse click immediately clears the guard; an ordinary later Escape retains existing composer/detail behaviour.
  • Preserve the selected session and composer draft, ignore late cancelled-menu results, and leave command confirmation and goal API behaviour unchanged.
  • Document the terminal behaviour. No browser, layout, dependency or maintained-version changes.

Validation

  • Regression coverage across goal overview, objective edit, budget input and confirmation; inline/modal menus; loaded/loading/error states; recognised repeats and legacy unmarked bursts.
  • Verify draft retention, no late menu reopening or goal submission, no accidental turn interrupt, normal later Escape navigation, and operation without an available composer.
  • Repeated targeted race-enabled Escape tests; native Windows execution of the new tests.
  • Full Go race regression suite excluding the unchanged separately run locale matrix; go vet ./... and git diff --check.
  • Local Linux and Windows binaries rebuilt for review.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The supplied review record indicates no active issues remain, with the Escape-handling changes and regression coverage addressing the reviewed behavior.

No open issues 🎉

What changed in this PR

This pull request hardens terminal command-menu Escape handling so rapid or repeated Escape input does not unintentionally interrupt the composer or navigate away from session detail.

Changes:

  • Adds a session-scoped, time-bounded Escape dismissal guard for modal and inline command menus.
  • Handles repeats, legacy unmarked bursts, releases, and other input while preserving normal later Escape behavior.
  • Adds regression coverage for goal states, loading/error paths, draft retention, working turns, cancelled requests, and composer-less sessions.
  • Documents the updated terminal behavior.
File Description Review comments
README.md Documents Escape burst handling and quiet-period behavior. —
internal/​ui/​monitor_goal_test.go Adds regression coverage for Escape dismissal, navigation restoration, draft retention, and interruption safety. —
internal/​ui/​monitor_commands.go Adds shared Escape guard state and routes command-menu dismissal through the guarded path. The guard should be checked before earlier input handlers, or cleared when those handlers consume input, so an intervening history key clears the guard as documented.
internal/​ui/​monitor_commands_inline.go Applies guarded Escape dismissal to inline command menus. —
internal/​ui/​monitor_commands_escape.go Implements repeat detection, release handling, quiet-period absorption, and guard clearing. An alt+left or alt+right event handled by history navigation can leave the guard armed; cover the history-key-then-Escape sequence and clear the guard before earlier handlers or centralize the pre-dispatch check.

Review effort: Lite

@merefield
merefield merged commit c7d7266 into main Nov 4, 2026
7 checks passed
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.

2 participants