@-picker rebuild + mouse-wheel chat scroll#479
Merged
Conversation
Empty / trailing-slash queries (`@`, `@src/`) browse one directory level with a single readdir — folders selectable, drill via Tab. Any non-slash filter (`@foo`, `@auth/log`) kicks off a cancelable streaming walk across the full tree, batching matches into the popup as they're found, with a `searching… N scanned` footer while in flight. Replaces the upfront 500-file walk that was unusable on large repos — on a 5k-file tree the cap evicted ~90% of paths before ranking, leaving the picker effectively empty. - walkFilesStream: cancelable streaming walker; powers search mode - listDirectory: single-level browse, no recursion; powers browse mode - parseAtQuery: splits `dir/filter` with trailing-slash awareness - listFilesWithStatsAsync now delegates to walkFilesStream (no behavior change for existing callers) - expandAtUrls + helpers split into at-mentions-url.ts to keep at-mentions.ts under the 800-line ceiling Closes #478
Enable DECSET 1006 + 1000 at startup so the terminal reports wheel events as `\x1b[<btn;col;row;M` mouse sequences instead of translating them to ↑/↓ key presses. The chat-scroll handler routes the resulting mouseScrollUp/Down events to scrollback, bypassing the arrow-key path entirely — the wheel now scrolls chat regardless of buffer state, while ↑/↓ keys retain their existing PromptInput bindings (history recall on empty buffer, cursor motion otherwise). The SGR mouse parser already lived in stdin-reader.ts; this just turns on the terminal-side feature so events actually flow. Cost: terminal-native drag-to-select needs a modifier (Shift on Windows Terminal / Alacritty / WezTerm, Option on iTerm2) — same trade-off as tmux, Claude Code, Cursor's terminal.
This was referenced May 9, 2026
Merged
ChasLui
pushed a commit
to ChasLui/DeepSeek-Reasonix
that referenced
this pull request
May 23, 2026
* feat(at-picker): rebuild as file browser with streaming search Empty / trailing-slash queries (`@`, `@src/`) browse one directory level with a single readdir — folders selectable, drill via Tab. Any non-slash filter (`@foo`, `@auth/log`) kicks off a cancelable streaming walk across the full tree, batching matches into the popup as they're found, with a `searching… N scanned` footer while in flight. Replaces the upfront 500-file walk that was unusable on large repos — on a 5k-file tree the cap evicted ~90% of paths before ranking, leaving the picker effectively empty. - walkFilesStream: cancelable streaming walker; powers search mode - listDirectory: single-level browse, no recursion; powers browse mode - parseAtQuery: splits `dir/filter` with trailing-slash awareness - listFilesWithStatsAsync now delegates to walkFilesStream (no behavior change for existing callers) - expandAtUrls + helpers split into at-mentions-url.ts to keep at-mentions.ts under the 800-line ceiling Closes esengine#478 * fix(scroll): route mouse wheel via SGR mouse tracking Enable DECSET 1006 + 1000 at startup so the terminal reports wheel events as `\x1b[<btn;col;row;M` mouse sequences instead of translating them to ↑/↓ key presses. The chat-scroll handler routes the resulting mouseScrollUp/Down events to scrollback, bypassing the arrow-key path entirely — the wheel now scrolls chat regardless of buffer state, while ↑/↓ keys retain their existing PromptInput bindings (history recall on empty buffer, cursor motion otherwise). The SGR mouse parser already lived in stdin-reader.ts; this just turns on the terminal-side feature so events actually flow. Cost: terminal-native drag-to-select needs a modifier (Shift on Windows Terminal / Alacritty / WezTerm, Option on iTerm2) — same trade-off as tmux, Claude Code, Cursor's terminal.
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
Two related fixes addressing user reports in #478 and discussion #22.
1.
feat(at-picker): rebuild as file browser with streaming searchReplaces the upfront 500-file walk that was unusable on real-sized repos — on a 5k-file tree the cap evicted ~90% of paths before ranking ever ran, so the picker often showed nothing useful.
New behavior:
@alone or@some/dir/→ browse mode: lists ONE directory's immediate children (no recursion). Folders selectable; Tab drills, Enter commits.@foo,@auth/log) → search mode: cancelable streaming walk across the full tree, results stream in as the walker finds them, footer showssearching… N scannedwhile in flight.Internals:
walkFilesStream— cancelable streaming walker (per-entryonEntrycallback +AbortSignal)listDirectory— single-level browse, gitignore-awareparseAtQuery— splitsdir/filterwith trailing-slash awarenesslistFilesWithStatsAsyncnow delegates towalkFilesStream(no behavior change for existing callers)expandAtUrls+ helpers split out toat-mentions-url.tsto keepat-mentions.tsunder the 800-line ceilingCloses #478
2.
fix(scroll): route mouse wheel via SGR mouse trackingThe picker rebuild surfaces a pre-existing UX problem more often: terminals like Windows Terminal map the scroll wheel to ↑/↓ key sequences, which
PromptInputconsumes for history recall and cursor motion. So scrolling the wheel while typing did history recall instead of scrolling chat.Fix: enable SGR mouse tracking (DECSET 1006 + 1000) at startup. The terminal now reports wheel events as
\x1b[<btn;col;row;Mmouse sequences instead of arrow keys; the chat-scroll handler routes thosemouseScrollUp/Downevents to scrollback, bypassing the arrow-key path entirely.The SGR mouse parser already lived in
stdin-reader.ts— this just turns on the terminal-side feature.Trade-off: terminal-native drag-to-select needs a modifier (Shift on Windows Terminal / Alacritty / WezTerm, Option on iTerm2). Same convention as tmux, Claude Code, Cursor's terminal.
Test plan
npm run verify— build + lint + typecheck + 2291 tests passwalkFilesStream(cancel, halt, ignore-dirs, progress),listDirectory(folders-first, gitignore, escape, missing dir),parseAtQuery(trailing slash, backslash normalization)@on a 5000-file repo shows root listing instantly@src/austreams matches withsearching… N scannedfooter/and re-opens picker for that subdir; Enter commits