Written with AI
## Description
Publishing all locales can fail with a 404 for a document that exists
only on the active content branch. The publish request includes the
branch, but its preceding locale-validation requests omit it and
therefore resolve the document on main.
Pass the active branch from `PublishButton` through
`validateDocumentLocales` into both the active-locale and sibling-locale
validation requests. For example: `POST
/api/pages/<id>/validate?branch=pain&locale=en`. An undefined branch
remains omitted, preserving main/disabled-branching behavior.
This is a focused follow-up to the content branching stack, based on
[#19112](#19112). It depends
on that stack; the incremental diff contains only this fix and its
regressions.
## Changes
- Forward `branch` from the publish action to the locale-validation
helper.
- Serialize `branch` alongside locale parameters for both validation
requests.
- Cover collection/global endpoints, encoded branch names, sibling data
projection, default main behavior, and switching branches before
publishing.
## Test Plan
- Helper regression: **3 passed**. Against the original helper, both
branch cases fail and the main case passes.
- Chromium `PublishButton` regression: **1 passed**, exercising the
production caller/helper with mocked form/provider shells and requests.
Against the original caller, it fails because validation omits the
branch. It verifies all four validation requests and both publish
submissions across a branch switch.
- `pnpm lint` and `git diff --check` passed; changed files formatted
with `oxfmt`.
- The reported disposable-database reproduction is the reporter's
evidence; this PR's checks verify client request propagation. A full
Admin/database publish walkthrough was not rerun.
### Accessibility assessment
This change scopes validation requests to the active branch and does not
change markup, focus, keyboard controls, labels, or announcement
behavior. Reviewed WCAG 2.2 A/AA error identification and status-message
implications (3.3.1, 4.1.3): existing field-validation reporting is
preserved instead of failing early with a missing-document error.
Automated evidence is request-contract coverage, not an accessibility or
exact spoken-output assessment; full application and
assistive-technology verification are not claimed.
Written with AI
Description
Publishing all locales can fail with a 404 for a document that exists only on the active content branch. The publish request includes the branch, but its preceding locale-validation requests omit it and therefore resolve the document on main.
Pass the active branch from
PublishButtonthroughvalidateDocumentLocalesinto both the active-locale and sibling-locale validation requests. For example:POST /api/pages/<id>/validate?branch=pain&locale=en. An undefined branch remains omitted, preserving main/disabled-branching behavior.This is a focused follow-up to the content branching stack, based on #19112. It depends on that stack; the incremental diff contains only this fix and its regressions.
Changes
branchfrom the publish action to the locale-validation helper.branchalongside locale parameters for both validation requests.Test Plan
PublishButtonregression: 1 passed, exercising the production caller/helper with mocked form/provider shells and requests. Against the original caller, it fails because validation omits the branch. It verifies all four validation requests and both publish submissions across a branch switch.pnpm lintandgit diff --checkpassed; changed files formatted withoxfmt.Accessibility assessment
This change scopes validation requests to the active branch and does not change markup, focus, keyboard controls, labels, or announcement behavior. Reviewed WCAG 2.2 A/AA error identification and status-message implications (3.3.1, 4.1.3): existing field-validation reporting is preserved instead of failing early with a missing-document error. Automated evidence is request-contract coverage, not an accessibility or exact spoken-output assessment; full application and assistive-technology verification are not claimed.