Skip to content
TypeScript

fix(web,mobile): sent queued messages say "from queue", not "queued" (#19849)

shivame6bbfdb9ffe8
diff --git a/apps/mobile/src/features/threads/ThreadFeed.tsx b/apps/mobile/src/features/threads/ThreadFeed.tsx
index 5ab042dba12..d47466ecc38 100644
--- a/apps/mobile/src/features/threads/ThreadFeed.tsx
+++ b/apps/mobile/src/features/threads/ThreadFeed.tsx
@@ -1313,10 +1313,12 @@ function renderFeedEntry(
</View>
<View className="mt-1 flex-row items-center justify-end gap-1 pr-0.5">
{intentBadge ? (
- <View
- accessible
- accessibilityRole="text"
+ <Pressable
+ accessibilityRole="button"
accessibilityLabel={intentBadge.accessibilityLabel}
+ accessibilityHint="Explains this message's badge"
+ hitSlop={8}
+ onPress={() => Alert.alert("Message history", intentBadge.explanation)}
className={cn(
"rounded-full border px-1.5 py-0.5",
intentBadge.tone === "queued"
@@ -1334,7 +1336,7 @@ function renderFeedEntry(
>
{intentBadge.label}
</Text>
- </View>
+ </Pressable>
) : null}
<Text className="font-t3-medium text-xs tabular-nums text-foreground-secondary">
{entry.pendingMessage && !entry.acknowledged ? "Pending" : timestampLabel}
diff --git a/apps/mobile/src/features/threads/userMessageIntentBadge.test.ts b/apps/mobile/src/features/threads/userMessageIntentBadge.test.ts
index f29c4bba164..c38ab3f66ca 100644
--- a/apps/mobile/src/features/threads/userMessageIntentBadge.test.ts
+++ b/apps/mobile/src/features/threads/userMessageIntentBadge.test.ts
@@ -8,18 +8,21 @@ describe("user message intent badge", () => {
expect(resolveUserMessageIntentBadge("turn_start")).toBeNull();
});
- it("labels messages waiting behind the active turn", () => {
+ it("explains the queued history without claiming delivery", () => {
expect(resolveUserMessageIntentBadge("queued_turn")).toEqual({
- label: "queued",
- accessibilityLabel: "Queued behind the active turn",
+ label: "from queue",
+ accessibilityLabel: "Queued while the agent was busy",
+ explanation:
+ "This badge records that the message was queued. It stays visible after the message leaves the queue.",
tone: "queued",
});
});
- it("labels messages that steer the active turn", () => {
+ it("explains the intent to steer without claiming delivery", () => {
expect(resolveUserMessageIntentBadge("steer")).toEqual({
label: "steer",
accessibilityLabel: "Steered the active turn",
+ explanation: "This message was intended to steer the agent while its turn was still running.",
tone: "steer",
});
});
@@ -28,6 +31,8 @@ describe("user message intent badge", () => {
expect(resolveUserMessageIntentBadge("promoted_queued_to_steer")).toEqual({
label: "queued → steer",
accessibilityLabel: "Originally queued, then promoted to steer the active turn",
+ explanation:
+ "This message was originally queued, then promoted to steer the agent while its turn was still running.",
tone: "steer",
});
});
diff --git a/apps/mobile/src/features/threads/userMessageIntentBadge.ts b/apps/mobile/src/features/threads/userMessageIntentBadge.ts
index c72c1c342d8..c234fb1734d 100644
--- a/apps/mobile/src/features/threads/userMessageIntentBadge.ts
+++ b/apps/mobile/src/features/threads/userMessageIntentBadge.ts
@@ -3,6 +3,7 @@ import type { OrchestrationV2UserMessageInputIntent } from "@t3tools/contracts";
export interface UserMessageIntentBadgePresentation {
readonly label: string;
readonly accessibilityLabel: string;
+ readonly explanation: string;
readonly tone: "queued" | "steer";
}
@@ -12,20 +13,26 @@ export function resolveUserMessageIntentBadge(
switch (intent) {
case "queued_turn":
return {
- label: "queued",
- accessibilityLabel: "Queued behind the active turn",
+ label: "from queue",
+ accessibilityLabel: "Queued while the agent was busy",
+ explanation:
+ "This badge records that the message was queued. It stays visible after the message leaves the queue.",
tone: "queued",
};
case "steer":
return {
label: "steer",
accessibilityLabel: "Steered the active turn",
+ explanation:
+ "This message was intended to steer the agent while its turn was still running.",
tone: "steer",
};
case "promoted_queued_to_steer":
return {
label: "queued → steer",
accessibilityLabel: "Originally queued, then promoted to steer the active turn",
+ explanation:
+ "This message was originally queued, then promoted to steer the agent while its turn was still running.",
tone: "steer",
};
case "turn_start":
diff --git a/apps/web/src/components/chat/MessagesTimeline.tsx b/apps/web/src/components/chat/MessagesTimeline.tsx
index d490b980e5f..3ac4952e89c 100644
--- a/apps/web/src/components/chat/MessagesTimeline.tsx
+++ b/apps/web/src/components/chat/MessagesTimeline.tsx
@@ -2654,7 +2654,7 @@ function UserMessageIntentMarker({
const presentation =
intent === "queued_turn"
? {
- label: "Queued",
+ label: "From queue",
icon: null,
}
: intent === "promoted_queued_to_steer"
@@ -2682,7 +2682,7 @@ function UserMessageIntentMarker({
</TooltipTrigger>
<TooltipPopup side="top">
{intent === "queued_turn"
- ? "Queued behind the active 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"}