Repository navigation
FIX: keep command Escape bursts inside session detail - #95
Merged
Merged
Conversation
There was a problem hiding this comment.
🟢 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
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.
Why
While backing out of
/goalin 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
Validation
go vet ./...andgit diff --check.