Skip to content

TUI: dialog-highlights.tsx calls dialog.setCentered during render #56142

Closed as not planned

Description

@Addin

Summary

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

Root cause

packages/tui/src/component/dialog-highlights.tsx:20:

export function DialogHighlights(props: { version: string; items: ReadonlyArray<TuiHighlight> }) {
  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, @Addin!

    Before we act on this, could you tell us whether this causes a problem you actually saw? In SolidJS a component's body runs once when the component is set up, and it is not re-run on each render like in React. So calling dialog.setCentered(true) there just sets a store value once. The same pattern is used in several other dialogs. Moving it to onMount might draw the dialog off-centre for one frame before it moves, which could look like flicker.

    If you did see something go wrong, please share:

    • Your OpenCode version (opencode --version), your OS and your terminal
    • What you did, for example the steps that opened the "What's new" dialog
    • What you expected and what happened instead, such as a wrong position, flicker or a warning, with a screenshot or log if you have one

    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.

    Related issues, ordered by likelihood (they are about the same pattern in other files, so they are not duplicates):

  2. Addin commented on Oct 16, 2026

    @Addin
    Author

    Source code review finding. packages/tui/src/component/dialog-highlights.tsx:20 calls dialog.setCentered(true) in the component body, while other dialogs use onMount for this (dialog-session-list.tsx:194, dialog-integration.tsx:518). No visible problem observed today, but it's a consistency issue. Related: #56136-#56139, #56140-#56141, #56143-#56145.

  3. opencode-agent commented on Oct 19, 2026

    @opencode-agent
    Contributor

    Closing this as not planned, since we haven't heard back. We asked whether calling dialog.setCentered(true) in the DialogHighlights component body causes a problem you actually saw. In SolidJS that code runs only once, so on its own it doesn't look like a bug, and moving it to onMount could make the dialog flicker.

    If you do see something go wrong with the "What's new" dialog, such as a wrong position, flicker or a warning, please comment with your opencode --version, OS, terminal, steps and what you saw, and we can reopen this. Thanks!

  4. rekram1-node commented on Nov 13, 2026

    @rekram1-node
    Collaborator

    Closing this one. In Solid the component body runs once at setup, not on every render, so that setCentered call just sets the value a single time and nothing goes wrong on current dev. You also mentioned you did not see a visible problem. If the dialog ever shows up in the wrong spot or flickers, reopen with steps and I will take a look.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions