Skip to content

Add errors view & improve look n feel of errors - #428

Merged
freekh merged 36 commits into
mainfrom
improved-validation-errors
May 20, 2026
Merged

Add errors view & improve look n feel of errors#428
freekh merged 36 commits into
mainfrom
improved-validation-errors

Conversation

@freekh

@freekh freekh commented May 17, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@changeset-bot

changeset-bot Bot commented May 17, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: e413534

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@freekh freekh changed the title Improved validation errors Add errors view & improve look n feel of errors May 17, 2026
@freekh
freekh changed the base branch from main to compare-patch-set May 17, 2026 20:41
freekh added 4 commits May 17, 2026 22:47
Bring in the richtext-without-remirror refactor and the
useGetDirectFileUploadSettings -> useValFieldContext change from main.
Reconcile the compare-view additions (compact/inline AnyField props,
hideUpload on ImageField, FieldSourceOverrideContext, useServerSourceAtPath,
useShallowSourceAtPath sourceOverride support) with main's refactors.

- ImageField: keep hideUpload wrapping, switch to useImageUpload hook.
- RichTextField: drop the old remirror Editor wiring, pass readonly to
  the new ProseMirror editor's readOnly.
- MediaPicker: take main's MediaPickerList extraction so the new editor
  picker components keep working.
- ValFieldProvider: route sourceOverride through useShallowSourceAtPath,
  useSourceAtPath, and useSchemaAtPathInternal alongside main's
  useValFieldContext() (drop the now-removed creatorSourcePath arg).
- Drop the obsolete remirror-based RichTextEditor.stories.tsx (deleted on main).
- Fix unused-var lint regressions left behind on the branch (compact /
  autoFocus props that the field components hadn't been wired to read).
- Fix getUnchangedSiblings: remove the early-return for record schemas
  so the existing test that asserts record siblings are returned passes.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a dedicated validation errors view and updates validation error styling to use the warning palette across the UI.

Changes:

  • Adds /val/errors routing and a new grouped validation errors page.
  • Replaces inline validation error rendering with shared FieldErrorList styling.
  • Adds warning theme tokens and updates validation borders/buttons to use warning colors.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/ui/tailwind.config.js Adds Tailwind warning color tokens.
packages/ui/spa/index.css Defines light/dark warning design variables.
packages/ui/spa/components/ValRouter.tsx Adds errors route state, navigation, and query handling.
packages/ui/spa/components/ValidationErrors.tsx Implements the dedicated validation errors page.
packages/ui/spa/components/ValidationErrors.stories.tsx Adds Storybook stories for the errors view.
packages/ui/spa/components/ToolsMenu.tsx Replaces inline validation error display with navigation button.
packages/ui/spa/components/SortableList.tsx Updates validation border color to warning palette.
packages/ui/spa/components/Module.tsx Updates module validation borders to warning palette.
packages/ui/spa/components/InlineField.tsx Updates inline field validation border color.
packages/ui/spa/components/FieldValidationError.tsx Delegates validation rendering to shared error list.
packages/ui/spa/components/FieldErrorList.tsx Adds shared validation error list component.
packages/ui/spa/components/Field.tsx Updates validation spacing and warning border color.
packages/ui/spa/components/designSystem/button.tsx Adds warning button variant.
packages/ui/spa/components/ContentArea.tsx Renders errors view in the main content area.
examples/next/app/blogs/[blog]/page.val.ts Changes blog title validation constraint.

Comment thread packages/ui/spa/components/ToolsMenu.tsx Outdated
Comment thread packages/ui/spa/components/FieldErrorList.tsx Outdated
Comment thread examples/next/app/blogs/[blog]/page.val.ts
Copilot AI and others added 10 commits May 18, 2026 18:31
…or msg space, path boundary check, creatorSourcePath, show_compare_view tool

Agent-Logs-Url: https://github.com/valbuild/val/sessions/85f76f7b-131c-4b2c-821c-3c850eaa722f

Co-authored-by: freekh <91758+freekh@users.noreply.github.com>
ValSyncEngine.isEditedByComponent keyed "is this source being
edited?" on the editor's path, so a freshly mounted field at a path
that was edited earlier in the session inherited the previous
instance's optimistic flag. Field components with local edit state
(StringField, RichTextField, FileField, ImageField, ArrayFields)
then refused to sync from source, leaving the input blank in the
compare view's AFTER side and on any re-mount of an edited field.

Rename patchIdsByCreatorPath/creatorSourcePath/pathOfCreator to
creatorId (typed as string), add useFieldCreatorId() that returns a
stable per-mount id, and thread it through useAddPatch /
useShallowSourceAtPath / useSourceAtPath in the affected field
components. Existing useEffect guards (clientSideOnly === false) now
read a truthful per-instance flag, so re-mounted instances populate
from source while actively-editing instances still keep their
in-flight state.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Base automatically changed from compare-patch-set to main May 18, 2026 20:35
freekh and others added 8 commits May 19, 2026 21:48
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
# Conflicts:
#	packages/ui/spa/components/AnyField.tsx
#	packages/ui/spa/components/ComparePatchSets.tsx
#	packages/ui/spa/components/Field.tsx
#	packages/ui/spa/components/FieldPatchAuthors.tsx
#	packages/ui/spa/components/FileGallery/FilePropertiesModal.tsx
#	packages/ui/spa/components/ValRouter.tsx
#	packages/ui/spa/components/fields/ArrayFields.tsx
#	packages/ui/spa/components/fields/ObjectFields.tsx
#	packages/ui/spa/components/fields/RecordFields.tsx
#	packages/ui/spa/components/fields/UnionField.tsx
# Conflicts:
#	packages/ui/spa/components/Field.tsx
#	packages/ui/spa/components/FieldValidationError.tsx
#	packages/ui/spa/components/ValRouter.tsx
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Rename sumValidationErrors -> fieldsWithErrors and label as "X fields"
to align with the destination page heading. The counter already
counted source paths (fields), not individual errors; the previous
"X errors" label was misleading.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The decorative amber rail was rendered as a direct <span> child of
<ul>, which violates HTML content model and can confuse assistive
tech. Lift the rail and positioning to a wrapper <div> so the <ul>
contains only <li> children. No visual change.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@freekh
freekh merged commit fef3fa1 into main May 20, 2026
6 checks passed
@freekh
freekh deleted the improved-validation-errors branch May 20, 2026 16:03
@freekh
freekh restored the improved-validation-errors branch June 25, 2026 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants