Skip to content

feat(pages): adopt versions.drafts.localizeStatus on Pages and AppCards, so a client can read per-locale publish state - #765

Merged
sydevs-bot merged 16 commits into
mainfrom
claude/feat-718-localize-status
Sep 12, 2026
Merged

sydevs-bot merged 16 commits into
mainfrom
claude/feat-718-localize-status

Conversation

@sydevs-bot

@sydevs-bot sydevs-bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • pages and app-cards now store _status per locale, so one read answers which languages a document is published in.
  • GET /api/pages?locale=all&select[_status]=true returns { "en": "published", "de": "draft" } — the hreflang contract WeMeditateWeb#81 is blocked on.
  • A cross-locale read is not a publish gate: it carries every locale's value, unpublished ones included. Reviewed and accepted — read access to content is not sensitive here, only write, edit and delete (17f9df0).
  • No open blockers. An untranslated locale stops serving the day this deploys, and review settled that as intended: an unpublished locale should 404, and an English-only page must not fall back to German (30ed58b) — see Notes 1.

Changes

  • src/collections/{Pages,AppCards} — versions.drafts.localizeStatus: true, object form (drafts: true sanitises the flag back to false).
  • src/fields/publicUrlFields.ts — the publish gate reads a per-locale map as well as a string. Without this, webUrl/appUrl read null on every page.
  • src/plugins/openapi/clientReadParametersDocs.ts — locale joins the injected client read parameters, documenting all and the status map on every collection list and findByID GET.
  • docs/rules/api-clients.md — the contract a consumer reads, including what locale=all does and does not gate, and that an unpublished locale is meant to serve nothing.

Preview

  • Pages admin, per-locale Publish menu — preview pending

Migration

  • New migration: src/migrations/20260911_235823_pages_app_cards_localize_status.ts
  • Impact: _status moves from pages / app_cards into their _locales tables, and version__status likewise for both _v twins. Indexes move onto (_status, _locale). Data is preserved by a hand-written backfill, for every locale row that exists — see Notes 1 for the locales that have none.
  • Reversible: yes. down() restores the base column and backfills it from the locale rows (published in any locale ⇒ published). Run on a scratch database, not just written.

Test results

  • Lean gate on 30ed58b: ✓ pnpm lint, typecheck, typecheck:tests, test:unit (1812 unit tests). That commit changes a doc rule and a spec comment only, so no integration file was re-run.
  • Lean gate on 17f9df0: ✓ pnpm lint, typecheck, typecheck:tests, test:unit (1812 unit tests)
  • Targeted specs on 17f9df0: pages-localize-status (11 cases), pages and role-based-access (86) — 97 integration cases green
  • Earlier heads: 237 passed across 10 integration files on 08bd6c1 — app-status-readiness, app-cards-for-audience, api, collections-smoke, available-locales, client-query-validation, atlas-seo among them
  • Build: N/A (Railway builds the preview)

Manual verification

  1. In the admin, open a published page and use Publish in <Locale> / Unpublish in <Locale>. Confirm unpublishing German leaves English published.
  2. curl "$URL/api/pages?locale=all&select[_status]=true" with a wemeditate-web-client key — confirm the map, and that a locale you just unpublished reads draft.
  3. With the same key, curl "$URL/api/pages?locale=de&select[title]=true" for a page whose German you just unpublished — confirm it returns nothing. That single-locale read is the publish gate; ?locale=all is not.
  4. Confirm live preview still shows drafts for an unpublished locale.
  5. Confirm the same for app-cards in the WeMeditate App group.

Notes for reviewer

1. Settled: an untranslated locale stops serving on deploy, and that is intended (30ed58b). The backfill copies each document's old _status into every locale row that exists. A locale nobody has translated has no row, so nothing lands there, and the published-only clause is SQL — it matches rows, not the English fallback. Measured on this branch: an English-only published page returns 0 docs to a wemeditate-web-client at ?locale=de, and the page at ?locale=en. WeMeditateWeb's getPageBySlug (server/cms-client.ts:316) reads at the visitor's locale and 404s on an empty result, so a German visitor to an English-only page gets a 404 the day this deploys. This fires on existing data, not on a deliberate unpublish.

