feat(sidebar): add search confirm/cancel actions [3]#138
Draft
AbysmalBiscuit wants to merge 2 commits into
Draft
feat(sidebar): add search confirm/cancel actions [3]#138AbysmalBiscuit wants to merge 2 commits into
AbysmalBiscuit wants to merge 2 commits into
Conversation
AbysmalBiscuit
marked this pull request as draft
July 23, 2026 07:11
This was referenced Jul 23, 2026
Search-mode Enter/Esc were hardcoded in panel_filter and could not be rebound, and Enter never scrolled the activated row into view. Add three search-scoped actions — SidebarSearchConfirm (Enter), SidebarSearchCancel (Esc), and SidebarSearchCancelToTerminal (Shift+Esc) — dispatched through the keyboard binding system from the focused panel's nav pass. handle_shortcuts drops search-scoped actions so the terminal's own Enter/Esc still reach the PTY. Confirm scrolls the acted-on row into view via a focus-independent pending target, resolving a now-hidden child to its owning project header. Cancel returns the cursor to the seed row and preserves the s/a toggle filters. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Confirming a fuzzy search ran the row's full activation: a project header toggled its expansion, and a worktree or session switched workspace and moved focus to the terminal. Search is how you find a row, so acting on it in the same keystroke is surprising — and for a header destructive, collapsing the project you had just gone looking for. Confirm now only leaves search, puts the cursor on the highlighted row and scrolls it in, keeping focus in the sidebar. Activation stays a second, explicit Enter in browsing mode. That makes confirm the twin of cancel, so both share one landing helper per panel, and the git panel follows the same rule instead of opening a diff. Search lists matched worktrees and sessions whatever their project's expanded flag says, so a child under a collapsed project vanished the moment the query cleared. Confirm expands that project first — expand-only, and never for a header, which is what keeps selecting a project from behaving as a toggle. Dropping activation also drops the reason for the focus-independent pending scroll target, which existed only because activation focused the terminal and nulled the paint-time cursor. The ordinary cursor-move scroll suffices once its moved flag is forced rather than keyed on cursor identity: restoring the unfiltered list can move the same row far off-screen. That also fixes git cancel, which could leave a surviving row unscrolled. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
AbysmalBiscuit
force-pushed
the
feat/sidebar-search-actions
branch
from
July 25, 2026 08:31
154e43a to
b68df29
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.
DON'T MERGE YET!
There is a small bug with it passing through enter and toggling folding on projects that's really annoying.
What & why
Sidebar fuzzy-search
Enter/Escwere hardcoded inpanel_filterand could not be rebound, andEnternever scrolled the activated row into view.This turns the two search-mode operations into named, rebindable actions dispatched through the existing
[[keyboard.bindings]]system, and fixes the missing scroll-into-view — without touching the terminal input path, IME, or the nav/shortcuts pass structure.Changes
NamedActions:SidebarSearchConfirm(Enter),SidebarSearchCancel(Esc),SidebarSearchCancelToTerminal(Shift+Esc).drain_search_or_nav);handle_shortcutsdrops search-scoped actions so the terminal's ownEnter/Escstill reach the PTY.s/atoggle filters.Testing
cargo test -p alacritree-> 453 passed. Pure decision logic (drain_search_or_nav),panel_filter,bindings, and palette are unit-tested. App-level effects (row activation, scroll consume, terminal passthrough) are not yet automated — verify terminalEnter/Escby hand before relying on it.🤖 Generated with Claude Code