fix(tui): handle ESC to return to provider list rather than closing modal#14947
Open
ANSHSINGH050404 wants to merge 2 commits intoanomalyco:devfrom
Open
fix(tui): handle ESC to return to provider list rather than closing modal#14947ANSHSINGH050404 wants to merge 2 commits intoanomalyco:devfrom
ANSHSINGH050404 wants to merge 2 commits intoanomalyco:devfrom
Conversation
Author
|
"Hi @palmamartin @vvarp @ndarilek — I've submitted this PR to fix the issue where the ESC key was closing the entire provider modal instead of navigating back. |
Contributor
|
I'm going to start adding people who randomly CC me on issues to a list I spam on every single comment I make on any repo's issues. Ready to start getting spam for Godot, jj, and a bunch of other repos you have no commit rights on? Buckle up! |
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.
Issue for this PR
Closes #14931
Type of change
What does this PR do?
When adding a provider, pressing
ESCinside the API key input or authorization code dialog previously closed the entire provider modal stack.This happened because the root
<Dialog />layout (dialog.tsx) was trapping theEscapekey globally and popping the stack by default.To fix this:
dialog.replace()to accept an optionalonEscapehandler. If the handler returnsfalse, the root dialog skips its default closing behavior.onBackhandler to the ApiMethod, CodeMethod, and AutoMethod views that pushes<DialogProvider />back onto the view stack and halts the default closing behavior.How did you verify your code works?
I ran the TUI (
bun dev), opened the "Connect a provider" menu, selected a provider, and hitESCwhile in the API key / Auth Code prompt. I verified that it successfully returned me to the provider list without closing the modal.Screenshots / recordings
Before
opencode-1.mp4
After
opencode-2.mp4
Checklist