Ardnived's review settled it: that 404 is correct, and an English-only page should not fall back to German. So no code changed, and none of the three options I had raised ships — no 19-row backfill, no wait on WeMeditateWeb#81, no accessConfigs.ts change that would let an absent locale fall back. What changed is the framing: docs/rules/api-clients.md and the pages-localize-status.int.spec.ts comment stated it as an open hazard a consumer must adapt to, and now state the decision, so the next reader meets it instead of re-plugging the gap. The assertions are untouched — a never-translated locale is absent from the map and serves nobody, measured rather than argued.

2. The migration is not purely drizzle-generated. src/migrations/AGENTS.md says to default against augmenting a generated migration and to surface a backfill rather than decide it. As generated, the locale column is added DEFAULT 'draft' and the base column is then dropped, so every already-published page lands draft in all 19 locales — and pages is read published-only by wemeditate-web-client, so that deploy takes the live We Meditate site dark until an editor re-publishes every page by hand. #731 accepted exactly this for the translations globals, where the blast radius was one config gate; it is not transferable here. The backfill sits between the two generated DDL blocks (the base column must still exist) and copies its value to every locale. Tell me to strip it if you disagree.

3. Settled: the cross-locale redaction is gone (17f9df0). An earlier revision narrowed a published-only client's ?locale=all read to _status and id. Ardnived's review removed it — read access to this content is not sensitive, only write, and the filtering would cost more going forward. So a cross-locale read now carries every locale's value, including a locale the editor has taken down. The per-locale published-only filter still gates an ordinary single-locale read, which is the read a consumer makes. pages-localize-status.int.spec.ts pins the accepted behaviour rather than dropping the case, so the next reader meets the decision instead of re-deriving the gap and re-plugging it.

Criterion 5 needs one correction to the ticket's wording: a never-translated locale is absent from the map, not 'draft'. docs/rules/api-clients.md states the rule consumers must use — a locale is published only when it says so.

Detail

Why ?locale=all carries every locale, and why that is now deliberate. The access clause filters documents — it matches a document published in any locale — while the response still carries every locale's values. A probe confirmed it: a published-only client read returned title: { en: 'Leak EN', de: 'Leck DE' } where the German title had been published and then withdrawn. /security-review reached the same finding independently, tracing @payloadcms/drizzle's getTableColumnFromPath, which omits the _locale constraint when locale === 'all'. The finding is real; the review's answer is that it does not matter for this data, and the redaction that closed it has been removed. Recorded here rather than deleted, because the next person to read accessConfigs.ts will find the same gap.

The untranslated-locale case was missed by a spec that passed. The criterion-8 block covered a locale an editor unpublished, and the fallback case read with overrideAccess: true, so nothing exercised the published-only clause against a locale with no row at all. That is the case carrying the rollout consequence, and it went unasserted while every neighbouring case was green. It now goes red when localizeStatus is removed from Pages — checked by removing the key, not assumed.

Criterion 11, checked rather than assumed. Removing localizeStatus from both collection configs and re-running turns 6 of the 9 original cases red, including every status-map case. The 3 that stay green are genuinely flag-independent: an unpublished page is served in no locale either way, the query count is a property of the Postgres adapter, and live preview reads through draft: true. Those are controls, not coverage.

Criterion 10 was met on the wrong parameter. The first revision widened eventGeoJsonParameters, which only GET /api/events/geojson uses — and events has no localized field, so all is inert there. Meanwhile injectClientReadParameters injected select, populate, depth, limit and page onto every collection read and no locale at all, so the endpoints a consumer actually calls documented nothing. locale now joins that injected set and the geojson parameter is back to concrete codes.

Criterion 7, no fan-out. A 25-row list at locale=all is one SELECT plus Payload's pagination COUNT, counted at the pg pool. This is why there is no publishedLocales field: a collection afterRead computing one cannot see the other locales (the field afterRead pass hoists them away first) and would have to re-read each row at locale: 'all'.

Criterion 3, proven on main's schema with data. A scratch database was built from origin/main's migration chain in its own batch, seeded with a published page and a draft page each having en and de locale rows, then this migration applied as a second batch. up(): the published page is published in both locales, the draft page draft in both. down() (after unpublishing de by hand): the base column returns with the published page still published. Note pnpm payload migrate:down rolls back a whole batch, which is why the two-batch setup was necessary to test this migration alone.

