Repository navigation
Keep an opened message in place until you leave the reader - #106
Merged
Merged
Conversation
With Unread first or Unread only on, a message marked read on open used to re-sort into the read block (or drop out of the list) as soon as the server confirmed, and the cursor followed it down. Now it keeps its unread position while it is open in the focused reader. When focus leaves the reader or another message opens, it moves to its place and the cursor stays on the same row, which is now the next unread message. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
With Unread first on, opening an unread message marks it read (Mark read on open). When the server confirmed the read, the list re-sorted and the message dropped into the read block. The cursor followed it there by ID. Back in the list, you were at the bottom and had to scroll up to the unread messages to keep going. Unread only had the same jump: the message vanished from the list while you were reading it.
Change
x, and chronological order are unchanged.Implementation
Model.heldReadIDis set byopenedMessageCmdwhen Unread first or Unread only is on.sortsAsReadis used by the Unread only filter and by the conversation sort.keepHeldUnreadPositionputs the held message back in the unread block by date, undoing the SQLread ASCplacement.Updatewraps the existing handler (nowhandleUpdate) and callsreleaseHeldReadonce the reader no longer shows the held message with focus.Tests
held_read_test.go:go test ./..., the race tests andgo vet ./...pass.unread_first = true: I opened the top unread message, waited for the read to confirm, and checked it was still in row 1. After Esc the cursor was on the next unread message.Docs
docs/guide.mdcovers this in two places: the message-ordering paragraph and "Pending read/unread changes". A CHANGELOG entry is under Unreleased → Changed. The help text, README, STATUS andkeybindings.csvdon't describe this ordering, and there are no new keys.🤖 Generated with Claude Code