feat(coding-agent): added fuzzy token matching in coding-agent components
- Added fuzzy token matching in agent-dashboard, state-manager, and tree-selector, replacing lowercased checks. - Added search-query state and fuzzy-filter helpers to hook, oauth, and user-message selectors for query filtering. - Updated filtered selectors to render match results, status lines, no-match text, and move selection within results. - Added `overflowSearch` and filter state to `SelectList`, switching overflowing list matching to fuzzy checks. - Configured `SelectList` input flow and fixed cancel so Escape/Ctrl+C closes lists when no matches exist. - Updated changelogs and added tests for fuzzy-filter behavior in hook, oauth, user-message, and list selectors.
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
* Handles data loading, tree building, filtering, and toggle persistence.
|
||||
*/
|
||||
import * as path from "node:path";
|
||||
import { fuzzyMatch } from "@oh-my-pi/pi-tui";
|
||||
import { logger } from "@oh-my-pi/pi-utils";
|
||||
import type { ContextFile } from "../../../capability/context-file";
|
||||
import type { ExtensionModule } from "../../../capability/extension-module";
|
||||
@@ -404,11 +405,9 @@ export function applyFilter(extensions: Extension[], query: string): Extension[]
|
||||
ext.trigger || "",
|
||||
ext.source.providerName,
|
||||
ext.kind,
|
||||
]
|
||||
.join(" ")
|
||||
.toLowerCase();
|
||||
].join(" ");
|
||||
|
||||
return tokens.every(token => searchable.includes(token));
|
||||
return tokens.every(token => fuzzyMatch(token, searchable).matches);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user