Skip to content

TUI: dialog-update.tsx calls dialog.setCentered during render #56144

Closed as not planned

Description

@Addin

Summary

dialog-update.tsx calls dialog.setCentered(true) during the render body.

Root cause

packages/tui/src/component/dialog-update.tsx:23:

export function DialogUpdate(props: {...}) {
  const dialog = useDialog()
  ...
  dialog.setCentered(true)  // <-- side effect during render

Suggested fix

Move to onMount.

Activity

  1. opencode-agent commented on Oct 16, 2026

    @opencode-agent
    Contributor

    Thanks for the report! You're asking to move the dialog.setCentered(true) call in DialogUpdate into onMount instead of calling it directly in the component body.

    You're right that the call is in the component body. In Solid, that body runs only once when the dialog is created, not on every render, so this is a one-time setup call rather than a repeated side effect. I couldn't find a visible problem it causes. Several dialogs follow this pattern, while others already use onMount, so making them consistent is a reasonable cleanup. Maintainers will consider it.

    Related issues on the same pattern in other files, which would probably make sense to handle together:

    If you've seen a visible problem caused by this, such as flicker or the dialog not being centered, please reply with your opencode --version, your terminal and the steps to trigger it.

  2. neriousy commented on Oct 20, 2026

    @neriousy
    Member

    Thanks for reviewing the code. Moving the update dialog's centering setup doesn't address a demonstrated failure or user-facing impact, so we're closing this cleanup request. If you've observed a problem, please share the steps and impact.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions