fix(tui): distinguish asynchronous UI states (#36759)

This commit is contained in:
Kit Langton 2026-07-14 10:56:12 -04:00 committed by GitHub
commit 26e27c7a7f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 219 additions and 116 deletions

View file

@ -26,6 +26,7 @@ export interface DialogSelectProps<T> {
placeholder?: string
footer?: JSX.Element
emptyView?: JSX.Element
noMatchView?: JSX.Element
options: DialogSelectOption<T>[]
flat?: boolean
ref?: (ref: DialogSelectRef<T>) => void
@ -615,11 +616,22 @@ export function DialogSelect<T>(props: DialogSelectProps<T>) {
<Show
when={grouped().length > 0}
fallback={
props.emptyView ?? (
<box paddingLeft={4} paddingRight={4} paddingTop={1}>
<text fg={theme.textMuted}>No results found</text>
</box>
)
<Show
when={props.renderFilter !== false && store.filter.length > 0}
fallback={
props.emptyView ?? (
<box paddingLeft={4} paddingRight={4} paddingTop={1}>
<text fg={theme.textMuted}>No items available</text>
</box>
)
}
>
{props.noMatchView ?? (
<box paddingLeft={4} paddingRight={4} paddingTop={1}>
<text fg={theme.textMuted}>No results found</text>
</box>
)}
</Show>
}
>
<scrollbox