Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions tests/webview/live-stream-response-rendering.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,17 @@ test("the live response card owns the AI loading text until its response finishe
);
});

test("the live loading text follows the response card", () => {
const responseSectionIndex = messageSource.lastIndexOf(
'data-assistant-section="response"',
);
const loadingTextIndex = messageSource.indexOf(
'data-assistant-section="live-loading-text"',
);
assert.ok(responseSectionIndex >= 0, "the assistant response section must render");
assert.ok(loadingTextIndex > responseSectionIndex, "the loading text must render below the latest response card");
});

test("active assistant cards do not use intrinsic virtualization height", () => {
assert.match(
messageSource,
Expand Down
31 changes: 11 additions & 20 deletions webview/shared/src/chat/MessageComponents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12664,26 +12664,6 @@ const hasVisibleResponseSectionContent =
);
})}

{/*
* Keep the live status text attached to the assistant card.
* The ticker used to be mounted only by the session-switch
* spinner, so normal SSE responses could lose the loading
* text while their activity rows were still streaming. It
* must not be rendered in the composer: mounting it here
* preserves the card's ownership and prevents a response
* rerender from moving the scroll target to the user prompt.
*/}
{shouldShowLiveLoadingText ? (
<div
data-assistant-section="live-loading-text"
className="px-1 py-1"
role="status"
aria-live="polite"
>
<AIStatusTicker />
</div>
) : null}

</section>
)}

Expand Down Expand Up @@ -12852,6 +12832,17 @@ const hasVisibleResponseSectionContent =
/>
)}

{shouldShowLiveLoadingText ? (
<div
data-assistant-section="live-loading-text"
className="px-1 py-1"
role="status"
aria-live="polite"
>
<AIStatusTicker />
</div>
) : null}

{/* Block-level pill for the last card in a multi-card block.
When expanded: shows a single Collapse link at the very end to fold the whole block. */}
{isLastInBlock && blockSize > 1 && !isBlockStreaming && isBlockExpanded && (
Expand Down
Loading