Skip to content
TypeScript

fix(mobile): sent steer and queued messages are marked like desktop (#21417)

oliverddab437d00de
diff --git a/apps/mobile/src/features/threads/ThreadFeed.tsx b/apps/mobile/src/features/threads/ThreadFeed.tsx
index 73b8e5d8ae0..196518b0056 100644
--- a/apps/mobile/src/features/threads/ThreadFeed.tsx
+++ b/apps/mobile/src/features/threads/ThreadFeed.tsx
@@ -1297,30 +1297,28 @@ function renderFeedEntry(
</View>
<View className="mt-1 flex-row items-center justify-end gap-1 pr-0.5">
{intentBadge ? (
- <Pressable
- accessibilityRole="button"
+ <View
+ accessible
accessibilityLabel={intentBadge.accessibilityLabel}
- accessibilityHint="Explains this message's badge"
- hitSlop={8}
- onPress={() => Dialog.alert("Message history", intentBadge.explanation)}
- className={cn(
- "rounded-full border px-1.5 py-0.5",
- intentBadge.tone === "queued"
- ? "border-adaptive-amber-500-a25-400-a25 bg-adaptive-amber-500-a10-400-a10"
- : "border-adaptive-sky-500-a25-400-a25 bg-adaptive-sky-500-a10-400-a10",
- )}
+ className="flex-row items-center gap-1"
>
- <Text
- className={cn(
- "font-t3-medium text-2xs tracking-wide",
- intentBadge.tone === "queued"
- ? "text-adaptive-amber-700-300"
- : "text-adaptive-sky-700-300",
- )}
- >
+ {intentBadge.icon ? (
+ <SymbolView name={intentBadge.icon} size={12} tintColor={iconSubtleColor} />
+ ) : null}
+ <Text className="font-t3-medium text-xs text-foreground-secondary">
{intentBadge.label}
</Text>
- </Pressable>
+ </View>
+ ) : null}
+ {intentBadge ? (
+ <Text
+ accessible={false}
+ accessibilityElementsHidden
+ importantForAccessibility="no"
+ className="font-t3-medium text-xs text-foreground-secondary"
+ >
+ ·
+ </Text>
) : 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 c38ab3f66ca..2472a433517 100644
--- a/apps/mobile/src/features/threads/userMessageIntentBadge.test.ts
+++ b/apps/mobile/src/features/threads/userMessageIntentBadge.test.ts
@@ -10,30 +10,25 @@ describe("user message intent badge", () => {
it("explains the queued history without claiming delivery", () => {
expect(resolveUserMessageIntentBadge("queued_turn")).toEqual({
- label: "from queue",
+ 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",
+ icon: null,
});
});
it("explains the intent to steer without claiming delivery", () => {
expect(resolveUserMessageIntentBadge("steer")).toEqual({
- label: "steer",
+ label: "Steer",
accessibilityLabel: "Steered the active turn",
- explanation: "This message was intended to steer the agent while its turn was still running.",
- tone: "steer",
+ icon: "arrow.uturn.forward",
});
});
it("preserves the queued origin after promotion to steer", () => {
expect(resolveUserMessageIntentBadge("promoted_queued_to_steer")).toEqual({
- label: "queued → steer",
+ label: "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",
+ icon: "arrow.uturn.forward",
});
});
});
diff --git a/apps/mobile/src/features/threads/userMessageIntentBadge.ts b/apps/mobile/src/features/threads/userMessageIntentBadge.ts
index c234fb1734d..57000f1ea22 100644
--- a/apps/mobile/src/features/threads/userMessageIntentBadge.ts
+++ b/apps/mobile/src/features/threads/userMessageIntentBadge.ts
@@ -1,10 +1,11 @@
import type { OrchestrationV2UserMessageInputIntent } from "@t3tools/contracts";
+import type { AppSymbolName } from "../../components/ui/AppSymbol";
+
export interface UserMessageIntentBadgePresentation {
readonly label: string;
readonly accessibilityLabel: string;
- readonly explanation: string;
- readonly tone: "queued" | "steer";
+ readonly icon: AppSymbolName | null;
}
export function resolveUserMessageIntentBadge(
@@ -13,27 +14,21 @@ export function resolveUserMessageIntentBadge(
switch (intent) {
case "queued_turn":
return {
- label: "from queue",
+ 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",
+ icon: null,
};
case "steer":
return {
- label: "steer",
+ label: "Steer",
accessibilityLabel: "Steered the active turn",
- explanation:
- "This message was intended to steer the agent while its turn was still running.",
- tone: "steer",
+ icon: "arrow.uturn.forward",
};
case "promoted_queued_to_steer":
return {
- label: "queued → steer",
+ label: "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",
+ icon: "arrow.uturn.forward",
};
case "turn_start":
case undefined: