feat: Visual relevance bars and SOLID/DRY refactoring#39
Merged
Conversation
- Show visual bars [██████████] for ANY results with scores (not just 4-50) - Basic mode: bars only, no numeric scores for progressive disclosure - Advanced mode: bars + scores for technical users - Unified display system with format_results_unified() for consistency - Unicode-safe highlighting that handles multi-byte characters - Enhanced fuzzy match highlighting for typos and partial matches - Color-coded bars: green (excellent), yellow (good), cyan (okay), gray (weak) - Consistent 10-character bar width for easy visual comparison
- Add new_with_mode() method to control neural initialization messages - Only show '✅ Neural embeddings initialized' in advanced mode - Update AutoStrategy to use mode-aware embedder creation - Improves UX by reducing technical output for basic users
- Extract ~500 lines of duplicate pattern definitions into PatternDefinitions - Create FileIndexerBuilder to replace multiple constructor anti-pattern - Add ProgressReporter trait to separate progress concerns from indexing - Centralize programming terms, file extensions, and bigram patterns - Update all modules to use centralized pattern definitions - Improve maintainability and reduce code duplication
- Required for PatternDefinitions singleton - Version 1.5.0 for stable pattern initialization
- Update human_output_tests for new visual bar behavior - Fix error_handling_tests to exclude search result content from jargon check - Adjust test expectations for unified display system - All tests now pass (except unrelated fuzzy fallback test)
- Extract analyzer logic into reusable lightweight_analyzer module - Improve code organization and reusability - Support building analyzers with default patterns
- Update FeatureDiscovery to use centralized QueryPattern analysis - Add should_show_tip_for_query method for query-specific tips - Update all test files to use new pattern imports - Maintain consistent pattern usage across codebase
- Add advanced_mode field to control progress reporting - Add with_advanced_mode constructor for mode-aware initialization - Support PathBuf for better file path handling - Prepare for mode-specific semantic search behavior
- Remove semantic_demo example entry that was causing formatter errors - Fixes cargo fmt --all command
- Changed all format! and println! statements to use {variable} syntax
- Fixed field access in format strings by extracting to local variables
- Resolves all clippy::uninlined-format-args warnings
- Fixed test_query_analysis_works to handle large result sets with visual bars - Fixed test_intermediate_user_typo_learning to check for actual fuzzy match behavior - Both tests now properly validate the visual scoring output format
- Added NO_COLOR=1 to basic search test that was failing due to ANSI escape codes - Added NO_COLOR=1 to regex and fuzzy search tests for consistency - grep command was failing because 'TODO' was wrapped in color codes: \x1b[1;33mTODO\x1b[0m - NO_COLOR=1 ensures plain text output for reliable CI testing - Preserves colored output for interactive users while fixing CI tests
|
🤖 Auto-merged successfully! ✅ All CI checks passed Squash-merged to maintain clean commit history. |
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.
Overview
This PR implements visual relevance scoring indicators, applies SOLID/DRY principles to eliminate code duplication, and adds supporting infrastructure for better code organization.
Changes
🎯 Visual Relevance Bars
[██████████]show relevance scores for all results with scoresformat_results_unified()function handles all display modes🏗️ SOLID/DRY Refactoring
🔇 UX Improvements
📦 Additional Infrastructure
Technical Details
Files Changed
src/output/human_format.rs: Core visual scoring implementationsrc/core/patterns.rs: New centralized pattern definitionssrc/core/indexer_builder.rs: New builder pattern implementationsrc/core/progress_reporter.rs: New progress reporting traitsrc/core/embedder.rs: Mode-aware neural initializationsrc/query/lightweight_analyzer.rs: New query analysis modulesrc/search/semantic.rs: Advanced mode supportTesting
Screenshots
Basic mode output:
Advanced mode output:
Commits
feat(output): add visual relevance bars for all scored resultsfeat(embedder): suppress neural embeddings message in basic moderefactor: apply SOLID/DRY principles to eliminate code duplicationbuild: add lazy_static dependency for centralized patternstest: update tests for visual scoring and refactoring changesfeat(query): add lightweight analyzer for better query processingrefactor: update feature discovery and tests to use centralized patternsfeat(semantic): add advanced mode support to semantic searchBreaking Changes
None - all changes are backward compatible.
Related Issues
Checklist