fix(chat): render avatar progress badge that was invisible#32747
Merged
Conversation
The progress badge reported visible:true via the debug API but never painted. Two issues compounded: 1. The empty-state ChatAvatar was never passed isProcessing, so its badge was never created (the transcript avatar passed it correctly). 2. BusyIndicator is a bare <span> (display:inline), so its inline width/height were ignored. Its only prior use was inside a flex parent (tool-call chip) which blockified it; reused inside the non-flex ProgressBadge wrapper it collapsed to 0x0 and never painted. Pass isProcessing to the empty-state avatar and make BusyIndicator inline-block so it lays out at its declared size regardless of parent. Co-Authored-By: vargas@vellum.ai <vargas@vellum.ai>
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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.
Fixes the avatar progress badge reporting
visible: truevia the debug API while never painting on screen, by passingisProcessingto the empty-state avatar and making the badge dot lay out at its real size. This restores the only visual signal that the assistant is processing once theuseProgressBadgeflag is on.Root cause analysis
(a) How did the code get into this state? The progress-badge feature (#32680) wired
isProcessinginto the transcriptChatAvatarbut not the empty-state one, so the empty-state badge was never created. Separately, it reusedBusyIndicatorfor the badge dot.BusyIndicatoris a bare<span>, which defaults todisplay: inline— andwidth/heightdo not apply to non-replaced inline elements. Its only prior caller wrapped it in aflexparent, where flex items are blockified, so the inline default never mattered. Inside the new non-flexProgressBadgewrapper the dot stayed inline and collapsed to 0×0, so even when the badge mounted it painted nothing.(b) What mistakes or decisions led to it? Two parallel render paths (empty-state vs transcript) were kept in sync by hand, so one was missed. And a primitive whose sizing silently depended on its parent's layout context was reused in a new context without that dependency.
(c) Were there warning signs we missed? The debug API deliberately reports the same
isProcessing && isProgressBadgeEnabled()gate the component uses, so it reportedvisible: true— which masked the fact that the DOM node had no size. There was no test asserting the dot actually has dimensions.(d) What can we do to prevent recurrence? A self-contained visual primitive shouldn't depend on its parent's
displayto size itself.BusyIndicatoris nowinline-blockso it lays out at its declared size anywhere, and a regression test asserts that.(e) AGENTS.md change? Not warranted. This is a narrow CSS-layout gotcha, not a project-wide rule; encoding "inline spans ignore width/height" as a durable rule would add noise that goes stale. The regression test is the right guard.
Test plan
bunx tsc --noEmitandbun run lintpass.busy-indicator.test.tsxasserts the dot is block-level and sized; existingthree-dot-indicatorandtool-call-chipsuites still pass (the chip already wraps the dot in a flex parent, so its rendering is unchanged).useProgressBadgeflag on: before, the badge span was absent / its dot measured 0×0 (display: inline); after, the dot measures ~6×6 (display: inline-block) and the pulsing badge is visible in the avatar's bottom-right.Link to Devin session: https://app.devin.ai/sessions/4ecf21400f764b59ad1eecabd1535956
Requested by: @dvargas92495