feat(tui): add fuzzy search to session and agent pickers
Use SearchableSelectList for /sessions and /agents pickers,
matching the /models picker behavior.
- Session picker: search by session key, display name, or date
- Agent picker: search by agent ID or name
🤖 AI-assisted (Claude)
This commit is contained in:
committed by
Peter Steinberger
parent
3e06fe84dc
commit
dd18765b50
@@ -7,11 +7,7 @@ import {
|
||||
import { normalizeAgentId } from "../routing/session-key.js";
|
||||
import { helpText, parseCommand } from "./commands.js";
|
||||
import type { ChatLog } from "./components/chat-log.js";
|
||||
import {
|
||||
createSearchableSelectList,
|
||||
createSelectList,
|
||||
createSettingsList,
|
||||
} from "./components/selectors.js";
|
||||
import { createSearchableSelectList, createSettingsList } from "./components/selectors.js";
|
||||
import type { GatewayChatClient } from "./gateway-chat.js";
|
||||
import { formatStatusSummary } from "./tui-status-summary.js";
|
||||
import type {
|
||||
@@ -117,7 +113,7 @@ export function createCommandHandlers(context: CommandHandlerContext) {
|
||||
label: agent.name ? `${agent.id} (${agent.name})` : agent.id,
|
||||
description: agent.id === state.agentDefaultId ? "default" : "",
|
||||
}));
|
||||
const selector = createSelectList(items, 9);
|
||||
const selector = createSearchableSelectList(items, 9);
|
||||
selector.onSelect = (item) => {
|
||||
void (async () => {
|
||||
closeOverlay();
|
||||
@@ -147,7 +143,7 @@ export function createCommandHandlers(context: CommandHandlerContext) {
|
||||
: formatSessionKey(session.key),
|
||||
description: session.updatedAt ? new Date(session.updatedAt).toLocaleString() : "",
|
||||
}));
|
||||
const selector = createSelectList(items, 9);
|
||||
const selector = createSearchableSelectList(items, 9);
|
||||
selector.onSelect = (item) => {
|
||||
void (async () => {
|
||||
closeOverlay();
|
||||
|
||||
Reference in New Issue
Block a user