feat(#1984): style warning-level validation feedback differently from errors#2009
Open
MaryamMehd wants to merge 1 commit into
Open
feat(#1984): style warning-level validation feedback differently from errors#2009MaryamMehd wants to merge 1 commit into
MaryamMehd wants to merge 1 commit into
Conversation
Add useValidationFeedbackSeverity hook returning { feedback, feedbackSeverity }.
Warning-level targetConstraint violations and OperationOutcome issues now render
with amber helper text and no red border, while error-level feedback continues
to use the existing red styling. useValidationFeedback is kept as a deprecated
thin wrapper for backward compatibility.
Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #1984
useValidationFeedbackSeverityhook that returns both the feedback message and its severity ('error'|'warning'), sourced fromtargetConstraint.severityCodeandOperationOutcome.issue.severity.useValidationFeedbackhook into a deprecated wrapper around the new hook (backwards-compatible).*Item.tsxcomponents (~25 files) to consume the new hook and passfeedbackSeveritydown to their field components.*Field.tsxcomponents (~20 files) to acceptfeedbackSeverityand apply appropriate styling:useValidationFeedbackSeveritycovering error, warning, and parent-feedback scenarios.Test plan
targetConstraintextension usingseverityCode = 'warning'— helper text should appear in amber with no red border on the field.targetConstraintextension usingseverityCode = 'error'— behaviour is unchanged (red border + red helper text).npm run testinpackages/smart-forms-renderer.Made with Cursor