Repository navigation
Conversation
|
The following comment was made by an LLM, it may be inaccurate: Potential Duplicate FoundPR #41079: This PR appears to address the same root issue: enabling typing into custom answer inputs in TUI question prompts. Your PR (#41517) is a fix that resolves the specific problem where the input wasn't receiving focus/keystrokes, while #41079 was a feature addition for the same functionality. They may have overlapping scope or one may have been superseded by the other. |
|
Regarding the duplicate flag: PR #41079 targets the form UI ( |
301a9a8 to
a39ba1f
Compare
|
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. |
Issue for this PR
Closes #30393
Closes #41514
Type of change
What does this PR do?
Selecting "Type your own answer" in a question prompt opens the custom text input, but the input can't be typed into / submitted. Per #30393, the focused
@opentui/core<textarea>swallows the Enter key, so thereturn -> submitbinding never fires and typing is unreliable. Root causes and fixes:packages/tui/src/routes/session/question.tsx): the editing-modeuseBindingshad notarget, so the keymap didn't route keys to the<textarea>and the focused textarea captured Enter. Addedtarget: textareaTargetandpriority: 1, matching theDialogPromptpattern which submits a focused textarea through the keymap.packages/opencode/src/cli/cmd/run/footer.question.tsx): acreateEffectre-ran on every keystroke (eachonContentChangeupdates state), re-setting the textarea text and callingarea.focus()on every character, fighting the user's input. Now it only syncs/focuses on the editing-mode transition.packages/app/src/pages/session/composer/session-question-dock.tsx): added the1–9digit shortcuts tonav()for parity with the TUI, and as a direct way to reach the custom option.How did you verify your code works?
bun typecheckpasses clean inpackages/tui,packages/opencode, andpackages/app.bun test test/cli/run/question.shared.test.ts test/tool/question.test.ts-> 7 pass, 0 fail).Checklist