Skip to content

Commit 7fc4476

Browse files
authored
Merge branch 'main' into claude/issue-1041-20260126-2214
2 parents 0bb90a5 + f977257 commit 7fc4476

4 files changed

Lines changed: 111 additions & 55 deletions

File tree

‎.github/dependabot.yml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"

‎client/src/components/DynamicJsonForm.tsx‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ interface DynamicJsonFormProps {
2828

2929
export interface DynamicJsonFormRef {
3030
validateJson: () => { isValid: boolean; error: string | null };
31+
hasJsonError: () => boolean;
3132
}
3233

3334
const isTypeSupported = (
@@ -129,6 +130,10 @@ const DynamicJsonForm = forwardRef<DynamicJsonFormRef, DynamicJsonFormProps>(
129130
// on every keystroke which would be inefficient and error-prone
130131
const timeoutRef = useRef<ReturnType<typeof setTimeout>>();
131132

133+
const hasJsonError = () => {
134+
return !!jsonError;
135+
};
136+
132137
// Debounce JSON parsing and parent updates to handle typing gracefully
133138
const debouncedUpdateParent = useCallback(
134139
(jsonString: string) => {
@@ -253,6 +258,7 @@ const DynamicJsonForm = forwardRef<DynamicJsonFormRef, DynamicJsonFormProps>(
253258

254259
useImperativeHandle(ref, () => ({
255260
validateJson,
261+
hasJsonError,
256262
}));
257263

258264
const renderFormFields = (

‎client/src/components/ToolsTab.tsx‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,11 @@ const ToolsTab = ({
102102
const { copied, setCopied } = useCopy();
103103

104104
// Function to check if any form has validation errors
105-
const checkValidationErrors = () => {
105+
const checkValidationErrors = (validateChildren: boolean = false) => {
106106
const errors = Object.values(formRefs.current).some(
107-
(ref) => ref && !ref.validateJson().isValid,
107+
(ref) =>
108+
ref &&
109+
(validateChildren ? !ref.validateJson().isValid : ref.hasJsonError()),
108110
);
109111
setHasValidationErrors(errors);
110112
return errors;
@@ -675,7 +677,7 @@ const ToolsTab = ({
675677
<Button
676678
onClick={async () => {
677679
// Validate JSON inputs before calling tool
678-
if (checkValidationErrors()) return;
680+
if (checkValidationErrors(true)) return;
679681

680682
try {
681683
setIsToolRunning(true);

0 commit comments

Comments
 (0)