-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Issue 2146: Block Validation UI Feedback #2210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
@Swap-nagras is attempting to deploy a commit to the Typebot Team on Vercel. A member of the Team first needs to authorize it. |
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
This PR implements in-builder validation for misconfigured blocks, surfacing schema errors directly in the graph and closing issue #2146.
Key changes
Block validation helper (
blockValidation.ts
):blockSchemaV6
Zod schema to validate every block’s configuration.BlockValidationError[]
with friendly messages (e.g. “This field is required”, “Must be at least X characters”).useBlockValidation
hook (useBlockValidation.ts
):validateBlock
in auseMemo
to return{ isValid, errors, hasErrors }
for any given block.UI integration (
BlockNode.tsx
):useBlockValidation(block)
on each node.hasErrors
, applies a red outline and renders a ChakraTooltip
listing each validation error on hover.Motivation
Without in-builder feedback, misconfigured blocks can slip through to runtime and cause unexpected failures. This change highlights invalid blocks immediately in the editor, making it far easier for creators to catch and fix configuration issues early
Impact
Closes #2146.