diff --git a/packages/client/ui-conversation/src/client/chat/MessageItem.tsx b/packages/client/ui-conversation/src/client/chat/MessageItem.tsx index eab509286f..e4730924fd 100644 --- a/packages/client/ui-conversation/src/client/chat/MessageItem.tsx +++ b/packages/client/ui-conversation/src/client/chat/MessageItem.tsx @@ -142,41 +142,52 @@ function projectUserText(text: string): ReactNode { return <>{parts} } +/** Right-aligned bubble shared by user and steering rows (steering has no actions). */ +function UserStyleBubble({ + content, actions, t, +}: { + content: readonly unknown[] + /** Optional IconActions (or similar) below the bubble; receives the joined text. */ + actions?: (text: string) => ReactNode + t: ChatViewSlotProps['t'] +}): ReactNode { + const { text, rest } = contentText(content) + const truncated = (total: number): string => t('json.truncated', { total }) + return ( +
+
+ {projectUserText(text)} + {rest.map((block, i) => )} +
+ {actions?.(text)} +
+ ) +} + export const MessageItem = memo(function MessageItem({ node, retryActive = false, onFork, t, }: MessageItemProps) { const truncated = (total: number): string => t('json.truncated', { total }) switch (node.kind) { - case 'user': { - const { text, rest } = contentText(node.content) + case 'user': return ( -
-
- {projectUserText(text)} - {rest.map((block, i) => )} -
- { onFork(node.seq) }} - className={css.actions} - t={t} - /> -
+ ( + { onFork(node.seq) }} + className={css.actions} + t={t} + /> + )} + /> ) - } - case 'steering': { - const { text, rest } = contentText(node.content) - return ( -
-
- {projectUserText(text)} - {rest.map((block, i) => )} -
-
- ) - } + case 'steering': + return case 'context': return (