Expand description
Command Palette widget for instant action search.
This module provides a fuzzy-search command palette with:
- Bayesian match scoring with evidence ledger
- Incremental scoring with query-prefix pruning
- Word-start, prefix, substring, and fuzzy matching
- Conformal rank confidence for tie-break stability
- Match position tracking for highlighting
§Usage
ⓘ
let mut palette = CommandPalette::new();
palette.register("Open File", Some("Open a file from disk"), &["file", "open"]);
palette.register("Save File", Some("Save current file"), &["file", "save"]);
palette.open(); // Show the palette
// In your update loop, handle events:
if let Some(action) = palette.handle_event(event) {
match action {
PaletteAction::Execute(id) => { /* run the action */ }
PaletteAction::Dismiss => { /* palette was closed */ }
}
}
// Render as a Widget
palette.render(area, &mut frame);§Submodules
scorer: Bayesian fuzzy matcher with explainable scoring
Re-exports§
pub use scorer::BayesianScorer;pub use scorer::ConformalRanker;pub use scorer::EvidenceKind;pub use scorer::EvidenceLedger;pub use scorer::IncrementalScorer;pub use scorer::IncrementalStats;pub use scorer::MatchResult;pub use scorer::MatchType;pub use scorer::RankConfidence;pub use scorer::RankStability;pub use scorer::RankedItem;pub use scorer::RankedResults;pub use scorer::RankingSummary;
Modules§
- scorer
- Bayesian Match Scoring for Command Palette.
Structs§
- Action
Item - A single action that can be invoked from the command palette.
- Command
Palette - Command palette widget for instant action search.
- Palette
Match - Read-only view of a scored palette item.
- Palette
Style - Visual styling for the command palette.
Enums§
- Match
Filter - Optional match-type filter for palette results.
- Palette
Action - Action returned from event handling.