fix(agent-chat): keep the rail when received messages fold
Restore the prompt rail when a long chat contains consecutive received agent messages. #26980 folds those messages into a waitingMessages row, but the rail previously counted only top-level user rows: 24 received messages became zero rail entries and the rail disappeared.
Leo:
also i dont see the left scroll rail at all anymore?
The rail now retains each folded message's original identity and sender. Its preview identifies the sender with a bot icon and its accessible tick label identifies a received message. Clicking the tick lands on the visible containing transcript card. Human prompt behavior, the four-entry threshold, and the selected rail mode remain unchanged.
Streaming resumes at the last member of an unchanged fold, using the existing row-change boundary. No observer, timer, animation loop, or flattened history copy is added. A 1,200-message regression checks that a streamed token reads at most two members and preserves tick identity.
Validation:
- Red: 40810039789, baseline
9b7d6d9f93c44c90f690ae141a1a02b84777e155: the model lost all 12 identities; Chromium expected 24 ticks and found zero. Both tests executed. - Green: 40810657989, 29 tests / 705 assertions, including real Chromium navigation and sender preview, plus the full web check (2,968 files). The runner formatted first, recorded validated tree
1af7c42872baaa06fdf2dddf7c0d33febc80e3e5, and ran checks against those files; final head79ef54f763f3156bca76b9168dd9b9dd33ae0510has that exact tree. - Final scoped pre-push gate: no new violations.
- Before/after synthetic captures use the same 1,280 × 800 viewport and transcript.
Risk: several message ticks intentionally share the containing card's layout offset. Regression coverage checks each message identity/preview, containing-row navigation, regrouping, mixed human prompts, and bounded streaming reads.
| Before · folded messages lose the rail | After · all 24 message ticks restored |
|---|---|
![]() | ![]() |
After focusing message 7 and navigating to the containing card, the preview retains that sender and report:

Capture provenance: Chromium, 1,280 × 800, synthetic 24-message fixture plus the same long reply; before at the baseline tree plus regression tests, after at final validated tree. All three PNGs passed the media helper's privacy scan. No private reference is included.
Agent session: agent session

