Skip to content

fix(tui): align informational dialogs - #43728

Open
Rexarrior wants to merge 1 commit into
anomalyco:devfrom
Rexarrior:modal-alignment
Open

fix(tui): align informational dialogs#43728
Rexarrior wants to merge 1 commit into
anomalyco:devfrom
Rexarrior:modal-alignment

Conversation

@Rexarrior

@Rexarrior Rexarrior commented Aug 20, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #42180
Closes #42181

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

The Debug dialog explicitly used the large modal size, while both Debug and Status used different horizontal padding from the standard modal layout.

This removes the Debug size override and aligns both dialogs with the standard modal content padding.

A renderer regression test opens Themes, Debug, and Status in the same viewport and verifies that their titles use the same column.

How did you verify your code works?

  • Ran the full TUI test suite: 194 passed, 1 skipped
  • Ran the TUI typecheck
  • Ran Prettier and git diff --check

Screenshots / recordings

The recording shows the Themes, Debug, and Status dialogs at the same terminal size:

opencode-modal-alignment.mp4

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@Enough1122

Copy link
Copy Markdown

AI code review — automated review for reference; please use your judgment.

  • packages/tui/src/component/dialog-debug.tsx:22 — Removing setSize("large") makes the debug dialog adopt the default size, but its entries render raw model IDs, paths, and version strings that were sized for the large surface — verify the longest realistic rows still fit without wrapping/clipping, or add truncation so alignment doesn't come at the cost of unreadable debug output.
  • packages/tui/src/component/dialog-debug.tsx:52 / dialog-status.tsx:44 — The content padding value 4 is now duplicated as a magic number in each informational dialog; this exact drift is what caused the misalignment being fixed, so extract a shared constant (or a DialogBody wrapper) that all such dialogs consume and future ones inherit by default.
  • packages/tui/test/component/dialog-layout.test.tsx:47 — titleColumn finds the first frame line containing the title substring, so any body text that happens to contain "Debug"/"Status" (e.g., an entry name) silently re-points the measurement; anchor to the title row explicitly (first row inside the dialog border, or compare node geometry from the renderer) instead of substring search.
  • packages/tui/test/component/dialog-layout.test.tsx:55 — Only Themes/Debug/Status are compared; if other informational dialogs share this chrome (help, plugins, etc.), loop over them in the same test so a future dialog can't reintroduce horizontal misalignment unnoticed.

— AI code review (automated)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Catalog feedback] Status [Catalog feedback] Debug

2 participants