Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

feat(conversations): add inference status line and transcript states components

Steven Enamakel22d8d202f0b1
diff --git a/app/src/features/conversations/components/aui/InferenceStatusLine.tsx b/app/src/features/conversations/components/aui/InferenceStatusLine.tsx
new file mode 100644
index 0000000000..34d008eded
--- /dev/null
+++ b/app/src/features/conversations/components/aui/InferenceStatusLine.tsx
@@ -0,0 +1,67 @@
+import { useT } from '../../../../lib/i18n/I18nContext';
+import type { ToolTimelineEntry } from '../../../../store/chatRuntimeSlice';
+import { formatTimelineEntry } from '../../../../utils/toolTimelineFormatting';
+
+export interface InferenceStatusLineProps {
+ status: {
+ phase: 'thinking' | 'tool_use' | 'subagent' | string;
+ iteration: number;
+ activeTool?: string;
+ activeSubagent?: string;
+ };
+ /** The newest running non-subagent row, used to title the `tool_use` phase. */
+ activeToolEntry?: ToolTimelineEntry;
+ /** The running subagent row, used to title the `subagent` phase. */
+ activeSubagentEntry?: ToolTimelineEntry;
+}
+
+/**
+ * The one-line "what is the model doing right now" indicator.
+ *
+ * For the `tool_use` / `subagent` phases this only restates the active row the
+ * agentic-task-insights timeline already shows, so the caller suppresses it
+ * once that timeline is on screen and keeps it for the `thinking` phase (which
+ * has no timeline row yet) or when there is no timeline to fall back on.
+ */
+export function InferenceStatusLine({
+ status,
+ activeToolEntry,
+ activeSubagentEntry,
+}: InferenceStatusLineProps) {
+ const { t } = useT();
+ return (
+ <div className="flex items-center gap-2 px-1 py-1.5 text-xs text-content-muted">
+ <span className="inline-block w-2 h-2 rounded-full bg-primary-400 animate-pulse" />
+ <span>
+ {status.phase === 'thinking' &&
+ (status.iteration > 0
+ ? t('chat.thinkingIteration').replace('{n}', String(status.iteration))
+ : t('chat.thinkingDots'))}
+ {status.phase === 'tool_use' &&
+ `${
+ formatTimelineEntry(
+ activeToolEntry ?? {
+ id: 'active-tool',
+ name: status.activeTool ?? 'tool',
+ round: status.iteration,
+ seq: 0,
+ status: 'running',
+ }
+ ).title
+ }...`}
+ {status.phase === 'subagent' &&
+ `${
+ formatTimelineEntry(
+ activeSubagentEntry ?? {
+ id: 'active-subagent',
+ name: `subagent:${status.activeSubagent ?? ''}`,
+ round: status.iteration,
+ seq: 0,
+ status: 'running',
+ }
+ ).title
+ }...`}
+ </span>
+ </div>
+ );
+}
diff --git a/app/src/features/conversations/components/aui/TranscriptStates.tsx b/app/src/features/conversations/components/aui/TranscriptStates.tsx
new file mode 100644
index 0000000000..b9e0a4b016
--- /dev/null
+++ b/app/src/features/conversations/components/aui/TranscriptStates.tsx
@@ -0,0 +1,48 @@
+import { useT } from '../../../../lib/i18n/I18nContext';
+
+/** Placeholder bubbles shown while a thread's messages are being fetched. */
+export function TranscriptSkeleton() {
+ return (
+ <div className="mx-auto w-full max-w-[48.75rem] space-y-4 px-5 py-4">
+ {Array.from({ length: 4 }).map((_, i) => (
+ <div key={i} className={`flex ${i % 2 === 0 ? 'justify-start' : 'justify-end'}`}>
+ <div
+ className={`h-12 rounded-2xl animate-pulse bg-surface-subtle ${
+ i % 2 === 0 ? 'w-2/3' : 'w-1/2'
+ }`}
+ />
+ </div>
+ ))}
+ </div>
+ );
+}
+
+/** Terminal state for a thread whose message history failed to load. */
+export function TranscriptLoadError({ message }: { message: string }) {
+ const { t } = useT();
+ return (
+ <div className="flex-1 flex flex-col items-center justify-center h-full">
+ <svg
+ className="w-8 h-8 text-coral-500/70 mb-3"
+ fill="none"
+ stroke="currentColor"
+ viewBox="0 0 24 24">
+ <path
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ strokeWidth={1.5}
+ d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"
+ />
+ </svg>
+ <p className="text-sm text-content-faint mb-1">{t('chat.failedToLoadMessages')}</p>
+ <p className="text-xs text-content-secondary mb-3 text-center">{message}</p>
+ <button
+ type="button"
+ data-analytics-id="chat-messages-reload"
+ onClick={() => window.location.reload()}
+ className="text-xs text-primary-400 hover:text-primary-300 transition-colors">
+ {t('common.reload')}
+ </button>
+ </div>
+ );
+}