From 6d570f1d9206646013ec8be2093445c481cf1c87 Mon Sep 17 00:00:00 2001 From: James Long Date: Thu, 15 Oct 2026 13:14:27 -0400 Subject: [PATCH] refactor(tui): replace dialog inset flag with a cell count (#55582) --- packages/tui/src/ui/dialog-select.tsx | 2 +- packages/tui/src/ui/dialog.tsx | 20 +++++--------------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/packages/tui/src/ui/dialog-select.tsx b/packages/tui/src/ui/dialog-select.tsx index ca742370664..f6acd6189e1 100644 --- a/packages/tui/src/ui/dialog-select.tsx +++ b/packages/tui/src/ui/dialog-select.tsx @@ -703,7 +703,7 @@ export function DialogSelect(props: DialogSelectProps) { }> - + {props.footer} diff --git a/packages/tui/src/ui/dialog.tsx b/packages/tui/src/ui/dialog.tsx index df0ba9037f8..960d49a0bee 100644 --- a/packages/tui/src/ui/dialog.tsx +++ b/packages/tui/src/ui/dialog.tsx @@ -21,8 +21,6 @@ import { copy, copyOnSelectRelease } from "../util/selection" export type DialogSize = "medium" | "large" | "xlarge" -export const DIALOG_PADDING_X = 4 - export const DIALOG_INSET = 3 // List rows reserve a 1-cell gutter for the ▌ bar / ● marker. export const DIALOG_LIST_INSET = DIALOG_INSET + 1 @@ -96,20 +94,12 @@ export function DialogHeader( closeLabel?: string onClose?: () => void gap?: number - inset?: boolean - newInset?: number }>, ) { const dialog = useDialog() const theme = useTheme().surface("dialog") return ( - + {props.titleView ?? ( {props.title} @@ -170,8 +160,8 @@ export type DialogFooterAction = { export function DialogFooter( props: ParentProps<{ actions?: DialogFooterAction[] - inset?: boolean - newInset?: number + /** Side padding in cells, e.g. DIALOG_INSET or DIALOG_LIST_INSET. Omit when the parent already pads. */ + inset?: number }>, ) { const dimensions = useTerminalDimensions() @@ -187,8 +177,8 @@ export function DialogFooter( const right = () => actions().filter((action) => action.side === "right") return (