Skip to content

Style warning-level validation feedback differently from errors #1984

Description

@leoniedickson

Background

targetConstraint severity is now correctly stored on OperationOutcome issues and responseHasErrors already distinguishes error/fatal from warning. The severity is available — but the UI doesn't use it. All validation feedback currently renders with the same error styling regardless of whether the underlying issue is an error or a warning.

Problem

A targetConstraint with severityCode: 'warning' surfaces feedback identically to one with severityCode: 'error'. Users have no visual cue that some issues are advisory rather than blocking.

Proposed fix

Add a new useValidationFeedbackSeverity(linkId) hook returning { feedback: string; feedbackSeverity: 'error' | 'warning' } | null. Field components that need severity-aware styling (~19 *Field.tsx files) are updated to call this instead.

useValidationFeedback is kept as a thin wrapper around useValidationFeedbackSeverity (no duplicated store logic) and marked @deprecated for removal in the next major release.

Notes

  • Cosmetic only — does not affect save-gate behaviour
  • No breaking change

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions