From 50d4280dbdb2a8e5d9c89eb6c893d12c7a37f69f Mon Sep 17 00:00:00 2001 From: Aarav Sareen <96787824+arvsrn@users.noreply.github.com> Date: Fri, 16 Oct 2026 14:52:35 +0530 Subject: [PATCH] refactor(tui): build DialogSelect on DialogLayout (#55799) --- packages/tui/src/ui/dialog-select.tsx | 96 ++++++++++++++++----------- 1 file changed, 56 insertions(+), 40 deletions(-) diff --git a/packages/tui/src/ui/dialog-select.tsx b/packages/tui/src/ui/dialog-select.tsx index f6acd6189e1..f9eaf0cca6d 100644 --- a/packages/tui/src/ui/dialog-select.tsx +++ b/packages/tui/src/ui/dialog-select.tsx @@ -7,7 +7,17 @@ import { createStore } from "solid-js/store" import { useRenderer, useTerminalDimensions } from "@opentui/solid" import * as fuzzysort from "fuzzysort" import { isDeepEqual } from "remeda" -import { DIALOG_LIST_INSET, DialogFooter, DialogHeader, dialogWidth, useDialog, type DialogContext } from "./dialog" +import { + DIALOG_INSET, + DIALOG_LIST_INSET, + DialogBleed, + DialogFooter, + DialogHeader, + DialogLayout, + dialogWidth, + useDialog, + type DialogContext, +} from "./dialog" import { Locale } from "../util/locale" import { getScrollAcceleration } from "../util/scroll" import { useConfig } from "../config" @@ -579,39 +589,50 @@ export function DialogSelect(props: DialogSelectProps) { } return ( - - - - - - { - if (props.locked) return - batch(() => { - setStore("filter", e) - props.onFilter?.(e) - }) - }} - focusedBackgroundColor={theme.background.formfield.focused} - cursorColor={theme.text.formfield.focused} - cursorStyle={config.cursor} - focusedTextColor={theme.text.formfield.focused} - ref={(r) => { - input = r - input.traits = { status: "FILTER" } - setTimeout(() => { - if (!input) return - if (r.isDestroyed) return - r.focus() - }, 1) - }} - placeholder={props.placeholder ?? "Search"} - placeholderColor={theme.text.muted} - /> - + + + + + { + if (props.locked) return + batch(() => { + setStore("filter", e) + props.onFilter?.(e) + }) + }} + focusedBackgroundColor={theme.background.formfield.focused} + cursorColor={theme.text.formfield.focused} + cursorStyle={config.cursor} + focusedTextColor={theme.text.formfield.focused} + ref={(r) => { + input = r + input.traits = { status: "FILTER" } + setTimeout(() => { + if (!input) return + if (r.isDestroyed) return + r.focus() + }, 1) + }} + placeholder={props.placeholder ?? "Search"} + placeholderColor={theme.text.muted} + /> + + + + } + footer={ + }> + + {props.footer} + - - + } + > + 0} fallback={ @@ -701,13 +722,8 @@ export function DialogSelect(props: DialogSelectProps) { - - }> - - {props.footer} - - - + + ) }