publicUrlFields was a live regression, not a speculative one — five existing cases in pages.int.spec.ts went red. A field afterRead hook sees _status in either shape, and the map arrives unresolved because Payload hoists a localized value down to the requested locale in the same pass that runs the hook, so field order decides. The two Czech webUrl cases now publish the locale they read, because they are about path shape, not publish state; a new case covers the gate itself, paired with an English assertion, because it would otherwise pass against the old bug that nulled the URL in every locale.

payload-types.ts is unchanged, and that is expected — Payload generates the resolved single-locale shape for _status, not the locale=all map. Consumers cast. Recorded in docs/rules/api-clients.md.

Rejected: Payload's own localizeStatus migration helper (payload/migrations). It reconstructs per-locale truth from _pages_v history instead of copying the base column. Two reasons against it: it creates the columns as VARCHAR rather than the enum types drizzle's snapshot declares, which drifts the snapshot chain the next migrate:create diffs against; and published_locale is NULL for every row written before this flag, which its own algorithm reads as "published in all locales" — the same answer the simple backfill gives, for this data. Note it shares the property in Note 1: migrateMainCollectionStatus only UPDATEs <table>_locales rows, so an untranslated locale is left without a status there too.

Dismissed review finding. /security-review flagged that WeMeditateAppStatus/sections/{pages,shared}.ts compare _status === 'published' as a string and would now compare against an object. They read at a concrete locale, never 'all', so _status still resolves to a string — and app-status-readiness.int.spec.ts passes. The check's own description ("published for this locale") becomes more accurate, not less. No change made.

