Extract fzt-core library and rebuild picker as a frontend #1
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
queue
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
romaine-life/fzt-picker#1
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Picker currently spawns fzt with a pre-generated YAML tree of the entire filesystem (via Everything). This doesn't scale —
.git/objects,node_modules, and$Recycle.Bindirectories consume the result limit (even at 50,000), and folder-only mode was generating empty YAML (fixed ininsert_dir→insert_fileon walker.rs:214).The fundamental problem: fzt loads everything upfront, but file systems are too large for that. Picker needs lazy loading, which is architecturally different from fzt's current model.
Design Decision
fzt is actually two things: an engine (fuzzy scoring, tree navigation, ANSI rendering, scope management, keyboard handling) and a frontend (CLI tool that loads YAML/stdin upfront). Picker is a second frontend that shares the engine but has a fundamentally different data lifecycle.
fzt-core library extraction
Extract the engine into a reusable Go package (
fzt-core) with a provider interface:The rendering, ANSI output, keyboard handling, scope navigation, cursor management — all shared. Only the data source differs.
Picker frontend behavior
C:\Users\upstairspc→ walk and expand C: → Users → upstairspc → show immediate children).git,node_modules,$Recycle.BindirectoriesNew fzt parameter:
--search-depth=N--search-depth=1: search only matches within the current scope level (picker use case)Motivation
fzt is already used in three contexts — CLI (
at/automate), WASM (homepage bookmarks), and picker (file dialog replacement). The library split makes it easy to build new frontends without fighting a monolith. Each new frontend reuses the visual layer and engine, only defining how data enters the system.Bugs fixed in this session (already in working tree, not yet committed)
walker.rs:214:insert_dir→insert_fileforfolders_onlymode (tree was empty because leaf directories had no files, sohas_content()returned false)walker.rs: added.git,$Recycle.Bin,node_modulesexclusions to Everything querywalker.rs: bumped result limit from 10,000 to 50,000 (insufficient fix, superseded by this redesign)