fix(tui): clear question edit state on tab change#28655
Open
MingyooLee wants to merge 1 commit into
Open
Conversation
Clear stale custom-answer editing state when the TUI question prompt moves to another tab so the Confirm tab can register submit bindings. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Contributor
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
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
Fixes #27302
Related to #27875
This PR addresses the narrowed TUI interactive Q&A reproduction described in #27302 (comment), where stale custom-answer edit state can leave the final Confirm tab unable to submit.
This PR is separate from the Web/Desktop permission prompt PR #28651 and does not address TUI permission mouse interaction support such as #7966.
Type of change
What does this PR do?
In the TUI multi-step question prompt, opening the custom-answer editor can leave
store.editingset totrue. If the user then moves to another tab, especially the finalConfirmtab, the prompt can become stuck:confirm()is truestore.editingis still trueThis PR clears the custom-answer editing state whenever the question prompt moves to a different tab. Reselecting the same tab preserves the current editing state, so the fix only affects actual tab changes.
A small unit test covers both cases:
Relationship to related PRs
How did you verify your code works?
From
packages/opencode:bun test test/cli/cmd/tui/question-prompt.test.ts— 2 passbun typecheckbunx oxlint packages/opencode/src/cli/cmd/tui/routes/session/question.tsx packages/opencode/test/cli/cmd/tui/question-prompt.test.ts— 0 warnings, 0 errorsbun test test/cli/run/question.shared.test.ts— 5 passbun test test/question/question.test.ts— 14 passbun test test/tool/question.test.ts— 2 passbun turbo typecheckScreenshots / recordings
No visual change. This is a TUI keybinding-state fix for the existing question prompt.
Checklist