Conversation
Up/Ctrl+P walks backward through past search queries, Down/Ctrl+N walks forward. Down past the newest entry clears the input. History is in-memory only with a 50-entry cap and consecutive-duplicate dedup.
Validates Task 2 acceptance gates from the search-history plan. Modernizes recallHistory clamp logic to use min/max builtins and range-over-int loop in the cap-enforcement test.
Add Up/Ctrl+P and Down/Ctrl+N rows to the search keybindings tables in README.md, site/docs.html, and the two byte-identical usage.md copies in .claude-plugin/ and plugins/codex/. Move the search-history plan file to docs/plans/completed/.
Refactor appendSearchHistory to a single exit path so the historyIdx reset isn't duplicated across the dedup early return and the append path. Trim two test assertion messages that exceeded the 130-char guideline. Replace the deprecated reflect.Ptr alias with reflect.Pointer in isNilValue.
inject Up/Ctrl+P and Down/Ctrl+N entries into the existing Search section of the help overlay so users can discover the in-prompt recall keybindings without reading the README.
replace 9 backward for-loops with slices.Backward iterators across app/themes.go, app/ui/annotate.go, app/ui/diffnav.go, app/ui/view.go, and app/ui/sidepane/filetree.go. clears modernize linter findings. no behavior change.
There was a problem hiding this comment.
Pull request overview
Adds in-session (non-persisted) search query history recall within the / search prompt, addressing issue #170 by allowing users to navigate previously submitted queries via Up/Ctrl+P and Down/Ctrl+N.
Changes:
- Implemented session-scoped search query history in the TUI search prompt (deduped, capped at 50, with recall navigation).
- Added unit tests covering history append/dedup/cap behavior, recall navigation, and help-overlay entry presence.
- Updated user-facing documentation/help to list the new keybindings; additionally refactored several reverse-iteration loops to use
slices.Backward.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
app/ui/search.go |
Adds capped in-memory search history, recall navigation, and key handling for Up/Down + Ctrl+P/Ctrl+N. |
app/ui/model.go |
Extends searchState with history fields; adjusts typed-nil detection logic. |
app/ui/search_test.go |
Adds comprehensive unit tests for search history behavior and key wiring. |
app/ui/handlers.go |
Extends help overlay “Search” section with the new recall keybindings. |
app/ui/handlers_test.go |
Tests that help overlay includes the new search prompt history entries. |
README.md |
Documents the new search prompt recall keybindings. |
site/docs.html |
Documents the new search prompt recall keybindings for the website docs. |
.claude-plugin/skills/revdiff/references/usage.md |
Updates plugin usage docs with the new search recall keybindings. |
plugins/codex/skills/revdiff/references/usage.md |
Updates plugin usage docs with the new search recall keybindings. |
docs/ARCHITECTURE.md |
Updates architecture documentation to include the new searchState fields. |
docs/plans/completed/20260507-search-history.md |
Adds completed implementation plan/notes for the feature. |
app/ui/view.go |
Refactors reverse traversal in truncation helper using slices.Backward. |
app/ui/sidepane/filetree.go |
Refactors multiple reverse loops (truncation, navigation) using slices.Backward. |
app/ui/diffnav.go |
Refactors reverse loop(s) for cursor/hunk navigation using slices.Backward. |
app/ui/annotate.go |
Refactors reverse scan in visualRowToDiffLine using slices.Backward. |
app/themes.go |
Refactors reverse deletion loop using slices.Backward. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
umputun
added a commit
that referenced
this pull request
May 8, 2026
Documents the search-history keybindings (Up/Ctrl+P, Down/Ctrl+N) added to usage.md by #171.
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.
Up / Ctrl+P recalls the previous submitted query inside the search prompt; Down / Ctrl+N walks forward and clears past the newest entry. History is in-memory, scoped to the session, capped at 50 entries with consecutive-duplicate dedup. README, site/docs.html, both plugin
usage.mdcopies, and the in-app help overlay all list the new keys.Fixes #170.