Skip to content

Turn picker: 10 visible rows + non-blocking history load - #1054

Merged
edwin-zvs merged 2 commits into
mainfrom
turn-picker-rows
Jul 31, 2026
Merged

Turn picker: 10 visible rows + non-blocking history load#1054
edwin-zvs merged 2 commits into
mainfrom
turn-picker-rows

Conversation

@edwin-zvs

@edwin-zvs edwin-zvs commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

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 = 10 instead 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

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.
@edwin-zvs edwin-zvs changed the title 10 visible rows for the fork turn picker Turn picker: 10 visible rows + non-blocking history load Jul 31, 2026
@edwin-zvs
edwin-zvs merged commit 8bbed5f into main Jul 31, 2026
1 check passed
@edwin-zvs
edwin-zvs deleted the turn-picker-rows branch July 31, 2026 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant