Distinguish queued and steering user messages in the mobile thread feed, matching the web timeline. Co-authored-by: codex <[email protected]>
36 lines
994 B
TypeScript
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;
|
|
}
|
|
}
|