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-image-preview.tsx calls dialog.setSize/setCentered during render #56143
exportfunctionDialogImagePreview(props: {images: readonlyImagePreviewItem[];initial: number}){constdialog=useDialog()...dialog.setSize("xlarge")dialog.setCentered(true)// <-- side effect during render
Thanks for the report! You're right that dialog-image-preview.tsx calls dialog.setSize("xlarge") and dialog.setCentered(true) directly in the component body. In Solid, though, a component function runs only once when it is created, not on every re-render. So these calls are one-time setup writes to the dialog store. The same pattern is used in several other dialogs too.
To help us decide whether this needs a change, could you tell us what visible problem it causes, if any? For example:
Your OpenCode version (opencode --version), OS and terminal
What you did to open the image preview
What you expected and what you saw instead (e.g. wrong dialog size or position, flicker, a warning or error in the logs), with a screenshot if you can
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 when you're done.
Related issues, all opened alongside this one about the same pattern in other files (none is a duplicate of this one):
Source code review finding. packages/tui/src/component/dialog-image-preview.tsx:21-22 calls dialog.setSize(xlarge) and dialog.setCentered(true) in the component body. Other dialogs use onMount (dialog-session-list.tsx:194, dialog-integration.tsx:518). No visible problem observed today, but it's a consistency issue worth addressing with the related rendering issues (#56136-#56139, #56140-#56142, #56144-#56145).
Thanks for clarifying! Since there's no visible problem, I'll treat this as a code-consistency improvement rather than a bug: set the dialog size and centering in onMount (as dialog-session-list.tsx and dialog-integration.tsx already do) instead of directly in the component body. In Solid the component body runs only once, so the current calls behave the same in practice, but making them consistent is a fair cleanup. Maintainers will consider it, most likely together with the sibling issues for the other dialogs that use the same pattern:
Thanks for reviewing the code. You confirmed that no visible problem occurs in image preview, so we're closing this consistency request. If you encounter an actual failure, please share the steps and impact.
Activity
opencode-agent commentedon Oct 16, 2026
Thanks for the report! You're right that
dialog-image-preview.tsxcallsdialog.setSize("xlarge")anddialog.setCentered(true)directly in the component body. In Solid, though, a component function runs only once when it is created, not on every re-render. So these calls are one-time setup writes to the dialog store. The same pattern is used in several other dialogs too.To help us decide whether this needs a change, could you tell us what visible problem it causes, if any? For example:
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 when you're done.
Related issues, all opened alongside this one about the same pattern in other files (none is a duplicate of this one):
dialog-shell-output.tsxcallssetSize/setCenteredduring renderdialog-execute.tsxmutates dialog state during renderdialog-pair.tsxcallssetSize/setCenteredduring renderplugin/api.tsxcallssetSize/setCenteredduring renderdialog-highlights,dialog-update,dialog-skill,dialog-debuganddialog-promptAddin commentedon Oct 16, 2026
Source code review finding. packages/tui/src/component/dialog-image-preview.tsx:21-22 calls dialog.setSize(xlarge) and dialog.setCentered(true) in the component body. Other dialogs use onMount (dialog-session-list.tsx:194, dialog-integration.tsx:518). No visible problem observed today, but it's a consistency issue worth addressing with the related rendering issues (#56136-#56139, #56140-#56142, #56144-#56145).
opencode-agent commentedon Oct 16, 2026
Thanks for clarifying! Since there's no visible problem, I'll treat this as a code-consistency improvement rather than a bug: set the dialog size and centering in
onMount(asdialog-session-list.tsxanddialog-integration.tsxalready do) instead of directly in the component body. In Solid the component body runs only once, so the current calls behave the same in practice, but making them consistent is a fair cleanup. Maintainers will consider it, most likely together with the sibling issues for the other dialogs that use the same pattern:dialog-shell-output.tsx), TUI: dialog-execute.tsx mutates dialog state during render #56137 (dialog-execute.tsx), TUI: dialog-pair.tsx calls dialog.setSize/setCentered during render #56140 (dialog-pair.tsx), TUI: plugin/api.tsx calls dialog.setSize/setCentered during render #56145 (plugin/api.tsx)dialog-highlights.tsx), TUI: dialog-update.tsx calls dialog.setCentered during render #56144 (dialog-update.tsx), TUI: dialog-skill.tsx calls dialog.setSize during render #56138 (dialog-skill.tsx), TUI: dialog-debug.tsx calls dialog.setSize during render #56139 (dialog-debug.tsx), TUI: dialog-prompt.tsx calls textarea.gotoLineEnd during render #56136 (dialog-prompt.tsx)neriousy commentedon Oct 20, 2026
Thanks for reviewing the code. You confirmed that no visible problem occurs in image preview, so we're closing this consistency request. If you encounter an actual failure, please share the steps and impact.