Files
t3code/apps/mobile/src/features/threads/userMessageIntentBadge.ts
T
Julius Marmingeandcodex b6577a862a fix(mobile): label queued message intent
Distinguish queued and steering user messages in the mobile thread feed, matching the web timeline.

Co-authored-by: codex <[email protected]>
2026-08-03 11:45:13 -04:00

36 lines
994 B
TypeScript

import type { OrchestrationV2UserMessageInputIntent } from "@t3tools/contracts";
export interface UserMessageIntentBadgePresentation {
readonly label: string;
readonly accessibilityLabel: string;
readonly tone: "queued" | "steer";
}
export function resolveUserMessageIntentBadge(
intent: OrchestrationV2UserMessageInputIntent | undefined,
): UserMessageIntentBadgePresentation | null {
switch (intent) {
case "queued_turn":
return {
label: "queued",
accessibilityLabel: "Queued behind the active turn",
tone: "queued",
};
case "steer":
return {
label: "steer",
accessibilityLabel: "Steered the active turn",
tone: "steer",
};
case "promoted_queued_to_steer":
return {
label: "queued → steer",
accessibilityLabel: "Originally queued, then promoted to steer the active turn",
tone: "steer",
};
case "turn_start":
case undefined:
return null;
}
}