[PR #4041] [MERGED] fix(convo): stop messages staying truncated when the staggered reveal is interrupted (#4039) #6214

Closed
opened 2026-10-23 04:08:14 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/4041
Author: @SpicyMarinara
Created: 7/24/2026
Status: ✅ Merged
Merged: 7/24/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/4039-convo-reveal-truncation


📝 Commits (1)

  • 470d1a0 fix(convo): don't leave messages truncated when the reveal is interrupted

📊 Changes

1 file changed (+6 additions, -0 deletions)

View changed files

📝 packages/client/src/components/chat/ConversationView.tsx (+6 -0)

📄 Description

Why

Reported in #4039: in Conversation mode (since the multi-character convo work), messages intermittently display only part of their content — cut off around a word: / Speaker: boundary — while editing the message reveals that the full content was generated and stored.

Root cause (it's not the segmentation regex): I reproduced the speaker/name segmentation directly and it handles word: correctly — nothing is dropped there. The truncation is in the staggered reveal. Multi-speaker (or classic multi-part) assistant messages reveal their segments/parts one at a time, 1.5s apart, by ratcheting visibleSegmentCounts[key] / visiblePartCounts[key] from 1 up to the full count. Each stagger timer bails early when the message is not currently rendered (scrolled out of view / virtualized) — but it bailed without advancing the count, leaving the stored value stuck at a partial number. The render then caps the message at that stale value (visibleSegmentCounts[key] ?? fullCount), so everything after the last-revealed Speaker: boundary stays hidden until the chat is switched. Editing bypasses the segmented render, which is why it shows the full text.

What changed

packages/client/src/components/chat/ConversationView.tsx — in both stagger loops (parts and segments), when a reveal timer bails because the message isn't rendered, it now sets the visible count to the full count before clearing itself, instead of leaving it stuck partway. An interrupted reveal therefore shows the complete message when it re-renders, rather than staying truncated.

No change to the segmentation regexes or the normal (uninterrupted) reveal animation.

Test plan

  • In a multi-character Conversation, generate a long message with several Speaker: segments; while it is revealing, scroll it out of view and back, then confirm the whole message is shown (not cut off at a Speaker:/word: line).
  • Repeat in classic message style with a multi-line assistant message (multi-part reveal).
  • Confirm the normal staggered reveal still animates for a message that stays on screen.
  • Confirm editing a message still shows full content, and that switching chats and back shows full content.
  • pnpm check passes. (Passed in the authoring session; re-verify locally.)

Fixes #4039.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed interrupted assistant messages occasionally remaining partially hidden.
    • Messages now complete their reveal correctly when interrupted or unmounted during display.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/4041 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 7/24/2026 **Status:** ✅ Merged **Merged:** 7/24/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/4039-convo-reveal-truncation` --- ### 📝 Commits (1) - [`470d1a0`](https://github.com/Pasta-Devs/Marinara-Engine/commit/470d1a007c9357e5b4f61b5ed217cb2d6947c594) fix(convo): don't leave messages truncated when the reveal is interrupted ### 📊 Changes **1 file changed** (+6 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/chat/ConversationView.tsx` (+6 -0) </details> ### 📄 Description ## Why Reported in #4039: in Conversation mode (since the multi-character convo work), messages intermittently display only part of their content — cut off around a `word:` / `Speaker:` boundary — while editing the message reveals that the full content was generated and stored. **Root cause (it's not the segmentation regex):** I reproduced the speaker/name segmentation directly and it handles `word:` correctly — nothing is dropped there. The truncation is in the **staggered reveal**. Multi-speaker (or classic multi-part) assistant messages reveal their segments/parts one at a time, 1.5s apart, by ratcheting `visibleSegmentCounts[key]` / `visiblePartCounts[key]` from 1 up to the full count. Each stagger timer bails early when the message is not currently rendered (scrolled out of view / virtualized) — but it bailed **without advancing the count**, leaving the stored value stuck at a partial number. The render then caps the message at that stale value (`visibleSegmentCounts[key] ?? fullCount`), so everything after the last-revealed `Speaker:` boundary stays hidden until the chat is switched. Editing bypasses the segmented render, which is why it shows the full text. ## What changed `packages/client/src/components/chat/ConversationView.tsx` — in both stagger loops (parts and segments), when a reveal timer bails because the message isn't rendered, it now sets the visible count to the **full** count before clearing itself, instead of leaving it stuck partway. An interrupted reveal therefore shows the complete message when it re-renders, rather than staying truncated. No change to the segmentation regexes or the normal (uninterrupted) reveal animation. ## Test plan - [ ] In a multi-character Conversation, generate a long message with several `Speaker:` segments; while it is revealing, scroll it out of view and back, then confirm the whole message is shown (not cut off at a `Speaker:`/`word:` line). - [ ] Repeat in classic message style with a multi-line assistant message (multi-part reveal). - [ ] Confirm the normal staggered reveal still animates for a message that stays on screen. - [ ] Confirm editing a message still shows full content, and that switching chats and back shows full content. - [ ] `pnpm check` passes. (Passed in the authoring session; re-verify locally.) Fixes #4039. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Fixed interrupted assistant messages occasionally remaining partially hidden. * Messages now complete their reveal correctly when interrupted or unmounted during display. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:08:14 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#6214
No description provided.