- Add SearchableSelectList component with fuzzy filtering - Integrate with /models command for quick model search - Support up/down navigation while typing - Uses pi-tui's fuzzyFilter for intelligent matching
21 lines
812 B
TypeScript
21 lines
812 B
TypeScript
import { type SelectItem, SelectList, type SettingItem, SettingsList } from "@mariozechner/pi-tui";
|
|
import { searchableSelectListTheme, selectListTheme, settingsListTheme } from "../theme/theme.js";
|
|
import { SearchableSelectList } from "./searchable-select-list.js";
|
|
|
|
export function createSelectList(items: SelectItem[], maxVisible = 7) {
|
|
return new SelectList(items, maxVisible, selectListTheme);
|
|
}
|
|
|
|
export function createSearchableSelectList(items: SelectItem[], maxVisible = 7) {
|
|
return new SearchableSelectList(items, maxVisible, searchableSelectListTheme);
|
|
}
|
|
|
|
export function createSettingsList(
|
|
items: SettingItem[],
|
|
onChange: (id: string, value: string) => void,
|
|
onCancel: () => void,
|
|
maxVisible = 7,
|
|
) {
|
|
return new SettingsList(items, maxVisible, settingsListTheme, onChange, onCancel);
|
|
}
|