Skip to content

feat: filter keybind help - #1832

Merged
ogulcancelik merged 2 commits into
herdrdev:masterfrom
corrius:feat/ac/searchable-keybind-help
Jul 24, 2026
Merged

ogulcancelik merged 2 commits into
herdrdev:masterfrom
corrius:feat/ac/searchable-keybind-help

Conversation

@corrius

@corrius corrius commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • add /-focused substring filtering to keybind help by displayed action and shortcut
  • preserve j/k scrolling outside search, with Esc returning to command mode before closing
  • keep filtered scroll, paste, and mouse behavior consistent and document it in next-release keyboard docs

Searchable keybind help

Checks

  • just check

refs #1825

Summary by CodeRabbit

  • New Features
    • Enhanced keybind help with live, case-insensitive filtering across action names and shortcuts.
    • Use / to focus search, Backspace to edit, and Ctrl+U to clear; paste now fills the focused query.
    • Header/footer now reflect search state, and keyboard help supports improved Esc/Shift+? behavior while searching.
    • When no results match, the UI shows a clear “no keybinds found” message.
  • Bug Fixes
    • The keybind help close/back control now returns to the prior help view instead of dismissing the modal.
  • Documentation
    • Updated keyboard help docs in English, Japanese, and Chinese to describe the new search and filtering controls.

@kangal-bot kangal-bot added the greptile-review Trigger Greptile review for contributor-approved pull requests label Jul 24, 2026
@coderabbitai

coderabbitai Bot commented Jul 24, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ca8433f7-0121-4922-811b-ed0d10c78e69

📥 Commits

Reviewing files that changed from the base of the PR and between 99cec9f and e0f1f3e.

📒 Files selected for processing (1)
  • src/app/input/modal.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/app/input/modal.rs

📝 Walkthrough

Walkthrough

Keybind help now supports /-activated search, case-insensitive filtering by shortcuts or labels, query editing, paste input, and search-aware navigation. State initialization, mouse handling, tests, and English, Japanese, and Chinese documentation were updated.

Changes

Keybind Help Search

Layer / File(s) Summary
Search state and filtered rendering
src/app/state.rs, src/app/mod.rs, src/ui/keybind_help.rs
Keybind help tracks query and focus state, filters bindings by shortcut or label, and renders search-aware controls and empty results.
Keyboard search interaction
src/app/input/modal.rs, src/app/input/mod.rs, src/app/mod.rs
Raw terminal keys support search focus, character insertion, Backspace, ctrl+u, navigation, Esc, Enter, and context-sensitive Shift+? behavior.
Paste, mouse, and usage integration
src/app/input/mod.rs, src/app/input/overlays.rs, docs/next/website/src/content/docs/.../keyboard.mdx
Focused search accepts sanitized pasted text, the overlay back control resets search without closing help, and localized documentation describes filtering controls.

Estimated code review effort: 3 (Moderate) | ~30 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Terminal
  participant AppInput
  participant KeybindHelpState
  participant KeybindHelpUI
  Terminal->>AppInput: Send search key
  AppInput->>KeybindHelpState: Update query or focus
  KeybindHelpState->>KeybindHelpUI: Apply query to keybind groups
  KeybindHelpUI-->>Terminal: Display filtered bindings
Loading

Possibly related issues

  • ogulcancelik/herdr#1825 — Directly covers the keybind-help search and filtering behavior implemented here.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 28.57% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding filtering to the keybind help overlay.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds searchable filtering to the keybind-help overlay.

  • Introduces focused query state with keyboard and paste input handling.
  • Filters displayed actions and shortcuts case-insensitively while keeping scrolling synchronized.
  • Adds contextual back, close, search, and scrolling affordances.
  • Documents the new controls in English, Japanese, and Chinese.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
src/app/input/modal.rs Adds keybind-help query editing, focus transitions, scrolling controls, and associated input tests.
src/app/input/mod.rs Routes terminal keys and focused paste events into the keybind-help search state.
src/app/input/overlays.rs Connects the keybind-help header action to the search-aware back transition.
src/app/state.rs Extends keybind-help state with a query and search-focus flag.
src/ui/keybind_help.rs Filters help entries, renders empty results, and adds search-aware header and footer guidance.
docs/next/website/src/content/docs/keyboard.mdx Documents the keybind-help filtering controls in English.
docs/next/website/src/content/docs/ja/keyboard.mdx Documents the keybind-help filtering controls in Japanese.
docs/next/website/src/content/docs/zh-cn/keyboard.mdx Documents the keybind-help filtering controls in Simplified Chinese.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Open keybind help] --> B[Command mode]
  B -->|Slash| C[Search focused]
  B -->|Scroll keys or mouse| B
  B -->|Esc, Enter, or question mark| D[Close help]
  C -->|Type or paste| E[Filter actions and shortcuts]
  E --> C
  C -->|Backspace or Ctrl+U| C
  C -->|Esc or header back| B
  C -->|Enter| D
Loading

Reviews (2): Last reviewed commit: "fix: recognize shifted slash in keybind ..." | Re-trigger Greptile

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 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/app/state.rs`:
- Around line 1385-1389: Move the presentation-only query and search_focused
fields out of the shared KeybindHelpState in AppState and into each client’s
overlay state, while keeping shared keybind-help data such as scroll where
appropriate. Update all keybind-help input and rendering paths to read and
mutate the client-local fields so one client’s filter state cannot affect
another.
🪄 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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 1893e009-98e6-4bc8-b753-3345a743428b

📥 Commits

Reviewing files that changed from the base of the PR and between b56baee and 99cec9f.

📒 Files selected for processing (9)
  • docs/next/website/src/content/docs/ja/keyboard.mdx
  • docs/next/website/src/content/docs/keyboard.mdx
  • docs/next/website/src/content/docs/zh-cn/keyboard.mdx
  • src/app/input/mod.rs
  • src/app/input/modal.rs
  • src/app/input/overlays.rs
  • src/app/mod.rs
  • src/app/state.rs
  • src/ui/keybind_help.rs

Comment thread src/app/state.rs Resolved
@ogulcancelik
ogulcancelik merged commit 38d2b07 into herdrdev:master Jul 24, 2026
@ogulcancelik

ghost commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

ty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

greptile-review Trigger Greptile review for contributor-approved pull requests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants