Written with AI
## Description
When a content branch merge fails, show which document and field need
fixing alongside the existing error message:
`Unique Doc / #4 / slug: Value must be unique`
Preserve collection/global, document ID, optional locale, and field-path
context through both streamed and HTTP merge failures. Keep the error
visible in the merge dialog so the user can close it, correct the
document, and retry.
Targets the branch behind #19284. Shared Zod validation, validation
acceptance rules, and Lexical/MCP tests are unchanged. Schema-message
localization and configured field-label resolution are deferred to
[PYLD-5204](https://linear.app/figma/issue/PYLD-5204/localize-shared-schema-validation-errors-using-the-request-language)
and draft #19486; they do not block this PR.
## Changes
- Retain structured write-time field errors and the available source
document context, avoiding incorrect attribution of nested-operation
errors.
- Render the configured collection/global label, document ID, optional
locale, and existing field path before the original error message. No
field-label resolution is added.
- Keep validation and write failures in the dialog, without reporting a
completed or empty merge. Unexpected private errors remain generic in
client responses.
- Exercise real uniqueness failures through integration tests and a
browser regression. Consolidate mocked endpoint error cases into
branching integration suites that run across the database matrix; retain
the focused stream-cancellation unit test. Remove the custom
editorial-validation fixture.
Uniqueness conflicts are still detected during the actual write; adding
preview-time uniqueness checks is separate work.
## Test Plan
All checks below ran without #19486:
- Merge endpoint cancellation unit test: 1 passed. The eight added
mocked endpoint cases are consolidated into integration coverage.
- Chromium merge-dialog component tests: 12 passed, including the exact
`Unique Doc / #4 / slug: Value must be unique` presentation.
- Merge write-error integration suite: 10 passed per adapter on MongoDB,
PostgreSQL, and SQLite (30 total), covering real uniqueness failures,
source/change IDs, locale preservation and request-language messages,
unexpected private errors with debug enabled, and nested-operation
attribution for HTTP and streaming responses. The suite uses `db: all`
for the CI adapter matrix.
- Branching REST integration suite: 13 passed per adapter on MongoDB,
PostgreSQL, and SQLite (39 total), including public access-error
messages and status codes.
- SQLite/Chromium e2e: the real uniqueness conflict displays
document/field context, remains dismissible, and leaves the pending
change available (1 passed). Used the repository’s `--no-turbo` Webpack
option because Turbopack cannot resolve dependencies linked outside this
isolated worktree.
- Core and UI TypeScript checks passed after building project references
in the original implementation. Consolidation follow-up: targeted lint,
formatting, and `git diff --check` passed. The broader
`test/branching/tsconfig.json` typecheck does not pass; checking the
unmodified PR head confirmed existing generated-type,
adapter-declaration, and missing-import errors, with the added fixtures
encountering the same generated-type constraint.
- Diff audit: 11 files; no changes to the shared entity-input-schema
validator, Lexical, MCP, branch preview validation, or branching test
config/shared fixtures.
- Local checks used Node 22.23.1; the repository declares Node
>=24.22.1. Other database variants were not rerun locally.
### Accessibility assessment
Assessed WCAG 2.2 A/AA error identification (3.3.1), correction guidance
(3.3.3), and status messages (4.1.3). Chromium component and
real-browser assertions verify document/field identification, the error
alert, correction guidance, and dismissal. The existing keyboard
controls and focus handling are unchanged. Exact screen-reader
announcements and manual visual/assistive-technology verification remain
unverified; no conformance claim.
Written with AI
Description
Schema validation currently exposes schema-library messages such as
Invalid input: expected number, received stringwithout configured field labels. Return translated Payload validation messages and configured labels while preserving the existing machine-readable error paths.Deferred follow-up tracked in PYLD-5204. Keep this PR in draft for later review. It is outside the content branching release scope and does not block that feature or #19380.
Extracted from #19380 as an independent improvement targeting
main. This applies to shared collection/global schema validation and requires no content branching configuration. Branch merge behavior and error presentation remain in #19380.Changes
getTranslation, including array/block row numbers and nested field labels.For example,
data.numberFieldnow reportsPlease enter a valid number.with its configuredNumber Fieldlabel. Validation acceptance rules and error paths are unchanged. Error wording is covered by the wording exception in the repository versioning policy.Test Plan
git diff --checkpassed.Accessibility assessment
Assessed WCAG 2.2 A/AA error identification (3.3.1) and error suggestion (3.3.3). Automated evidence verifies translated descriptions, configured field identification, row context, and correction wording at the validator/API level. This extraction changes no markup, focus, keyboard handling, or live-region behavior. Rendered error association, visual presentation, and screen-reader announcements remain unverified; no browser/axe or assistive-technology conformance is claimed.