Skip to content

Plugin-registered api.ui.Dialog windows are not centered (positioned in bottom-right corner) #37621

Closed as not planned

Description

@Qesire

Problem

Plugin-registered TUI dialogs via api.ui.Dialog() are positioned in the bottom-right corner of the terminal instead of being centered. Built-in dialogs (e.g. /models → DialogModel) are correctly centered.

Environment

  • opencode: 1.18.3
  • OS: Linux
  • Plugin: oh-my-opencode-slim 2.2.3

Reproduction

  1. Install a plugin that registers a TUI slash command with a dialog:
api.command.register(() => [{
  title: "Test",
  value: "test",
  slash: { name: "test" },
  onSelect: () => {
    api.ui.dialog.replace(() =>
      api.ui.Dialog({
        size: "large",
        onClose: () => api.ui.dialog.clear(),
        children: api.ui.DialogSelect({
          title: "Test dialog",
          options: [{ title: "A", value: "a" }],
          onSelect: () => {},
        }),
      }),
    );
  },
}]);
  1. Invoke the command from autocomplete
  2. Observe: the dialog appears in the bottom-right corner, not centered

Expected behavior

Plugin dialogs should be centered the same way built-in dialogs are.

Analysis

TuiDialogProps only exposes:

type TuiDialogProps = {
    size?: "medium" | "large" | "xlarge";
    onClose: () => void;
    children?: JSX.Element;
};

There is no position, align, or center field. The plugin cannot control dialog placement. Built-in dialogs like DialogModel (packages/tui/src/component/dialog-model.tsx) presumably handle their own positioning internally, but this logic is not available to plugins through the api.ui.Dialog wrapper.

Request

Either:

  1. Make api.ui.Dialog center by default (matching built-in dialog behavior), or
  2. Add a position / align field to TuiDialogProps so plugins can control placement.

Context

Discovered while developing the oh-my-opencode-slim /preset TUI command. The three-level preset manager works correctly functionally, but all dialogs appear in the bottom-right corner instead of centered. The built-in /models dialog opens correctly centered.

Activity

  1. github-actions commented on Jul 18, 2026

    @github-actions
    Contributor

    This issue might be related to existing issues. Please check:

  2. github-actions commented on Sep 18, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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

Metadata

Metadata

Assignees

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