feat(pick): preview the highlighted message while the picker is open - #54
Merged
backnotprop merged 1 commit intoSep 1, 2026
Merged
Conversation
The picker listed candidates but always showed the newest behind them, so choosing meant opening a message, reading it, backing out and trying the next one. Moving the cursor now swaps the document underneath and stays in the picker, which is what the list is for. The document being left is kept rather than dropped. A reply review's store is transient, so previewing away from an annotated message and back would otherwise lose the annotations; Enter had the same hole. Esc returns to whatever was open when the picker appeared, so escaping still leaves the newest message open in the common case, and returns you where you were when `p` reopened the picker mid-review. Footer updated to match.
backnotprop
enabled auto-merge
September 1, 2026 18:07
backnotprop
force-pushed
the
feat/picker-live-preview
branch
from
September 1, 2026 18:07
cca1005 to
7bad5b1
Compare
Contributor
|
Merged, with the annotation-cache design appreciated in particular — closing an existing data-loss hole as a side effect of the feature is the good kind of side effect. I rebased over #55 (two trivial keep-both hunks in the App struct) using the maintainer-edit permission; the squash is otherwise your commit. Both picker features ship in the next release. Thanks for the #53 investigation too — the follow-up it earned lives in #57. |
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.
The itch
Running several agents against one repo,
herdr lastregularly gives me a dozen-plus candidates. The picker lists them one line each, but the document behind it is always the newest, so choosing means: Enter, read,p, Enter on the next one, read, and so on. The list tells me a timestamp and a truncated first line, which often is not enough to tell two replies apart.Moving the cursor now swaps the document underneath and stays in the picker, so the list becomes browsable.
What changed
show_candidate(index)swaps the open document without leavingMode::Pick;j/k/arrows call it.open_candidateis nowshow_candidateplus the mode change and status line, so Enter behaves exactly as before.Escreturns to whatever was open when the picker appeared. In the common case that is still the newest, soescaping_the_picker_keeps_the_newest_messagepasses unchanged; whenpreopens the picker mid-review it now puts you back where you were instead of leaving a preview showing.↑↓ preview · enter open · esc cancel · q quit.The one non-obvious bit
Previewing swaps
Open, andOpenowns theStore. A reply review's store is transient, so a naive swap would silently discard annotations the moment someone touched an arrow key. The document being left is therefore kept in a small map keyed by candidate index and restored on the way back.That hole exists today on Enter too: annotate the newest,
p, Enter on another, and the annotations are gone. This closes it as a side effect rather than widening it.Memory is bounded by the candidate count, and only visited candidates are ever built.
Tests
Two, one per invariant, in
app/tests.rsalongside the existing picker tests:moving_the_picker_cursor_previews_that_message- the document follows the cursor and the picker stays openpreviewing_away_and_back_keeps_annotations- annotate,p,j,k, and the annotation is still therecargo fmt --all --check,cargo clippy --workspace --all-targetsandcargo test --workspaceare all clean on 1.97.1. 34 tests pass.Note on performance
AGENTS.mdsays never reparse a whole document on an edit. This reparses on a selection change, not an edit, and only the first time each candidate is visited; after that it comes from the map. Agent replies are small. Happy to add a cap on cached documents if you would rather bound it explicitly.Context for why I was in here: #53. This does not fix that issue, it is a separate annoyance I hit while testing it.