Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions apps/mobile/src/features/threads/ThreadFeed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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}
Expand Down
13 changes: 9 additions & 4 deletions apps/mobile/src/features/threads/userMessageIntentBadge.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
});
});
Expand All @@ -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",
});
});
Expand Down
11 changes: 9 additions & 2 deletions apps/mobile/src/features/threads/userMessageIntentBadge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}

Expand All @@ -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",
Comment thread
shivamhwp marked this conversation as resolved.
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":
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/components/chat/MessagesTimeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2654,7 +2654,7 @@ function UserMessageIntentMarker({
const presentation =
intent === "queued_turn"
? {
label: "Queued",
label: "From queue",
icon: null,
}
: intent === "promoted_queued_to_steer"
Expand Down Expand Up @@ -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"}
Expand Down
Loading