Repository navigation
fix(web): keep message text visible while markdown content suspends - #1757
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The user message bubble (
bg-accentpill) and the completed assistant response both wrapped the lazily loadedMarkdownContentinSuspense 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
DeltaBlockalready 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.tsxmountsMessageBubblewithMarkdownContentsuspended 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:
MarkdownContentis statically reachable viaHandoffFallbackBanner, 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
ThreadPreparingShelllayout classes and does not touch this path; this bug predates it.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.