Files
clawdbot/src/tui/components/selectors.ts
Vignesh Natarajan de44e0ad33 feat(tui): add fuzzy search to model picker
- 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
2026-01-18 23:18:28 +00:00

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);
}