Commit 6efe3f1
fix(web-chat): prevent blank chat pane after assistant response
After a turn completes, the UI could briefly or permanently show blank
content. Two related issues:
1. When loadChatHistory is triggered by a final event (tool turns or
non-renderable final messages), chatLoading was only set inside the
async function body — synchronously, but still after the void call
site returned. In practice loadChatHistory sets it before the first
await, but explicitly pre-setting chatLoading = true at every call
site in handleTerminalChatEvent and handleChatGatewayEvent makes the
loading state visible to any synchronous re-render that fires between
the call and the function body running.
2. When loadChatHistory returned early because the client was
disconnected (!state.client || !state.connected), any chatLoading =
true that had been pre-set externally was never cleared, leaving the
UI stuck in a loading state rather than showing cached messages.
Together these close the window where: streaming ends → chatStream = null
→ chatMessages not yet updated → chatLoading still false → UI renders
empty (isEmpty = true) before the history reload finishes.
Fixes #67035
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>1 parent 30e259b commit 6efe3f1
2 files changed
Lines changed: 10 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
593 | 593 | | |
594 | 594 | | |
595 | 595 | | |
596 | | - | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
597 | 599 | | |
598 | 600 | | |
599 | 601 | | |
| |||
658 | 660 | | |
659 | 661 | | |
660 | 662 | | |
661 | | - | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
662 | 666 | | |
663 | 667 | | |
664 | 668 | | |
665 | | - | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
666 | 672 | | |
667 | 673 | | |
668 | 674 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
386 | 386 | | |
387 | 387 | | |
388 | 388 | | |
| 389 | + | |
389 | 390 | | |
390 | 391 | | |
391 | 392 | | |
| |||
0 commit comments