fix(tui): forceGotoBottom scrolls regardless of transcript length change (#4797)
Summary
Fixes #4797
When switching sessions, replayActiveBranch() sets forceGotoBottom=true to pin the viewport to the latest message. However, GotoBottom() was guarded inside a conditional that only fires when the transcript length changes. If the new session had the same number of lines, the viewport stayed at the intermediate scroll position.
Root Cause
In internal/cli/chat_tui.go's Update() wrapper, the scroll-to-bottom logic (if wasAtBottom || cm.forceGotoBottom) was inside the if len(cm.transcript) != prevLines || ... block. When session switch produced a transcript of equal length, the block was skipped entirely and GotoBottom() never ran.
Fix
Move the forceGotoBottom check outside the transcript-change conditional so it always triggers scroll-to-bottom, regardless of content length.
Tests
- Added
TestForceGotoBottomScrollsToBottom— verifies viewport scrolls to bottom whenforceGotoBottomis set, even with unchanged transcript length