From 9c77498201c0f155a9563a8a742d48103bd18e60 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Mon, 23 Feb 2026 02:36:35 +0000 Subject: [PATCH] Improve type safety for handleChoiceSelect in SurveyWizard.tsx - Changed `handleChoiceSelect` argument type from `any` to `string | boolean` to match usage. - Fixed broken imports pointing to non-existent files (`../lib/engine` -> `../lib/SurveyEngine`, `../lib/types` -> `../types/schema`). - Updated `engine.next()` call to `engine.submitAnswer()` to match `SurveyEngine` API. - Verified changes with `tsc` and existing tests. Co-authored-by: alfieprojectsdev <11991855+alfieprojectsdev@users.noreply.github.com> --- field-logic/src/components/SurveyWizard.tsx | 8 ++++---- .../da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json diff --git a/field-logic/src/components/SurveyWizard.tsx b/field-logic/src/components/SurveyWizard.tsx index 4f7bc72..d4e03ac 100644 --- a/field-logic/src/components/SurveyWizard.tsx +++ b/field-logic/src/components/SurveyWizard.tsx @@ -1,6 +1,6 @@ import React, { useState, useEffect } from 'react'; -import { SurveyEngine } from '../lib/engine'; -import type { SurveyDefinition, SurveyNode } from '../lib/types'; +import { SurveyEngine } from '../lib/SurveyEngine'; +import type { SurveyDefinition, SurveyNode } from '../types/schema'; import '../styles/main.css'; interface Props { @@ -30,7 +30,7 @@ export const SurveyWizard: React.FC = ({ definition }) => { return; } - const nextNode = engine.next(inputValue); + const nextNode = engine.submitAnswer(inputValue); setCurrentNode(nextNode); setInputValue(null); // Reset input for next question }; @@ -39,7 +39,7 @@ export const SurveyWizard: React.FC = ({ definition }) => { setInputValue(e.target.value); }; - const handleChoiceSelect = (value: any) => { + const handleChoiceSelect = (value: string | boolean) => { setInputValue(value); }; diff --git a/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json b/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json new file mode 100644 index 0000000..27c2823 --- /dev/null +++ b/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json @@ -0,0 +1 @@ +{"version":"4.0.18","results":[[":field-logic/src/lib/engine.test.ts",{"duration":7.450498999999979,"failed":false}]]} \ No newline at end of file