From 205ab8a223ddf6591a3e8bfc9108506502977c11 Mon Sep 17 00:00:00 2001 From: soryu Date: Fri, 16 Jan 2026 12:23:49 +0000 Subject: Fixup: use default api.makima.jp URL and fix default branch detection Also add checkpointing/history --- .../src/components/history/ConversationView.tsx | 114 +++++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 makima/frontend/src/components/history/ConversationView.tsx (limited to 'makima/frontend/src/components/history/ConversationView.tsx') diff --git a/makima/frontend/src/components/history/ConversationView.tsx b/makima/frontend/src/components/history/ConversationView.tsx new file mode 100644 index 0000000..e3d1110 --- /dev/null +++ b/makima/frontend/src/components/history/ConversationView.tsx @@ -0,0 +1,114 @@ +import type { + TaskConversationResponse, + SupervisorConversationResponse, +} from "../../lib/api"; +import { ConversationMessage } from "./ConversationMessage"; + +interface ConversationViewProps { + conversation: TaskConversationResponse | SupervisorConversationResponse; +} + +// Type guard for task conversation +function isTaskConversation( + conv: TaskConversationResponse | SupervisorConversationResponse +): conv is TaskConversationResponse { + return "taskId" in conv; +} + +// Type guard for supervisor conversation +function isSupervisorConversation( + conv: TaskConversationResponse | SupervisorConversationResponse +): conv is SupervisorConversationResponse { + return "supervisorTaskId" in conv; +} + +export function ConversationView({ conversation }: ConversationViewProps) { + const messages = conversation.messages; + + return ( +
+ {/* Header info */} +
+
+
+ {isTaskConversation(conversation) ? ( +
+ {conversation.taskName} + + {conversation.status} + +
+ ) : isSupervisorConversation(conversation) ? ( +
+ Supervisor + + {conversation.phase} + +
+ ) : null} +
+ +
+ {messages.length} messages + {isTaskConversation(conversation) && conversation.totalTokens && ( + {conversation.totalTokens.toLocaleString()} tokens + )} + {isTaskConversation(conversation) && + conversation.totalCost !== null && + conversation.totalCost > 0 && ( + ${conversation.totalCost.toFixed(4)} + )} +
+
+ + {/* Spawned tasks (supervisor only) */} + {isSupervisorConversation(conversation) && conversation.spawnedTasks.length > 0 && ( +
+ Spawned: + {conversation.spawnedTasks.map((task) => ( + + {task.taskName} + + ))} +
+ )} +
+ + {/* Messages */} +
+ {messages.length === 0 ? ( +
+
No messages
+
+ ) : ( +
+ {messages.map((message, index) => ( + + ))} +
+ )} +
+
+ ); +} -- cgit v1.2.3