fix: favorites and recents stay visible when filtering models (#6053)

This commit is contained in:
Daniel Gray
2025-12-23 12:55:47 -06:00
committed by GitHub
parent 4e1a9b6216
commit 52048c327d
2 changed files with 139 additions and 130 deletions

View File

@@ -19,6 +19,7 @@ export interface DialogSelectProps<T> {
onMove?: (option: DialogSelectOption<T>) => void
onFilter?: (query: string) => void
onSelect?: (option: DialogSelectOption<T>) => void
skipFilter?: boolean
keybind?: {
keybind: Keybind.Info
title: string
@@ -74,7 +75,8 @@ export function DialogSelect<T>(props: DialogSelectProps<T>) {
const result = pipe(
props.options,
filter((x) => x.disabled !== true),
(x) => (!needle ? x : fuzzysort.go(needle, x, { keys: ["title", "category"] }).map((x) => x.obj)),
(x) =>
!needle || props.skipFilter ? x : fuzzysort.go(needle, x, { keys: ["title", "category"] }).map((x) => x.obj),
)
return result
})