TypeScript
fix(web,mobile): queued messages no longer say "From queue" once sent (#21474)
oliver5cda25e72b3b
diff --git a/apps/mobile/src/features/threads/ThreadFeed.tsx b/apps/mobile/src/features/threads/ThreadFeed.tsxindex 196518b0056..84fb8d84d6b 100644--- a/apps/mobile/src/features/threads/ThreadFeed.tsx+++ b/apps/mobile/src/features/threads/ThreadFeed.tsx@@ -1302,9 +1302,7 @@ function renderFeedEntry(accessibilityLabel={intentBadge.accessibilityLabel}className="flex-row items-center gap-1">- {intentBadge.icon ? (- <SymbolView name={intentBadge.icon} size={12} tintColor={iconSubtleColor} />- ) : null}+ <SymbolView name="arrow.uturn.forward" size={12} tintColor={iconSubtleColor} /><Text className="font-t3-medium text-xs text-foreground-secondary">{intentBadge.label}</Text>diff --git a/apps/mobile/src/features/threads/userMessageIntentBadge.test.ts b/apps/mobile/src/features/threads/userMessageIntentBadge.test.tsindex 2472a433517..f498838fbdc 100644--- a/apps/mobile/src/features/threads/userMessageIntentBadge.test.ts+++ b/apps/mobile/src/features/threads/userMessageIntentBadge.test.ts@@ -3,24 +3,16 @@ import { describe, expect, it } from "@effect/vitest";import { resolveUserMessageIntentBadge } from "./userMessageIntentBadge";describe("user message intent badge", () => {- it("does not label ordinary turn-start messages", () => {+ it("does not label turn-start or queued messages", () => {expect(resolveUserMessageIntentBadge(undefined)).toBeNull();expect(resolveUserMessageIntentBadge("turn_start")).toBeNull();- });-- it("explains the queued history without claiming delivery", () => {- expect(resolveUserMessageIntentBadge("queued_turn")).toEqual({- label: "From queue",- accessibilityLabel: "Queued while the agent was busy",- icon: null,- });+ expect(resolveUserMessageIntentBadge("queued_turn")).toBeNull();});it("explains the intent to steer without claiming delivery", () => {expect(resolveUserMessageIntentBadge("steer")).toEqual({label: "Steer",accessibilityLabel: "Steered the active turn",- icon: "arrow.uturn.forward",});});@@ -28,7 +20,6 @@ describe("user message intent badge", () => {expect(resolveUserMessageIntentBadge("promoted_queued_to_steer")).toEqual({label: "Steer",accessibilityLabel: "Originally queued, then promoted to steer the active turn",- icon: "arrow.uturn.forward",});});});diff --git a/apps/mobile/src/features/threads/userMessageIntentBadge.ts b/apps/mobile/src/features/threads/userMessageIntentBadge.tsindex 57000f1ea22..f6fc518f0c7 100644--- a/apps/mobile/src/features/threads/userMessageIntentBadge.ts+++ b/apps/mobile/src/features/threads/userMessageIntentBadge.ts@@ -1,35 +1,25 @@import type { OrchestrationV2UserMessageInputIntent } from "@t3tools/contracts";-import type { AppSymbolName } from "../../components/ui/AppSymbol";-export interface UserMessageIntentBadgePresentation {readonly label: string;readonly accessibilityLabel: string;- readonly icon: AppSymbolName | null;}export function resolveUserMessageIntentBadge(intent: OrchestrationV2UserMessageInputIntent | undefined,): UserMessageIntentBadgePresentation | null {switch (intent) {- case "queued_turn":- return {- label: "From queue",- accessibilityLabel: "Queued while the agent was busy",- icon: null,- };case "steer":return {label: "Steer",accessibilityLabel: "Steered the active turn",- icon: "arrow.uturn.forward",};case "promoted_queued_to_steer":return {label: "Steer",accessibilityLabel: "Originally queued, then promoted to steer the active turn",- icon: "arrow.uturn.forward",};+ case "queued_turn":case "turn_start":case undefined:return null;diff --git a/apps/web/src/components/chat/MessagesTimeline.tsx b/apps/web/src/components/chat/MessagesTimeline.tsxindex 66c04d58f96..9133244f52d 100644--- a/apps/web/src/components/chat/MessagesTimeline.tsx+++ b/apps/web/src/components/chat/MessagesTimeline.tsx@@ -2276,7 +2276,8 @@ function UserTimelineRow({ row }: { row: Extract<TimelineRow, { kind: "message")}</p>) : null}- {row.message.inputIntent && row.message.inputIntent !== "turn_start" ? (+ {row.message.inputIntent === "steer" ||+ row.message.inputIntent === "promoted_queued_to_steer" ? (<UserMessageIntentMarker intent={row.message.inputIntent} />) : null}<div className="relative max-w-[80%] rounded-2xl bg-message p-3 text-message-foreground">@@ -2447,24 +2448,8 @@ function UserTimelineRow({ row }: { row: Extract<TimelineRow, { kind: "message"function UserMessageIntentMarker({intent,}: {- readonly intent: NonNullable<ChatMessage["inputIntent"]>;+ readonly intent: "steer" | "promoted_queued_to_steer";}) {- const presentation =- intent === "queued_turn"- ? {- label: "From queue",- icon: null,- }- : intent === "promoted_queued_to_steer"- ? {- label: "Steer",- icon: Redo2Icon,- }- : {- label: "Steer",- icon: Redo2Icon,- };- const IntentIcon = presentation.icon;return (<Tooltip><TooltipTrigger@@ -2475,15 +2460,13 @@ function UserMessageIntentMarker({/>}>- {IntentIcon ? <IntentIcon aria-hidden="true" className="size-3" /> : null}- {presentation.label}+ <Redo2Icon aria-hidden="true" className="size-3" />+ Steer</TooltipTrigger><TooltipPopup side="top">- {intent === "queued_turn"- ? "Queued while the agent was busy"- : intent === "promoted_queued_to_steer"- ? "Originally queued, then promoted to steer the active turn"- : "Steered the active turn"}+ {intent === "promoted_queued_to_steer"+ ? "Originally queued, then promoted to steer the active turn"+ : "Steered the active turn"}</TooltipPopup></Tooltip>);