fix: Search in help - #409
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe Help menu now highlights every filter match in visible rows. Matching uses smart-case rules and Unicode-safe byte ranges. The app-level model stores match ranges before rendering. Documentation and tests cover the behavior. ChangesHelp search highlighting
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Sequence Diagram(s)sequenceDiagram
participant User
participant HelpMenu
participant ensure_help_menu_model
participant Terminal
User->>HelpMenu: enter a search filter
HelpMenu->>ensure_help_menu_model: prepare formatted rows and match ranges
ensure_help_menu_model->>Terminal: render matched and unmatched spans
Terminal-->>User: display highlighted filter matches
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/tui/ui/help.rs`:
- Around line 46-68: Update help_match_ranges in both case-sensitive and
case-insensitive matching branches to detect overlapping term matches by
checking every valid UTF-8 character boundary instead of relying on
str::match_indices. Preserve the existing range widening for case-insensitive
matches, and add a regression assertion that help_match_ranges("aaa", "aa")
returns vec![(0, 3)].
In `@src/tui/ui/popups.rs`:
- Around line 29-30: Remove the global HELP_MENU_CACHE and move the formatted
help model into App-owned state. Update draw_help_menu to receive immutable help
data from App rather than locking or mutating cache state during rendering, and
rebuild that data only when input or resize state changes.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: fce0cab1-1ff7-4b59-8da4-fe97a9b4450f
📒 Files selected for processing (4)
CHANGELOG.mddocs/keybindings.mdsrc/tui/ui/help.rssrc/tui/ui/popups.rs
Fixes #408.
Summary
Search in help
Validation
🤖 AI-authored PR, operated by @yhay81.
Summary by CodeRabbit
New Features
Documentation