fix(ui): show shimmer and icon on initial Working... state for new agent runs

Eliminates two visual glitches when a new agent run starts:
1. The initial "Working..." was rendered as plain text without the shimmer
   animation or agent icon — now matches the proper working state styling.
2. A brief blank flash occurred when transcript chunks arrived but hadn't
   produced parseable parts yet — fixed by deriving waitingText from parts
   availability instead of the hasOutput flag.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
dotta 2026-04-08 07:52:06 -05:00
parent 28a28d1cb6
commit c5ccafbb80
2 changed files with 13 additions and 12 deletions

View file

@ -593,22 +593,17 @@ function normalizeLiveRuns(
function createLiveRunMessage(args: {
run: LiveRunForIssue;
transcript: readonly IssueChatTranscriptEntry[];
hasOutput: boolean;
}) {
const { run, transcript, hasOutput } = args;
const { run, transcript } = args;
const { parts, notices, segments } = buildAssistantPartsFromTranscript(transcript);
const waitingText =
run.status === "queued"
? "Queued..."
: hasOutput
: parts.length > 0
? ""
: "Working...";
const content = parts.length > 0
? parts
: waitingText
? [{ type: "text", text: waitingText } satisfies TextMessagePart]
: [];
const content = parts;
const message: ThreadAssistantMessage = {
id: `live-run:${run.id}`,
@ -712,7 +707,6 @@ export function buildIssueChatMessages(args: {
message: createLiveRunMessage({
run,
transcript: transcriptsByRunId?.get(run.id) ?? [],
hasOutput: hasOutputForRun?.(run.id) ?? false,
}),
});
}