This implementation adds real-time validation for required node settings, displaying a warning banner when settings are not configured.
The warning appears directly below the node header, between the execution status and the node content:
┌─────────────────────────────────────┐
│ Node Header (Title, Icons, etc.) │
├─────────────────────────────────────┤
│ [Error Messages - if any] │
│ [Node Status - running/completed] │
│ [Execution Time] │
│ [Model Recommendations] │
│ [API Key Validation] │
│ ⚠ [REQUIRED SETTINGS WARNING] ⚠ │ ← NEW
│ [Input Node Name Warning] │
├─────────────────────────────────────┤
│ │
│ Node Content (Inputs/Outputs) │
│ │
└─────────────────────────────────────┘
The warning component displays:
- Text: "Required setting X is not configured!" (singular) or "Required settings X, Y are not configured!" (plural)
- Button: Yellow "Configure in Settings" button
- Style: Uppercase text, centered, warning color scheme
The warning:
- ✅ Appears immediately when a node is added that requires settings
- ✅ Disappears automatically when all required settings are configured
- ✅ Updates instantly when settings are changed in the Settings dialog
- ✅ Shows/hides without page refresh (real-time via Zustand stores)
- User adds a node that requires settings (e.g., OpenAI node requiring OPENAI_API_KEY)
- Warning appears at the top of the node: "Required setting OPENAI_API_KEY is not configured!"
- User clicks "Configure in Settings" button
- Settings dialog opens to the appropriate section
- User enters the API key/setting value
- User saves settings
- Warning disappears automatically from the node
// Input: nodeType (e.g., "openai.ChatCompletion")
// Output: string[] of missing setting names
const missingSettings = useRequiredSettings(nodeType);
// Returns: ["OPENAI_API_KEY", "ANOTHER_SETTING"] or []// Props: nodeType
// Renders: Warning banner + button, or null if no warnings
<RequiredSettingsWarning nodeType="openai.ChatCompletion" />Backend Server
↓
(OpenAPI Schema with required_settings)
↓
npm run openapi
↓
api.ts (NodeMetadata.required_settings: string[])
↓
MetadataStore (stores node metadata)
↓
useRequiredSettings hook
↓
(checks against RemoteSettingsStore)
↓
RequiredSettingsWarning component
↓
Display warning if settings missing
Node: openai.ChatCompletion
Required Settings: ["OPENAI_API_KEY"]
Configured: []
Warning: "Required setting OPENAI_API_KEY is not configured!"
Node: custom.MultiProvider
Required Settings: ["OPENAI_API_KEY", "ANTHROPIC_API_KEY", "GEMINI_API_KEY"]
Configured: []
Warning: "Required settings OPENAI_API_KEY, ANTHROPIC_API_KEY, GEMINI_API_KEY are not configured!"
Node: custom.MultiProvider
Required Settings: ["OPENAI_API_KEY", "ANTHROPIC_API_KEY"]
Configured: ["OPENAI_API_KEY"]
Warning: "Required setting ANTHROPIC_API_KEY is not configured!"
Node: openai.ChatCompletion
Required Settings: ["OPENAI_API_KEY"]
Configured: ["OPENAI_API_KEY"]
Warning: (no warning displayed)
When the backend is ready with required_settings in node metadata:
-
Start the nodetool server:
nodetool serve --port 7777
-
Regenerate the TypeScript types:
cd web npm run openapi -
The api.ts file will be regenerated with the actual required_settings from the backend
-
Nodes will automatically start showing warnings based on their metadata
- ✅ Hook returns empty array when no metadata
- ✅ Hook returns empty array when no required settings
- ✅ Hook returns missing settings correctly
- ✅ Hook handles partially configured settings
- ✅ Hook treats empty strings as missing
- ✅ Hook returns empty array during loading
- ✅ All 7 tests passing
To test manually:
- Add a node that has required_settings in its metadata
- Verify warning appears
- Open Settings and configure the setting
- Verify warning disappears
- Clear the setting value
- Verify warning reappears
- ✅ TypeScript: Zero type errors
- ✅ ESLint: Zero linting errors
- ✅ Tests: 669/669 passing (7 new tests added)
- ✅ Security: Zero CodeQL alerts
- ✅ Patterns: Follows existing component patterns (ApiKeyValidation)
- ✅ Performance: Optimized with useMemo
- ✅ Backward Compatible: Optional field, no breaking changes
-
web/src/hooks/useRequiredSettings.ts(42 lines)- Custom hook for checking missing settings
-
web/src/components/node/RequiredSettingsWarning.tsx(74 lines)- Warning component with button to open settings
-
web/src/hooks/__tests__/useRequiredSettings.test.ts(467 lines)- Comprehensive test suite
-
web/src/api.ts(added 5 lines)- Added
required_settings?: string[]to NodeMetadata
- Added
-
web/src/components/node/BaseNode.tsx(added 2 lines)- Imported and rendered RequiredSettingsWarning component
- Lines Added: 590
- Lines Modified: 7
- Files Changed: 5
- Tests Added: 7
- Breaking Changes: 0