Fix: esc in the custom-prompt editor cancelled the whole jump - #5
Merged
Conversation
… of returning to Pi's choices The host's dialog stack runs its own post-esc dismissal right after our onCancel handler returns, targeting whatever was on top when esc fired. Replacing the dialog synchronously inside that handler meant the host's cleanup wiped the freshly-opened choices dialog straight back off, silently stranding the askJump promise. Deferring the reopen by one tick lets the host finish first.
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.
Summary
⏎on an earlier tree row opens Pi's 3-choice picker (from Port Pi's fork-from-an-earlier-message flow whole #2); picking "Summarize with a custom prompt" opens a text-entry dialog, andescthere is documented to loop back to the 3 choices, not cancel the whole jump.onCancelhandler returns, targeting whatever was on top whenescfired. Our handler was replacing the dialog synchronously inside that same handler, so the host's cleanup wiped the freshly-opened choices dialog straight back off, silently stranding theaskJumppromise (looks identical to a full cancel — nothing renders).Test plan
bun run typecheckcleanbun test— 252 pass, 0 failtest/e2e/tui.test.ts): drives esc-in-custom-prompt via pty and asserts it lands back on the picker, not a dangling/cancelled state — confirmed to fail against the old code and pass against the fixbun run buildclean