feat: implement advanced search ranking system and release branch workflow#22
Merged
feat: implement advanced search ranking system and release branch workflow#22
Conversation
…kflow Major Features: - Add 12-tier search ranking system with frecency-based prioritization * Prioritizes pinned apps, exact matches, prefix matches, and word-start matches * Integrates frecency scores (zoxide-style) with time-bucketed multipliers * Configurable prefix_depth for controlling when prefix matching takes priority * Matcher score (100x) and frecency boost (10x) multipliers for balanced ranking * Searches app names, executable names, keywords, categories, and generic names - Add debug/test mode (-T/--test flag) * Timestamped log files: fsel-debug-YYYYMMDD-HHMMSS-pidXXXXX.log * Comprehensive logging: startup config, query changes, search snapshots, selection changes, launch events * Detailed score breakdowns showing tier, bucket score, matcher score, and frecency boost * Session timing and statistics Release Management: - Implement release branch pattern for version management * Releases now go through release/vX.Y.Z branches instead of direct dev->main * Allows dev to continue accepting PRs during release preparation * Documented in PROJECT_STANDARDS.md and CONTRIBUTING.md Code Quality: - Remove unused Message enum variants (KeyInput, Mouse, TogglePin, Render, Resize) - Remove unused MouseEventKind enum - Remove unused FrecencyEntry::new() function - Fix typo: Lauch -> Launch in launch.rs Documentation: - Update README.md, USAGE.md, fsel.1 with debug mode and prefix_depth documentation - Add prefix_depth option to config.toml with usage examples - Update help messages to include -T/--test and --prefix-depth flags - Document release branch workflow in project standards Files changed: 23 files, +1174 insertions, -261 deletions
Greptile SummaryThis PR implements a sophisticated 12-tier search ranking system that dramatically improves application search accuracy. The ranking system prioritizes results in this order: pinned apps → exact matches → prefix matches → word-start matches → metadata matches → fuzzy matches. Within each tier, frecency scores (zoxide-style time-bucketed scoring) provide intelligent boosting based on usage patterns. Key Implementation Details:
Release Management Improvements:
Code Quality:
Documentation:
All changes are backward compatible - existing configurations continue to work with sensible defaults. Confidence Score: 5/5
|
| Filename | Overview |
|---|---|
| src/core/state.rs | Implemented 12-tier search ranking system with frecency integration, score breakdown tracking, and debug logging support |
| src/cli.rs | Added prefix_depth CLI flag and config option, improved help text with prefix-depth documentation |
| src/config.rs | Added prefix_depth configuration support with default value of 3 characters |
| src/modes/app_launcher/run.rs | Updated to pass frecency_data and prefix_depth to State::new, added debug logging support for test mode |
| src/desktop/app.rs | Added ScoreBreakdown field to App struct for detailed debug scoring information |
| PROJECT_STANDARDS.md | Documented release branch workflow (release/vX.Y.Z pattern) for version management |
| README.md | Updated with search ranking system details and prefix_depth configuration documentation |
Sequence Diagram
sequenceDiagram
participant User
participant CLI
participant State
participant Filter
participant Matcher
participant Frecency
participant UI
User->>CLI: Type search query
CLI->>State: CharInput message
State->>State: Update query string
State->>Filter: filter()
Filter->>Filter: Check if query empty
alt Query is empty
Filter->>State: Return all apps (original order)
else Query has text
Filter->>Matcher: Create nucleo matcher
Filter->>Matcher: Parse search pattern
loop For each app
Filter->>Filter: Check exact matches (app/exec name)
Filter->>Filter: Check prefix matches (app/exec name)
Filter->>Filter: Check word-start matches (within prefix_depth)
Filter->>Filter: Check metadata matches (keywords/categories)
Filter->>Matcher: Calculate fuzzy match score
Filter->>Filter: Determine ranking tier (1-12)
alt App is pinned
Filter->>Filter: Assign tier 1-8 (120M-20M range)
else App is not pinned
Filter->>Filter: Assign tier 9-12 (90M-0 range)
end
Filter->>Frecency: Get frecency score
Frecency->>Frecency: Calculate time-bucketed multiplier
Frecency->>Filter: Return frecency boost
Filter->>Filter: final_score = bucket + (matcher*100) + (frec*10)
Filter->>Filter: Create ScoreBreakdown
end
Filter->>Filter: Sort by final_score (desc), then name
Filter->>State: Return ranked results
end
State->>State: Reset selection to first item
State->>UI: Trigger render with ranked apps
UI->>User: Display search results
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements advanced 12-tier search ranking system with frecency-based prioritization and introduces release branch workflow for better version management. Also includes code cleanup and comprehensive documentation updates.
Changes
Search Ranking System
prefix_depthoption for controlling prefix matching priority--prefix-depthCLI flag and config option (default: 3)Release Management
release/vX.Y.Z) for version managementCode Quality
Documentation
Breaking Changes
None - all changes are backward compatible. Existing configs continue to work with new defaults.
Related Issues
N/A - Internal improvements and feature additions