feat(FN-3139): add planning comment input to interview modals and show in c
Merges FN-3139 planning comment infrastructure (comment inputs in mission/milestone-slice/planning modals, comment display in conversation history), FN-3119 Quick Chat FAB with slash-triggered skill menu and plugin integration, FN-3117 plugin dashboard views and chat session icons, and FN-3066 plugi Fusion-Task-Id: FN-3139
This commit is contained in:
@@ -627,20 +627,31 @@ interface InterviewQuestionFormProps {
|
||||
function InterviewQuestionForm({ question, progress, historyEntries, onSubmit }: InterviewQuestionFormProps) {
|
||||
const [response, setResponse] = useState<QuestionResponse>({});
|
||||
const [textValue, setTextValue] = useState("");
|
||||
const [commentValue, setCommentValue] = useState("");
|
||||
|
||||
const handleSubmit = useCallback(() => {
|
||||
let nextResponse: QuestionResponse;
|
||||
|
||||
if (question.type === "text") {
|
||||
onSubmit({ [question.id]: textValue });
|
||||
nextResponse = { [question.id]: textValue };
|
||||
} else if (question.type === "confirm") {
|
||||
onSubmit({ [question.id]: response[question.id] === true });
|
||||
nextResponse = { [question.id]: response[question.id] === true };
|
||||
} else {
|
||||
onSubmit(response);
|
||||
nextResponse = response;
|
||||
}
|
||||
}, [question, response, textValue, onSubmit]);
|
||||
|
||||
const trimmedComment = commentValue.trim();
|
||||
if (trimmedComment.length > 0) {
|
||||
nextResponse = { ...nextResponse, _comment: trimmedComment };
|
||||
}
|
||||
|
||||
onSubmit(nextResponse);
|
||||
}, [commentValue, question, response, textValue, onSubmit]);
|
||||
|
||||
useEffect(() => {
|
||||
setResponse({});
|
||||
setTextValue("");
|
||||
setCommentValue("");
|
||||
}, [question.id]);
|
||||
|
||||
const isValid = () => {
|
||||
@@ -774,6 +785,22 @@ function InterviewQuestionForm({ question, progress, historyEntries, onSubmit }:
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{question.type !== "text" && (
|
||||
<div className="planning-comment-section">
|
||||
<label className="planning-comment-label" htmlFor={`planning-comment-${question.id}`}>
|
||||
Additional comments (optional)
|
||||
</label>
|
||||
<textarea
|
||||
id={`planning-comment-${question.id}`}
|
||||
className="planning-textarea"
|
||||
rows={2}
|
||||
placeholder="Add any extra context or direction..."
|
||||
value={commentValue}
|
||||
onChange={(e) => setCommentValue(e.target.value)}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user