Collection counts confirmed against src/collections/* rather than trusted from the ticket table: pages 2 localized fields, app-cards 9, and meditations / clients / events / regions 0 — so two collections opt in, as the ticket says.

Review coverage. /pr-review-toolkit:review-pr is not available in this environment, so the six-lens pass did not run. /security-review did run and was required at the time (src/plugins/access/ matches securityReview.triggerPattern); its one HIGH finding was fixed in 08bd6c1 and then reversed by review in 17f9df0 — Notes 3. /simplify did not run.

Closes #718

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

Opt both collections into `versions.drafts.localizeStatus`, so `_status`
lives in their `_locales` tables and `?locale=all&select[_status]=true`
answers which languages a document is published in, in one query.
WeMeditateWeb#81 needs that to emit an `hreflang` cluster that names only
the locales it really has.

The object form of `drafts` is required — `drafts: true` sanitises the
flag back to false. The root `experimental.localizeStatus` key is already
on main from #731, and is deliberately not written again here.

The migration's DDL is drizzle-generated, matching #731's worked example:
same enum types, same indexes moved onto `(_status, _locale)`, snapshot
chain intact.

The backfill between its two DDL blocks is hand-written, and the
migration is wrong without it. As generated, the locale column is added
with DEFAULT 'draft' and the base column is then dropped — so every
already-published page lands draft in all 19 locales, and `pages` is read
published-only by `wemeditate-web-client`. That deploy would unpublish the
entire We Meditate site. #731 accepted the same outcome for the
translations globals, where the blast radius was one config gate; it is
not acceptable here. Copying the base value to every locale preserves
exactly what is observable today, since a published page renders in all 19
locales through the English fallback. `down()` needs the mirror of it for
the same reason.

Proven on a scratch database built from origin/main's schema, seeded with
published and draft rows, in its own migration batch: up() keeps the
published page published in both locales and the draft page draft, and
down() restores the base column with the published page still published.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MC6QJKbQazsJfVCZ6RcyUb
A field `afterRead` hook sees `_status` in whichever shape its collection
stores it: a plain string without `localizeStatus`, a per-locale map with
it. The bare `data?._status !== 'published'` check reads the map as
"not published" and nulled `webUrl` / `appUrl` on every page the moment
the flag went on — five cases in `pages.int.spec.ts` caught it.

The map reaches this hook unresolved because Payload hoists a localized
value down to the requested locale in the same afterRead field pass that
runs this hook, so whether `_status` is already a string here depends on
field order. Handling both shapes is the fix, not reordering fields.

At `locale: 'all'` any published locale counts — the alternative nulls the
field for every document on a `locale=all` read.

The access `Where` in accessConfigs needs no change: it constrains
`_status`, that column moved, and Drizzle scopes the same clause to the
requested locale for free. Comment only, recording that it is now
per-locale and load-bearing — with it removed, a read at `?locale=de`
returns the German text of a locale the editor unpublished.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MC6QJKbQazsJfVCZ6RcyUb
Nine cases over the status map, the published-only gate, the consumer
contract, the query count, and live preview's draft unlock.

Checked against criterion 11 by removing `localizeStatus` from both
collection configs and re-running: six of the nine go red, including
every status-map case and the access leak. The three that stay green are
genuinely flag-independent — an unpublished page is served in no locale
either way, the query count is a property of the adapter, and live
preview reads through `draft: true`.

The two Czech `webUrl` cases in `pages.int.spec.ts` now publish the locale
they read. They are about the path shape for a non-English locale, and
creating a page `published` publishes the default locale alone — so
without it they were asserting the publish gate by accident. A new case
covers the gate itself, paired with an English assertion, because it would
otherwise pass against the old bug that nulled the URL in every locale.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MC6QJKbQazsJfVCZ6RcyUb
The host-facing half of #718: what `?locale=all&select[_status]=true`
returns, and the one rule for reading it — a locale is published only when
it says so, and a never-translated locale is absent from the map rather
than `draft`.

Also records why there is no `publishedLocales` field, that
`payload-types.ts` still types `_status` as a single string so a consumer
casts, and that the published-only filter is now per locale.

The OpenAPI `locale` parameter accepts `all` alongside the concrete codes,
which it enumerated exclusively before.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MC6QJKbQazsJfVCZ6RcyUb
The Pages guide still described `publishSpecificLocale` as tracking
`published_locale` in the versions table, which was the pre-flag
behaviour. Replaces it with what a contributor now has to know, each item
being something this branch tripped over: a field afterRead hook sees
`_status` in two shapes and the map arrives unresolved, publishing a
locale validates that locale's required fields so a missing title refuses
the write, and the published-only filter is per locale.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MC6QJKbQazsJfVCZ6RcyUb
The published-only client filter is `{ _status: { equals: 'published' } }`,
and making `_status` localized scopes it per locale — but only for a
request naming one locale. At `?locale=all` the clause filters
*documents*, matching any document published in any locale, while the
response still carries every locale's value for every localized field.

Measured on this branch, not inferred: a page published in English,
published in German, then unpublished in German, read by a published-only
client at `?locale=all`, returned
`title: { en: 'Leak EN', de: 'Leck DE' }`. The German text is the last
thing published there, and the editor has since taken it down. Unpublishing
one locale leaves its text in the main table with `_status = 'draft'`,
which is exactly what makes it reachable.

This is new with the flag — before it, a locale could not be unpublished
on its own, so every locale of a published document was published.

A cross-locale read by such a client now answers which locales are
published and nothing else: `_status` and `id`. That is the documented
contract (`?locale=all&select[_status]=true`) and the one cross-locale
fact the client is entitled to. Content stays available one locale at a
time, where the clause gates it properly. Managers, the admin panel, and
live preview are untouched — the hook uses the same three conditions as
the access branch, so the two cannot disagree about who is restricted.

Redacting per field instead would mean walking each document against its
field tree — groups, named tabs, arrays, blocks — to find which values are
locale maps, and every gap in that walk is a leak. Keeping two keys cannot
leak.

Attached by `accessPlugin` off the collection's own config rather than a
slug list, so a third collection opting into `localizeStatus` is covered
the day it does.

BREAKING CHANGE: an API client reading a drafts-enabled collection at
`?locale=all` receives only `_status` and `id`. No current consumer does
this — the read was introduced by this branch.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MC6QJKbQazsJfVCZ6RcyUb
@railway-app

railway-app Bot commented Sep 12, 2026 •

Copy link
Copy Markdown

🚅 Deployed to the SahajCloud-pr-765 environment in sahajcloud

Service Status Web Updated
SahajCloud ✅ Success (View Logs) Web Sep 12, 2026 at 7:09 pm UTC
1 service not affected by this PR
  • mailpit

@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-765 September 12, 2026 00:36 Destroyed
@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Sep 12, 2026
@sydevs-bot

sydevs-bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 no session running

recent dispatches
  • 19:00Z address-review · attempt 1 · session · done
  • 19:00Z address-review · attempt 1 · session
  • 18:07Z address-review · attempt 1 · session · done
  • 18:07Z address-review · attempt 1 · session
  • 17:19Z resolve-conflicts · attempt 1 · session · done

Written by the sydevs dispatcher. Sessions never edit this comment.

@sydevs-bot sydevs-bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🧐 Adversarial review

Shape is right, no bigger than the ticket: two config keys, a migration, and the two reads the moved column broke. The redaction is outside the ticket but earns its place — the leak is real and this branch introduces it.

The blocker is rollout. The backfill preserves status only for locale rows that exist, so a page never translated into a locale is unreachable there on deploy. The PR body and api-clients.md:202 say otherwise.

Findings

  • blocker — untranslated locales 404 on deploy (migration).
  • should-fix — all documented on the geojson endpoint, not /api/pages.
  • consider — blunt redaction vs fieldAccess.ts's field walk.
  • consider — comment volume in publicUrlFields.

What was checked

#718's criteria; the diff minus the snapshot; accessConfigs.ts (collectionHasDrafts is true for both, so the redaction matches it); fieldAccess.ts; specFilter.ts (injects no locale); consumer cms-client.ts:316, sitemap-routes.ts:70 (reads en); the new spec reads no untranslated locale as a client

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

Comment thread src/plugins/openapi/customEndpoints.ts Resolved
Comment thread src/fields/publicUrlFields.ts Resolved
@sydevs-bot sydevs-bot added bot:working Lock: a cloud session is running on this item. Removed when it ends. and removed bot:working Lock: a cloud session is running on this item. Removed when it ends. labels Sep 12, 2026
The `isPublished` doc comment ran 19 lines for a 6-line function, most of
it narrating the regression that caused it. A caller needs the rule —
`_status` is a string or a per-locale map, handle both — and the reason
the map can arrive unresolved, because that is what stops the next reader
simplifying the check away. The history stays in PR #765, where it reads
better than in the file.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01QcPzYuzr3bfjA1n7mxL8LQ
`hasLocalizedStatus` has one caller, `withPublishedLocaleRedaction`, in the
same file. Exported it read as a shared helper the rest of the access
plugin could ask about a collection, which it never does.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01QcPzYuzr3bfjA1n7mxL8LQ
Criterion 10 was met on `eventGeoJsonParameters`, which only
`GET /api/events/geojson` uses — and `events` has no localized field, so
`all` does nothing there. The collection reads a consumer actually calls
documented no `locale` parameter at all: `injectClientReadParameters`
injects select, populate, depth, limit and page, and nothing else.

So `locale` joins that injected set, carrying the `_status` map contract,
and the geojson parameter goes back to naming concrete locales.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01QcPzYuzr3bfjA1n7mxL8LQ
The contract said "on existing data nothing changes: the migration carried
every document's old status into all 19 locales". It carries it into every
locale row that exists, and an untranslated locale has none — so the
published-only filter, which is SQL and sees rows rather than the English
fallback, drops that locale on existing data. Payload's own localizeStatus
template behaves the same way: it UPDATEs locale rows, never inserts one.

Also records `locale` joining the injected client read parameters.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01QcPzYuzr3bfjA1n7mxL8LQ
The criterion-8 block covered a locale an editor unpublished, and the
fallback case read with overrideAccess, so nothing exercised the published-
only clause against a locale that has no row at all. That is the case with
the rollout consequence: measured here, a client read at `?locale=de` of an
English-only page returns 0 docs while `?locale=en` returns the page.

Goes red with `localizeStatus` removed from Pages, as criterion 11 requires
— checked by removing the key, not assumed.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01QcPzYuzr3bfjA1n7mxL8LQ
@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-765 September 12, 2026 01:07 Destroyed
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

3 adopted, 1 asked, 1 half open. Head e6e27f6, lean gate green, pages-localize-status (12) and pages green.

Asked — untranslated locales 404 on deploy. Measured: an English-only page returns 0 docs at ?locale=de, and it fires on existing data, so the earlier body was wrong. Three ways out, each with a cost — the rollout call is yours, Notes 1.

Adopted

Open — the field walk there. fieldAccess.ts denies leaves only, so reuse needs it extended first.

A spec now pins what a never-translated locale serves (e6e27f6).

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Sep 12, 2026
@sydevs-bot
sydevs-bot marked this pull request as ready for review September 12, 2026 01:16
@sydevs-bot
sydevs-bot requested a review from Ardnived September 12, 2026 01:16
@sydevs-bot sydevs-bot added awaiting bot:working Lock: a cloud session is running on this item. Removed when it ends. and removed awaiting labels Sep 12, 2026
Resolves the only conflict, `src/migrations/index.ts`: both branches
appended a migration. Kept both, in timestamp order — main's
20260909_161353_atlas_translations_by_view (#750) before this branch's
20260911_235823_pages_app_cards_localize_status. Their DDL is
independent: one rewrites the Sahaj Atlas translations schema, the other
moves `_status` into the pages / app_cards locale tables.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01PBHRDEQqp6sryryeHTMXN4
…ize-status

One conflict, src/migrations/index.ts, additive on both sides. Main added
20260912_031449_atlas_translations_seo_group (#769); this branch adds
20260911_235823_pages_app_cards_localize_status. Both register, in
timestamp order, so both apply.

src/plugins/openapi/customEndpoints.ts merged without conflict: main
rewrote the /api/atlas/seo docs, this branch annotated
eventGeoJsonParameters. The regions do not overlap and both survive.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Ybi5nRF2U6i7rsRafMCRfa
@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-765 September 12, 2026 17:25 Destroyed
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

Merged main (70f12c6) in at 2c36b6b. One conflict, src/migrations/index.ts, additive on both sides — #769's 20260912_031449_atlas_translations_seo_group and this branch's 20260911_235823_pages_app_cards_localize_status both register, in timestamp order.

⚠ Correction to my two earlier notes: the newest-by-timestamp snapshot is no longer this branch's file. It is main's 20260912_031449_…json, which predates this branch — it still carries _status on pages and app_cards, not on their _locales tables. So the next migrate:create would re-emit this PR's DDL, the mirror image of what I reported at 16:27Z and 16:59Z. Same #566 trap, opposite direction.

customEndpoints.ts merged clean: main's /api/atlas/seo docs and this branch's eventGeoJsonParameters note do not overlap.

Gate green: lint, typecheck, typecheck:tests, 1812 unit tests. Integration: pages-localize-status, pages, atlas-seo, translations-globals — 108 passed.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot added awaiting and removed bot:working Lock: a cloud session is running on this item. Removed when it ends. labels Sep 12, 2026
@sydevs-bot sydevs-bot added bot:working Lock: a cloud session is running on this item. Removed when it ends. and removed awaiting labels Sep 12, 2026
Ardnived's review on #765: read access to content across locales is not
sensitive here — write, edit and delete are what the roles guard — and the
filtering is a complication that would cost more going forward.

So `withPublishedLocaleRedaction` is gone, and with it the accessPlugin
wiring. A `?locale=all` client read now carries every locale's value again,
including a locale the editor has unpublished. The per-locale published-only
filter still gates an ordinary single-locale read, which is the gate a
consumer actually goes through.

The spec case that pinned the redaction is inverted rather than deleted, so
the next reader meets the decision instead of re-deriving the gap and
re-plugging it. The manager cross-locale case goes with it: it read with
`overrideAccess: true` and only ever asserted the redaction spared managers.
`docs/rules/api-clients.md` states the new contract.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0191944fWtwUR1ZgnYhiCPPd
@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-765 September 12, 2026 18:12 Destroyed
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

Review addressed, pushed 17f9df0.

Adopted — the cross-locale redaction is removed: publishedLocaleRedaction.ts and its accessPlugin wiring are gone. A ?locale=all client read carries every locale again. A single-locale read is still gated per locale, which is the read a consumer makes. The spec case is inverted rather than deleted, so the decision is pinned; docs/rules/api-clients.md and the PR body say the same.

Closed as moot — the blunt-vs-field-walk thread. Neither ships.

Still open, and yours — Notes 1: an untranslated locale stops serving on deploy. Three ways out, none free, none pushed.

Gate green on this head: lint, typecheck, typecheck:tests, 1812 unit tests, and 97 integration cases across pages-localize-status, pages, role-based-access.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot added awaiting bot:working Lock: a cloud session is running on this item. Removed when it ends. and removed bot:working Lock: a cloud session is running on this item. Removed when it ends. awaiting labels Sep 12, 2026
Ardnived's review on #765 settled the open blocker: a 404 is the right
answer when a locale is not published, and an English-only page must not
fall back to German. So the migration stays as written — no backfill
inserts the 19 missing locale rows, and no consumer restores the fallback.

Only the framing changes. `docs/rules/api-clients.md` and the spec comment
called the untranslated-locale case a rollout hazard a consumer had to
adapt to first. Both now state the decision, so the next reader meets it
instead of reading an open question and re-plugging the gap — the same
treatment the cross-locale read got in 17f9df0.

The assertions are untouched: a never-translated locale is absent from the
status map and serves nobody, measured rather than argued.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HY8U5JaE2s2qNefv2a4mFx
@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-765 September 12, 2026 19:05 Destroyed
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

Review addressed, pushed 30ed58b. No open threads left.

Settled, no code change — the untranslated-locale blocker. A 404 for an unpublished locale is the answer you want, so none of the three options ships: no 19-row backfill, no wait on WeMeditateWeb#81, no access change that would let an absent locale fall back.

What did change is the framing. docs/rules/api-clients.md and the spec comment called it an open hazard a consumer had to adapt to first; both now state the decision, so the next reader meets it instead of re-plugging the gap. Notes 1 and the Summary say the same. The assertions are untouched — a never-translated locale is absent from the map and serves nobody.

Gate green on this head: lint, typecheck, typecheck:tests, 1812 unit tests. The commit touches a doc rule and a comment only, so no integration file was re-run; CI covers the suite.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot added awaiting and removed bot:working Lock: a cloud session is running on this item. Removed when it ends. labels Sep 12, 2026
@sydevs-bot
sydevs-bot merged commit 25c0977 into main Sep 12, 2026
21 of 22 checks passed
@sydevs-bot sydevs-bot moved this from Revising to Done in SYDevelopers Technical Roadmap Sep 12, 2026
@sydevs-bot
sydevs-bot deleted the claude/feat-718-localize-status branch September 12, 2026 19:43
sydevs-bot pushed a commit that referenced this pull request Sep 13, 2026
Ardnived asked for the 41 new keys to sit in their own section rather than
inside `media`, with the WeMeditateWeb map updated to match. They now live in
a `video` tab between Media and Location, and the `video_` prefix goes with
them — the tab is what disambiguates `Off`, `Auto` and `Color` now, so the
prefix would only repeat the tab name in every key.

`media` goes back to describing the music player, cards, images and the embed
popover. `media.a11y.volume` stays reused: it names the volume slider for both
players, and duplicating it would ask 18 locales to translate one word twice.

A new tab is two new columns, so this needs the migration the in-`media`
version did not. The generated delta also re-emitted #765's `pages` /
`app-cards` localizeStatus DDL, which the stale `20260912_031449` snapshot
makes drizzle re-derive on every migration since — trimmed, since replaying it
on production fails on a column that already exists. The committed snapshot
carries that state, so the next migration stops re-deriving it.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SxXsSwv1xCqgGFpy2DG3Ca
sydevs-bot added a commit that referenced this pull request Sep 14, 2026
…#775)

* feat(translations): CMS-owned labels for the We Meditate video player

WeMeditateWeb renders Vidstack's `DefaultVideoLayout`, which ships its
control labels in English and overrides them through
`DefaultLayoutProps.translations`. Nothing upstream can be imported:
`@vidstack/[email protected]` carries no locale data at all, and its resolver
is `translations?.[word] ?? word`, so the English phrase is both the key
and the fallback. The 35 labels this adds are the ones the site's player
can actually render and the bank does not already carry.

The keys are ours, not Vidstack's. Its keys ARE the English phrases —
`Captions look like this` cannot be a CMS field name — so WeMeditateWeb
owns a typed phrase-to-key map and this side owns the copy, extending the
existing `media` tab rather than adding a video tab of its own.

What is left out, measured against the package rather than assumed:

- Seven labels the bank already renders (`media.a11y.play`, `pause`,
  `mute`, `unmute`, `volume`, `blocks.a11y.enter_fullscreen`,
  `exit_fullscreen`). The map points at those, so no locale translates
  the same word twice.
- Nine of the 56 the player cannot reach without a loader, a prop or a
  live stream it does not configure: AirPlay, Google Cast, Connected,
  Connecting, Disconnected, Download, LIVE, Skip To Live, Chapters.
- Five the DEFAULT layout never renders in any configuration, which the
  ticket had counted as reachable. `Loop` and `Playback` appear nowhere
  in `vidstack-default-components.js`; `Disabled` appears only in the
  Plyr layout; `Replay` and `Continue` only in `DefaultAudioTitle`, part
  of `DefaultAudioLayout`, and the site mounts the video layout
  (`VideoPlayer.tsx:219`).

`translations` is `Partial<>`, so anything left out keeps Vidstack's
English and enabling one of those features later adds its key then.

The split follows the tab's own rule rather than the buttons: a word goes
in `a11y` only where the layout uses it as an `aria-label` and never
shows it. Three do — `Fullscreen`, `PiP` and `Seek` name the fullscreen
button, the picture-in-picture button and the progress bar, while their
tooltips show different words. The rest are menu rows, section headings
or tooltip text, all of which a viewer reads.

No migration. Each leaf group is one localized JSON column, and these are
keys inside `media_general` and `media_a11y`, so only the column's JSON
Schema changes. Confirmed rather than reasoned: `db:migrations:create`
against a scratch database generated no statement naming
`wm_web_translations` (what it did generate was unrelated drift from
#765, and was discarded).

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01QwYeXRpYvR37oWay2CMaCX

* fix(translations): six visible video tooltips leave the a11y bank

The PR reused seven bank keys for words Vidstack renders. Measured
against @vidstack/[email protected], six of those are visible tooltip text,
not screen-reader-only copy:

- DefaultPlayButton: tooltip content is Play/Pause
- DefaultMuteButton: tooltip content is Mute/Unmute
- DefaultFullscreenButton: tooltip content is Enter/Exit Fullscreen

Every media.a11y description opens "Not shown on screen; read by screen
readers", so reusing those keys tells a translator the opposite of the
truth. blocks.a11y.enter_fullscreen is worse still: it names the
subtle-system diagram's button, and its English is lowercase.

So six video_ keys move into media.general, phrased like their siblings.
Only media.a11y.volume stays reused, and it is genuinely aria-only —
DefaultVolumeSlider passes it as aria-label and renders no tooltip.
Fullscreen, PiP and Seek stay in a11y for the same measured reason.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01To5QDnbhw3RcvrxXe1fK7W

* fix(translations): the video player's strings get their own tab

Ardnived asked for the 41 new keys to sit in their own section rather than
inside `media`, with the WeMeditateWeb map updated to match. They now live in
a `video` tab between Media and Location, and the `video_` prefix goes with
them — the tab is what disambiguates `Off`, `Auto` and `Color` now, so the
prefix would only repeat the tab name in every key.

`media` goes back to describing the music player, cards, images and the embed
popover. `media.a11y.volume` stays reused: it names the volume slider for both
players, and duplicating it would ask 18 locales to translate one word twice.

A new tab is two new columns, so this needs the migration the in-`media`
version did not. The generated delta also re-emitted #765's `pages` /
`app-cards` localizeStatus DDL, which the stale `20260912_031449` snapshot
makes drizzle re-derive on every migration since — trimmed, since replaying it
on production fails on a column that already exists. The committed snapshot
carries that state, so the next migration stops re-deriving it.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SxXsSwv1xCqgGFpy2DG3Ca

* docs(globals): name the Video tab in the Web tab list

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SxXsSwv1xCqgGFpy2DG3Ca

---------

Co-authored-by: Claude <[email protected]>

This branch was successfully deployed

No deployments
sahajcloud / SahajCloud-pr-765 — 30ed58b3 Deployed Sep 12, 2026 by railway-app[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

feat(pages): adopt versions.drafts.localizeStatus on Pages and AppCards, so a client can read per-locale publish state

3 participants