Skip to content

fix(web): keep message text visible while markdown content suspends - #1757

Merged
chuks-qua merged 1 commit into
mainfrom
fix/user-message-suspense-flash
Sep 24, 2026
Merged

chuks-qua merged 1 commit into
mainfrom
fix/user-message-suspense-flash

Conversation

@chuks-qua

@chuks-qua chuks-qua commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

What

The user message bubble (bg-accent pill) and the completed assistant response both wrapped the lazily loaded MarkdownContent in Suspense fallback={null}. While the boundary is suspended, the bubble chrome and timestamp render but the text paints nothing, leaving an empty pill in the transcript.

Both boundaries now fall back to the plain message text, matching the pattern DeltaBlock already uses for the same lazy import. Once the markdown module resolves, it replaces the fallback as before. No data, ordering, or hydration behavior changes.

Why

A user reported the first message rendering as an empty bubble for a few seconds after sending. The empty pill is the accent bubble painted while the lazy markdown content is suspended. Users should see their text immediately, not a blank bubble, however long the suspension lasts.

Evidence

apps/web/src/features/conversation/messages/__tests__/MessageBubble.suspense.test.tsx mounts MessageBubble with MarkdownContent suspended indefinitely and asserts the text stays visible in the user bubble and the assistant response. Against the unfixed code both tests fail (the bubble is empty); with the fix they pass.

A live before/after capture was attempted but the empty state does not reproduce in dev: MarkdownContent is statically reachable via HandoffFallbackBanner, so the lazy import resolves in a microtask and the suspension window is too short to photograph. The suspended-mock test is the baseline and the proof.

Review notes

Follow-up to #1751. That PR only changed ThreadPreparingShell layout classes and does not touch this path; this bug predates it.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@chuks-qua
chuks-qua merged commit d0ae474 into main Sep 24, 2026
6 checks passed
@chuks-qua
chuks-qua deleted the fix/user-message-suspense-flash branch September 24, 2026 10:49
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