fix: auto-save custom answer before switching question tabs - #12537
fix: auto-save custom answer before switching question tabs#12537maharshi365 wants to merge 7 commits into
Conversation
Fixes anomalyco#12536 Fixes anomalyco#8199 When a user types a custom answer in the Question tool and switches tabs without confirming (pressing Enter), the typed text appears in the next question's textarea. This auto-saves the custom answer to the current question's state before switching tabs.
|
The following comment was made by an LLM, it may be inaccurate: No duplicate PRs found |
…tion mode (multi vs single input)
Replaced saveCustomAnswer() with saveCustomAnswerMulti() helper and inlined single-select logic to clarify code paths and eliminate duplication.
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
|
@rekram1-node can you please check this issue? the bug is still present in latest TUI |
Fixes #12536
Fixes #8199
Problem
When using the Question tool with multiple questions and custom answer options, typed text from one question's custom answer field appears in the next question when switching tabs without confirming (pressing Enter).
Reproduction Steps
Solution
Auto-save any uncommitted custom answer text to the current question's state before switching tabs.
Changes in
selectTab():store.editingis true)store.custom[prevTab]store.answerswith the custom valueeditingstate before switching to new tabThis prevents text from "leaking" to the next question and ensures answers don't disappear on the Confirm screen.
Testing