Skip to content

Commit 5b40f27

Browse files
zerone0xclaude
andcommitted
fix(tui): center dialog properly and prevent overflow
Use justifyContent="center" instead of fixed paddingTop for true vertical centering. Add maxHeight to prevent dialog from overflowing when terminal is small. Fixes anomalyco#7902 Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent 087473b commit 5b40f27

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/opencode/src/cli/cmd/tui/ui/dialog.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ export function Dialog(
2525
width={dimensions().width}
2626
height={dimensions().height}
2727
alignItems="center"
28+
justifyContent="center"
2829
position="absolute"
29-
paddingTop={dimensions().height / 4}
3030
left={0}
3131
top={0}
3232
backgroundColor={RGBA.fromInts(0, 0, 0, 150)}
@@ -38,6 +38,7 @@ export function Dialog(
3838
}}
3939
width={props.size === "large" ? 80 : 60}
4040
maxWidth={dimensions().width - 2}
41+
maxHeight={dimensions().height - 4}
4142
backgroundColor={theme.backgroundPanel}
4243
paddingTop={1}
4344
>

0 commit comments

Comments
 (0)