You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TUI: dialog-prompt.tsx calls textarea.gotoLineEnd during render #56136
dialog-prompt.tsx calls textarea.gotoLineEnd() during the render body (onMount), which is a Solid anti-pattern — side effects during render can cause inconsistent layout or re-render loops.
Root cause
packages/tui/src/ui/dialog-prompt.tsx:94-101:
onMount(()=>{dialog.setSize(props.size??"medium")setTimeout(()=>{if(!textarea||textarea.isDestroyed)returnif(props.busy)returntextarea.focus()},1)textarea.gotoLineEnd()// <-- side effect during render})
Suggested fix
Move textarea.gotoLineEnd() and textarea.focus() into an effect or callback, not the render body. Prefer onMount for one-time setup (as used elsewhere, e.g. dialog-session-list.tsx:194).
In the current code, textarea.gotoLineEnd() is already called inside onMount in packages/tui/src/ui/dialog-prompt.tsx. In Solid, onMount runs after the component has rendered and its refs are set, so this isn't a side effect during render. It's also the pattern your suggested fix recommends.
If you've seen something actually go wrong in the TUI, could you describe it briefly in your own words?
Your OpenCode version (opencode --version), OS and terminal
Which dialog you opened and how (the steps)
What you expected and what happened instead, e.g. the cursor in the wrong place, the input not focused, or flickering or a hang. A screenshot or recording helps.
You can reply here with the details, or edit the issue. If you edit it, please also leave a comment saying you've updated it, so we know you're done.
Thank you for the correction. You're right - looking more carefully at , at line 101 is indeed inside , not directly in the render body. My initial source review was too quick on this one. This is not actually a rendering-during-render violation. I'd like to withdraw this issue (#56136) as it's based on an incorrect reading of the code. The remaining rendering-related issues (#56137-#56145) are separate concerns about / being called during render body rather than , which is a different pattern issue.
Thanks for checking again and following up, @Addin! Since the call is already inside onMount, there's nothing to fix here. You can close this issue yourself, or the bot will close it automatically on 2026-10-19.
For #56137–#56145: please check those calls the same way, and say whether each one is inside onMount, createEffect or an event handler. It also helps a lot to add any real problem you've seen in the TUI, such as wrong focus or cursor position, flicker, a hang or an error, plus your opencode --version, OS, terminal and the steps that trigger it. Without an observable symptom, a pattern-only report is hard to act on.
Closing this as not planned, as you asked, @Addin. Like you confirmed, textarea.gotoLineEnd() in dialog-prompt.tsx already runs inside onMount, so there's nothing to fix here. Thanks for following up! If you run into an actual problem in this dialog, such as wrong focus or cursor position, please open a new issue with your version, OS, terminal and steps.
Activity
opencode-agent commentedon Oct 16, 2026
Thanks for the report, @Addin!
In the current code,
textarea.gotoLineEnd()is already called insideonMountinpackages/tui/src/ui/dialog-prompt.tsx. In Solid,onMountruns after the component has rendered and its refs are set, so this isn't a side effect during render. It's also the pattern your suggested fix recommends.If you've seen something actually go wrong in the TUI, could you describe it briefly in your own words?
opencode --version), OS and terminalYou can reply here with the details, or edit the issue. If you edit it, please also leave a comment saying you've updated it, so we know you're done.
Addin commentedon Oct 16, 2026
Thank you for the correction. You're right - looking more carefully at , at line 101 is indeed inside , not directly in the render body. My initial source review was too quick on this one. This is not actually a rendering-during-render violation. I'd like to withdraw this issue (#56136) as it's based on an incorrect reading of the code. The remaining rendering-related issues (#56137-#56145) are separate concerns about / being called during render body rather than , which is a different pattern issue.
opencode-agent commentedon Oct 16, 2026
Thanks for checking again and following up, @Addin! Since the call is already inside
onMount, there's nothing to fix here. You can close this issue yourself, or the bot will close it automatically on 2026-10-19.For #56137–#56145: please check those calls the same way, and say whether each one is inside
onMount,createEffector an event handler. It also helps a lot to add any real problem you've seen in the TUI, such as wrong focus or cursor position, flicker, a hang or an error, plus youropencode --version, OS, terminal and the steps that trigger it. Without an observable symptom, a pattern-only report is hard to act on.opencode-agent commentedon Oct 19, 2026
Closing this as not planned, as you asked, @Addin. Like you confirmed,
textarea.gotoLineEnd()indialog-prompt.tsxalready runs insideonMount, so there's nothing to fix here. Thanks for following up! If you run into an actual problem in this dialog, such as wrong focus or cursor position, please open a new issue with your version, OS, terminal and steps.