summaryrefslogtreecommitdiff
path: root/makima/frontend/src/components/SupervisorQuestionNotification.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'makima/frontend/src/components/SupervisorQuestionNotification.tsx')
-rw-r--r--makima/frontend/src/components/SupervisorQuestionNotification.tsx21
1 files changed, 17 insertions, 4 deletions
diff --git a/makima/frontend/src/components/SupervisorQuestionNotification.tsx b/makima/frontend/src/components/SupervisorQuestionNotification.tsx
index e62638c..9c56188 100644
--- a/makima/frontend/src/components/SupervisorQuestionNotification.tsx
+++ b/makima/frontend/src/components/SupervisorQuestionNotification.tsx
@@ -1,9 +1,13 @@
import { useNavigate } from "react-router";
import { useSupervisorQuestions } from "../contexts/SupervisorQuestionsContext";
+import { useUserSettings } from "../hooks/useUserSettings";
+import type { PendingQuestion } from "../lib/api";
export function SupervisorQuestionNotification() {
const navigate = useNavigate();
const { notificationQuestions, dismissNotification } = useSupervisorQuestions();
+ const { settings } = useUserSettings();
+ const documentMode = settings?.documentModeEnabled ?? false;
// Filter out contract_complete questions - they are displayed on the task page instead
const filteredQuestions = notificationQuestions.filter(
@@ -14,9 +18,18 @@ export function SupervisorQuestionNotification() {
return null;
}
- const handleGoToTask = (questionId: string, taskId: string) => {
- dismissNotification(questionId);
- navigate(`/exec/${taskId}`);
+ const handleGoToTask = (q: PendingQuestion) => {
+ dismissNotification(q.questionId);
+ // In document mode, route directly to the directive folder page with
+ // the task selected — that's the canonical surface where the question
+ // is answered (same comment/interrupt UI as the task stream). Fall
+ // back to /exec for non-doc-mode users or for tasks not tied to a
+ // directive.
+ if (documentMode && q.directiveId) {
+ navigate(`/directives/${q.directiveId}?task=${q.taskId}`);
+ } else {
+ navigate(`/exec/${q.taskId}`);
+ }
};
return (
@@ -35,7 +48,7 @@ export function SupervisorQuestionNotification() {
</span>
</div>
<button
- onClick={() => handleGoToTask(question.questionId, question.taskId)}
+ onClick={() => handleGoToTask(question)}
className="px-3 py-1 font-mono text-xs text-amber-400 border border-amber-500/30 hover:border-amber-400/50 hover:bg-amber-900/20 transition-colors uppercase"
>
View Task