summaryrefslogtreecommitdiff
path: root/makima/frontend/src/routes/mesh.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'makima/frontend/src/routes/mesh.tsx')
-rw-r--r--makima/frontend/src/routes/mesh.tsx15
1 files changed, 15 insertions, 0 deletions
diff --git a/makima/frontend/src/routes/mesh.tsx b/makima/frontend/src/routes/mesh.tsx
index ed5a6d0..050381a 100644
--- a/makima/frontend/src/routes/mesh.tsx
+++ b/makima/frontend/src/routes/mesh.tsx
@@ -11,6 +11,7 @@ import type { TaskWithSubtasks, MeshChatContext, ContractSummary, ContractWithRe
import { startTask as startTaskApi, stopTask as stopTaskApi, getTaskOutput, listContracts, getContract, getDaemonDirectories, continueTask as continueTaskApi } from "../lib/api";
import { DirectoryInput } from "../components/mesh/DirectoryInput";
import { useAuth } from "../contexts/AuthContext";
+import { useSupervisorQuestions } from "../contexts/SupervisorQuestionsContext";
// View modes for the task detail page
type ViewMode = "split" | "task" | "output";
@@ -80,6 +81,18 @@ export default function MeshPage() {
const navigate = useNavigate();
const { isAuthenticated, isAuthConfigured, isLoading: authLoading } = useAuth();
const { tasks, loading, error, conflict, clearConflict, fetchTask, fetchTasks, editTask, removeTask, saveTask } = useTasks();
+ const { pendingQuestions, submitAnswer } = useSupervisorQuestions();
+
+ // Memoize pending question IDs for efficient lookup
+ const pendingQuestionIds = useMemo(
+ () => new Set(pendingQuestions.map(q => q.questionId)),
+ [pendingQuestions]
+ );
+
+ // Handler for answering supervisor questions
+ const handleAnswerQuestion = useCallback(async (questionId: string, response: string) => {
+ await submitAnswer(questionId, response);
+ }, [submitAnswer]);
// Redirect to login if not authenticated
useEffect(() => {
@@ -720,6 +733,8 @@ export default function MeshPage() {
}}
taskId={activeOutputTaskId}
onUserInput={handleUserInput}
+ pendingQuestionIds={pendingQuestionIds}
+ onAnswerQuestion={handleAnswerQuestion}
/>
</div>
)}