Skip to content

feat: implement advanced search ranking system and release branch workflow#22

Merged
Mjoyufull merged 1 commit intodevfrom
feat/search-ranking
Jan 5, 2026
Merged

feat: implement advanced search ranking system and release branch workflow#22
Mjoyufull merged 1 commit intodevfrom
feat/search-ranking

Conversation

@Mjoyufull
Copy link
Owner

@Mjoyufull Mjoyufull commented Jan 5, 2026

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.

  • I did basic linting
  • I'm a clown who can't code 🤡

Changes

Search Ranking System

  • Implemented 12-tier search ranking with frecency integration
    • Prioritizes pinned apps, exact matches, prefix matches, and word-start matches
    • Integrates frecency scores (zoxide-style) with time-bucketed multipliers
    • Configurable prefix_depth option for controlling prefix matching priority
    • Balanced scoring: matcher (100x) and frecency (10x) multipliers
    • Searches across app names, executable names, keywords, categories, and generic names
  • Added --prefix-depth CLI flag and config option (default: 3)

Release Management

  • Implemented release branch pattern (release/vX.Y.Z) for version management
    • Releases now go through release branches instead of direct dev→main merges
    • Allows dev to continue accepting PRs during release preparation
    • Documented workflow in PROJECT_STANDARDS.md and CONTRIBUTING.md

Code Quality

  • Removed unused Message enum variants (KeyInput, Mouse, TogglePin, Render, Resize)
  • Removed unused MouseEventKind enum
  • Removed unused FrecencyEntry::new() function
  • Removed unused imports (KeyCode, KeyModifiers)
  • Fixed typo: "Lauch" → "Launch" in launch.rs

Documentation

  • Updated README.md with search ranking details and prefix_depth documentation
  • Updated USAGE.md with prefix_depth configuration examples
  • Updated config.toml with prefix_depth option and usage comments
  • Updated PROJECT_STANDARDS.md and CONTRIBUTING.md with release branch workflow
  • Updated fsel.1 man page

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

…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-apps
Copy link

greptile-apps bot commented Jan 5, 2026

Greptile Summary

This 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:

  • Configurable prefix depth (prefix_depth config option, default 3 characters) controls when prefix matching takes priority over other match types
  • 12 distinct ranking tiers ensure predictable, intuitive search results with pinned apps always appearing first
  • Frecency integration applies time-bucketed multipliers (4x for <1 hour, 2x for <1 day, 0.5x for <1 week, 0.25x for older) with additive boosting (10x multiplier) that doesn't dominate exact/prefix matches
  • Multi-field matching searches across app names, executable names, keywords, categories, and generic names
  • Score breakdown tracking added for debugging with -T flag (includes detailed tier, matcher score, and frecency boost information)

Release Management Improvements:

  • Introduced release/vX.Y.Z branch pattern for version management
  • Allows dev branch to continue accepting PRs during release preparation
  • Fully documented in PROJECT_STANDARDS.md and CONTRIBUTING.md

Code Quality:

  • Removed unused Message enum variants (KeyInput, Mouse, TogglePin, Render, Resize)
  • Removed unused MouseEventKind enum
  • Removed unused FrecencyEntry::new() function
  • Cleaned up unused imports
  • Fixed import ordering in search.rs

Documentation:

  • Comprehensive updates to README.md, USAGE.md, config.toml, and fsel.1 man page
  • All documentation includes search ranking details and prefix_depth usage examples

All changes are backward compatible - existing configurations continue to work with sensible defaults.

Confidence Score: 5/5

  • This PR is safe to merge with no critical issues found
  • The implementation is well-structured with clear separation of concerns. The 12-tier ranking system uses sensible score ranges (100M+ for top tiers) that prevent score overflow. Frecency integration is properly balanced to enhance but not dominate explicit matches. Code cleanup removes genuinely unused code without affecting functionality. All changes are backward compatible with appropriate defaults. Documentation is comprehensive and accurate.
  • No files require special attention

Important Files Changed

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
Loading

@Mjoyufull Mjoyufull merged commit 30a8ba8 into dev Jan 5, 2026
1 check passed
@Mjoyufull Mjoyufull deleted the feat/search-ranking branch January 5, 2026 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant