Turn picker: 10 visible rows + non-blocking history load - #1054
Merged
Conversation
Turns accumulate over a session's life, unlike the harness count, so the turn picker gets its own TURN_PICKER_MAX_ROWS = 10 instead of sharing the harness picker's 8-row window — fewer scroll steps to reach older turns. All entries were already reachable by scrolling; this only widens the visible window.
C-x f awaited the source transcript fetch inside the key handler, so the whole event loop froze for as long as the daemon round-trip + parse took (up to the 800ms timeout, worse on large sessions). The picker now opens instantly with the 'now' row preselected — Enter-Enter forks from the present even before history loads — while a spawned task fetches the transcript and delivers the past-turn rows through the existing session-mutation channel. Late or mismatched results are dropped if the picker closed or re-targeted; the hint row says 'loading past turns…' while the fetch is in flight. The blocking timeout is gone.
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.
Two turn-picker improvements for the unified fork flow:
10 visible rows. The turn picker sizes its window with its own
TURN_PICKER_MAX_ROWS = 10instead of sharing the harness picker's 8-row cap — turns accumulate over a session's life, so a taller window means fewer scroll steps. Every turn was already reachable by scrolling; short terminals still clamp.No more freeze on
C-x f. The handler previously awaited the transcript fetch (up to 800ms, worse on large sessions), stalling the whole event loop. The picker now opens instantly with the now row preselected — Enter-Enter forks from the present even before history loads — while a background task fetches the transcript and streams the past-turn rows in through the session-mutation channel. The hint row shows "loading past turns…" meanwhile; late results for a closed or re-targeted picker are dropped; the blocking timeout is removed.🤖 Generated with Claude Code