Skip to content

Commit ddab437

Browse files
authored
fix(mobile): sent steer and queued messages are marked like desktop (#21417)
1 parent 49b0f96 commit ddab437

3 files changed

Lines changed: 33 additions & 45 deletions

File tree

‎apps/mobile/src/features/threads/ThreadFeed.tsx‎

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1297,30 +1297,28 @@ function renderFeedEntry(
12971297
</View>
12981298
<View className="mt-1 flex-row items-center justify-end gap-1 pr-0.5">
12991299
{intentBadge ? (
1300-
<Pressable
1301-
accessibilityRole="button"
1300+
<View
1301+
accessible
13021302
accessibilityLabel={intentBadge.accessibilityLabel}
1303-
accessibilityHint="Explains this message's badge"
1304-
hitSlop={8}
1305-
onPress={() => Dialog.alert("Message history", intentBadge.explanation)}
1306-
className={cn(
1307-
"rounded-full border px-1.5 py-0.5",
1308-
intentBadge.tone === "queued"
1309-
? "border-adaptive-amber-500-a25-400-a25 bg-adaptive-amber-500-a10-400-a10"
1310-
: "border-adaptive-sky-500-a25-400-a25 bg-adaptive-sky-500-a10-400-a10",
1311-
)}
1303+
className="flex-row items-center gap-1"
13121304
>
1313-
<Text
1314-
className={cn(
1315-
"font-t3-medium text-2xs tracking-wide",
1316-
intentBadge.tone === "queued"
1317-
? "text-adaptive-amber-700-300"
1318-
: "text-adaptive-sky-700-300",
1319-
)}
1320-
>
1305+
{intentBadge.icon ? (
1306+
<SymbolView name={intentBadge.icon} size={12} tintColor={iconSubtleColor} />
1307+
) : null}
1308+
<Text className="font-t3-medium text-xs text-foreground-secondary">
13211309
{intentBadge.label}
13221310
</Text>
1323-
</Pressable>
1311+
</View>
1312+
) : null}
1313+
{intentBadge ? (
1314+
<Text
1315+
accessible={false}
1316+
accessibilityElementsHidden
1317+
importantForAccessibility="no"
1318+
className="font-t3-medium text-xs text-foreground-secondary"
1319+
>
1320+
·
1321+
</Text>
13241322
) : null}
13251323
<Text className="font-t3-medium text-xs tabular-nums text-foreground-secondary">
13261324
{entry.pendingMessage && !entry.acknowledged ? "Pending" : timestampLabel}

‎apps/mobile/src/features/threads/userMessageIntentBadge.test.ts‎

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,25 @@ describe("user message intent badge", () => {
1010

1111
it("explains the queued history without claiming delivery", () => {
1212
expect(resolveUserMessageIntentBadge("queued_turn")).toEqual({
13-
label: "from queue",
13+
label: "From queue",
1414
accessibilityLabel: "Queued while the agent was busy",
15-
explanation:
16-
"This badge records that the message was queued. It stays visible after the message leaves the queue.",
17-
tone: "queued",
15+
icon: null,
1816
});
1917
});
2018

2119
it("explains the intent to steer without claiming delivery", () => {
2220
expect(resolveUserMessageIntentBadge("steer")).toEqual({
23-
label: "steer",
21+
label: "Steer",
2422
accessibilityLabel: "Steered the active turn",
25-
explanation: "This message was intended to steer the agent while its turn was still running.",
26-
tone: "steer",
23+
icon: "arrow.uturn.forward",
2724
});
2825
});
2926

3027
it("preserves the queued origin after promotion to steer", () => {
3128
expect(resolveUserMessageIntentBadge("promoted_queued_to_steer")).toEqual({
32-
label: "queued → steer",
29+
label: "Steer",
3330
accessibilityLabel: "Originally queued, then promoted to steer the active turn",
34-
explanation:
35-
"This message was originally queued, then promoted to steer the agent while its turn was still running.",
36-
tone: "steer",
31+
icon: "arrow.uturn.forward",
3732
});
3833
});
3934
});

‎apps/mobile/src/features/threads/userMessageIntentBadge.ts‎

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import type { OrchestrationV2UserMessageInputIntent } from "@t3tools/contracts";
22

3+
import type { AppSymbolName } from "../../components/ui/AppSymbol";
4+
35
export interface UserMessageIntentBadgePresentation {
46
readonly label: string;
57
readonly accessibilityLabel: string;
6-
readonly explanation: string;
7-
readonly tone: "queued" | "steer";
8+
readonly icon: AppSymbolName | null;
89
}
910

1011
export function resolveUserMessageIntentBadge(
@@ -13,27 +14,21 @@ export function resolveUserMessageIntentBadge(
1314
switch (intent) {
1415
case "queued_turn":
1516
return {
16-
label: "from queue",
17+
label: "From queue",
1718
accessibilityLabel: "Queued while the agent was busy",
18-
explanation:
19-
"This badge records that the message was queued. It stays visible after the message leaves the queue.",
20-
tone: "queued",
19+
icon: null,
2120
};
2221
case "steer":
2322
return {
24-
label: "steer",
23+
label: "Steer",
2524
accessibilityLabel: "Steered the active turn",
26-
explanation:
27-
"This message was intended to steer the agent while its turn was still running.",
28-
tone: "steer",
25+
icon: "arrow.uturn.forward",
2926
};
3027
case "promoted_queued_to_steer":
3128
return {
32-
label: "queued → steer",
29+
label: "Steer",
3330
accessibilityLabel: "Originally queued, then promoted to steer the active turn",
34-
explanation:
35-
"This message was originally queued, then promoted to steer the agent while its turn was still running.",
36-
tone: "steer",
31+
icon: "arrow.uturn.forward",
3732
};
3833
case "turn_start":
3934
case undefined:

0 commit comments

Comments
 (0)