Open
Conversation
1 task
6464265 to
fe7be3f
Compare
- Replace simple select dialog with advanced fuzzy search interface - Add fuzzysort integration for intelligent text matching - Implement keyboard navigation (arrows, page up/down, vi keys) - Add real-time filtering with match highlighting preview - Improve visual design with selection highlighting and theming - Add mouse support for item selection and hover navigation - Add Ctrl+U keyboard shortcut to clear search filter
edlsh
added a commit
to edlsh/opencode
that referenced
this pull request
Dec 28, 2025
Implements bash-style inline history search as suggested in anomalyco#5062. Alternative approach to anomalyco#5775's modal dialog. Features: - Inline reverse-i-search: preview matches directly in prompt textarea - Incremental substring search with real-time updates - Keyboard controls: Ctrl+R/Up cycle older, Down for newer, Enter accept, Esc/Ctrl+G cancel - Status line showing (reverse-i-search)'query': N/M - Full state preservation: prompt text, parts, extmarks, mode, cursor position - Configurable keybind (history_search, default: ctrl+r) Implementation details: - historySearch state tracks: active, query, matchIndex, originalPrompt, originalMode, originalCursorOffset - Exposed history.items getter for direct access to prompt history - History search takes precedence over shell-mode and other handlers when active - Paste blocked during search mode - Preview updates parts/extmarks consistently with normal history navigation Closes anomalyco#5062 Related to anomalyco#1701
Contributor
|
Hey @jiahaoxiang2000! I implemented an alternative approach in #6276 that uses inline reverse-i-search (bash-style) instead of a modal dialog. Key differences:
This was inspired by @ShpetimA's suggestion in #5062:
Both approaches have merit - the modal provides a visual list which some users might prefer, while inline keeps the shell-like feel. Curious what the maintainers think about which direction fits better for opencode's TUI! |
edlsh
added a commit
to edlsh/opencode
that referenced
this pull request
Dec 28, 2025
Implements bash-style inline history search as suggested in anomalyco#5062. Alternative approach to anomalyco#5775's modal dialog. Features: - Inline reverse-i-search: preview matches directly in prompt textarea - Incremental substring search with real-time updates - Keyboard controls: Ctrl+R/Up cycle older, Down for newer, Enter accept, Esc/Ctrl+G cancel - Status line showing (reverse-i-search)'query': N/M - Full state preservation: prompt text, parts, extmarks, mode, cursor position - Configurable keybind (history_search, default: ctrl+r) Implementation details: - historySearch state tracks: active, query, matchIndex, originalPrompt, originalMode, originalCursorOffset - Exposed history.items getter for direct access to prompt history - History search takes precedence over shell-mode and other handlers when active - Paste blocked during search mode - Preview updates parts/extmarks consistently with normal history navigation Closes anomalyco#5062 Related to anomalyco#1701
edlsh
added a commit
to edlsh/opencode
that referenced
this pull request
Dec 28, 2025
Implements bash-style inline history search as suggested in anomalyco#5062. Alternative approach to anomalyco#5775's modal dialog. Features: - Inline reverse-i-search: preview matches directly in prompt textarea - Incremental substring search with real-time updates - Keyboard controls: Ctrl+R/Up cycle older, Down for newer, Enter accept, Esc/Ctrl+G cancel - Status line showing (reverse-i-search)'query': N/M - Full state preservation: prompt text, parts, extmarks, mode, cursor position - Configurable keybind (history_search, default: ctrl+r) Implementation details: - historySearch state tracks: active, query, matchIndex, originalPrompt, originalMode, originalCursorOffset - Exposed history.items getter for direct access to prompt history - History search takes precedence over shell-mode and other handlers when active - Paste blocked during search mode - Preview updates parts/extmarks consistently with normal history navigation Closes anomalyco#5062 Related to anomalyco#1701
edlsh
added a commit
to edlsh/opencode
that referenced
this pull request
Dec 28, 2025
Implements bash-style inline history search as suggested in anomalyco#5062. Alternative approach to anomalyco#5775's modal dialog. Features: - Inline reverse-i-search: preview matches directly in prompt textarea - Incremental substring search with real-time updates - Keyboard controls: Ctrl+R/Up cycle older, Down for newer, Enter accept, Esc/Ctrl+G cancel - Status line showing (reverse-i-search)'query': N/M - Full state preservation: prompt text, parts, extmarks, mode, cursor position - Configurable keybind (history_search, default: ctrl+r) Implementation details: - historySearch state tracks: active, query, matchIndex, originalPrompt, originalMode, originalCursorOffset - Exposed history.items getter for direct access to prompt history - History search takes precedence over shell-mode and other handlers when active - Paste blocked during search mode - Preview updates parts/extmarks consistently with normal history navigation Closes anomalyco#5062 Related to anomalyco#1701
00637c0 to
71e0ba2
Compare
f1ae801 to
08fa7f7
Compare
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.
Summary
Implements Ctrl+R history search functionality for the TUI prompt, allowing users to fuzzy search through their prompt history.
Changes
DialogHistorySearchcomponent with fuzzy filtering and deduplicationitemsgetter andreset()method toPromptHistorycontexthistory_searchkeybind (default:ctrl+r) to configCloses #5062
Related #6276