Keep the cursor in place when marking a thread seen - #523
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The window can still scroll when resort() follows the moved posting before selecting its successor.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Updates Imbox seen-state navigation so the cursor advances to the next thread instead of following the moved thread.
Changes:
- Tracks the adjacent posting when marking the cursor’s thread seen.
- Adds cursor-position and scrolling tests.
- One scrolling bug remains when
resort()changes a nonzero offset.
[!TIP]
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or rungh pr ready --undo.
Click "Ready for review" or rungh pr readyto reengage.
| File | Description |
|---|---|
internal/tui/content.go |
Changes cursor behavior when marking threads seen. |
internal/tui/tui_test.go |
Updates and extends seen-navigation tests. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
351
to
+355
| func (c *contentList) markSeen(index int) { | ||
| var nextID int64 | ||
| if index == c.cursor && !c.hideSeenState { | ||
| if index+1 < len(c.postings) { | ||
| nextID = c.postings[index+1].ID |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Marking the cursor's thread seen re-sorted with the cursor still on it, so the window scrolled down after it and then snapped back with the next thread on the top row. A live re-read that dropped the cursor's thread sent the cursor to the top of the list. Both now leave the window and the cursor's row where they were. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dhh
force-pushed
the
tui-seen-keeps-cursor-in-place
branch
from
September 29, 2026 20:05
f4cd9b0 to
0ceb56c
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.

Pressing
eon a thread in New for You used to move the cursor down to Previously Seen with the thread, and the list scrolled after it. Working down New for You meant hunting back up for the next thread after everye.markSeenininternal/tui/content.go.markSeennow restores the scroll position before placing the cursor.keepPlaceInnow keeps the cursor on the same row, on the thread that moved up into it. It used to jump to the top of the list. Three selection tests assumed that jump and hardcoded the top row's id; they now use whatever thread is under the cursor.eon a thread already in Previously Seen moves nothing, so the cursor stays put too. Found in review: it used to step to the neighbouring thread.resort()still keeps the cursor on its posting.TestContentListMovesSeenBubbledUpPostingToItsSectionnow expects the cursor to stay put. New tests cover staying on the row, keeping the window still in a list long enough to scroll, marking the last thread in New for You, and a re-read that drops the cursor's thread.🤖 Generated with Claude Code