Skip to content

feat(translations): add the keys WeMeditate Web still hardcodes - #925

Merged
sydevs-bot merged 7 commits into
mainfrom
claude/feat-917-wm-translation-keys
Oct 13, 2026
Merged

sydevs-bot merged 7 commits into
mainfrom
claude/feat-917-wm-translation-keys

Conversation

@sydevs-bot

@sydevs-bot sydevs-bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Change outline

The keys a client reads from GET /api/globals/wm-web-translations. discover is a new tab, between Errors and Article; the upsell keys join an existing group.

discover                       # new tab — the home page's closing call to action
  general
    title, subtitle            # the section's heading and the line under it
    meditate_now               # three choice cards, each a title + one-line subtitle
    meditate_now_subtitle      # titles capped at 24 (advisory) — cards sized to their text
    live_guidance
    live_guidance_subtitle
    classes_near_me
    classes_near_me_subtitle

meditation
  general
    …
    upsell_web                 # "… on %{link}"     — link text is the bare domain, no key
    upsell_app                 # "… in our %{link}" — link text is upsell_app_link
    upsell_app_link

Types

Each leaf group's JSON column declares its own shape, so the new group gets a named interface rather than an index signature.

 src/payload-types.ts
+export interface WmWebTranslationsDiscoverGeneralStrings   # 8 optional string keys
 export interface WmWebTranslationsMeditationGeneralStrings
+  upsell_web?, upsell_app?, upsell_app_link?

Preview

  • The translations global — the Discover tab's eight rows, and the Meditation tab's three upsell rows
  • WeMeditate Web config — unchanged, but it validates against the translations global on every save, so it is the quickest check that the new column did not break one

Migration

  • New migration: src/migrations/20261011_194449_wm_web_discover_translations.ts
  • Impact: adds discover_general to wm_web_translations_locales and version_discover_general to _wm_web_translations_v_locales. Two ADD COLUMNs, no data read or written.
  • Reversible: yes — down drops both. They hold nothing until the seed or an editor writes them.

Contract impact

src/payload-types.ts is a contractSync source for WeMeditateWeb (server/payload-types.ts) and SahajAtlasWeb (src/types/payload/payload-types.ts); a bot PR re-syncs both after this merges. The consumer wiring is sydevs/WeMeditateWeb#165 phase 3, which is also gated on #918.

Test results

  • Lean gate: ✓ lint, typecheck, typecheck:tests, test:unit (2307 passed)
  • Targeted specs: translations-globals 36, translations-field 26, wm-web-translations-seed 7 int + 9 unit
  • Build: N/A — Railway builds the preview, CI does not build the app

Manual verification

  1. Open the global in the preview admin. The Discover tab should show eight rows with a max 24 characters counter on the three choice titles, and the Meditation tab three new upsell rows.
  2. After the production deploy, run pnpm seed translations. The migration adds the column; it does not fill it. Until the seed runs, the English values do not exist in production, so clientEnglishFallback has nothing to merge and a client read returns the new keys blank.

Notes for reviewer

  • discover nests a lone general where a tab with no screen-reader copy has so far stayed flat (navigation, footer). This is what feat(translations): add the keys WeMeditate Web still hardcodes #917 specifies, and nesting buys a later a11y group for free — flat would need a column rename. Flat is defensible; a review pass argued for it, citing 20260608_145829.ts as a cheap rename precedent. src/globals/AGENTS.md now names both shapes, so the rule no longer reads as "both or neither". Say if you want it flat.
  • maxLength: 24 is headroom, not a measurement — the longest English is "Classes Near Me" at 15. Advisory, not strict, so an over-length string still saves, and nothing clips: the consumer sizes each card to its own text, so a long title widens its card and can wrap the row. Say if you want it strict.
  • discover.general.title and subtitle replace default props, not JSX literals, and the consumer's lint selectors do not match a default parameter — its own disable comment covers only the six card strings. feat(translations): add the keys WeMeditate Web still hardcodes #917 lists all eight, so both are declared here. If a page or CMS content ends up owning that heading, those two become dead CMS copy in every locale. Consumer's call, flagged rather than decided.
  • The tab is named after the component (discover) rather than the page it closes (home), per feat(translations): add the keys WeMeditate Web still hardcodes #917. A second home-page string would have nowhere natural to go.
  • Dismissed, with reasons: the three subtitles get no maxLength (the row-wrapping cost is the titles'; a subtitle sits under its title in the same card, and "one line on screen" is slot context rather than a bound). No preview target on the tab — only map declares one, and adding panel behaviour is outside the ticket.
Detail

Review. No pr-review-toolkit on this routine, so the pass was /simplify's four lenses plus the deterministic comment lint ("no banned comment added"). Findings acted on: two stale toEqual sets in translations-globals (also caught locally by running the spec), the redundant "keep it short" clause, the missing inflection cue on upsell_app_link, the unpinned _meta counts, and the AGENTS.md paragraph the new shape contradicted. tests/COVERAGE.md said twelve tabs — already a tab behind from #775, fixed here since it is the same row.

The new count assertion was confirmed red first, against a leaf-group count off by one, then restored. The same check was run on the seed-coverage spec by blanking upsell_app_link: it failed naming that path, which is what establishes the 11 new keys are really covered rather than passing over an empty walk.

Column budget. findGlobal builds one json_build_array() per nested relation, and Postgres caps a function call at 100 arguments — the reason this schema packs a leaf group's strings into one JSON column. wm_web_translations_locales goes from 26 to 27 arguments; wm_app_translations_locales is the nearest bound at 52. No concern, recorded so nobody re-derives it.

Fixture pre-mortem. No new fixture. The seed specs read the real seeds/wm-web-translations/data.en.json and the real schema, and the integration one runs the real TranslationsImporter against a database — which is what proves Payload's per-column JSON Schema accepts the new keys, since an undeclared key fails on write rather than in review.

Anomaly. pnpm db:migrations:create logged a nodemailer ETIMEDOUT while booting the config — no SMTP host is reachable from this sandbox. It did not affect the generated migration.

Closes #917

Two WeMeditate Web components render English as literal JSX because
`wm-web-translations` declares no key for the copy, so each site sits
behind a commented `eslint-disable` (sydevs/WeMeditateWeb#165, #178).

A new `discover` tab carries the home page's closing call to action:
eight visible strings under `general`, the English taken from the
component's own defaults and literals. The three choice titles sit side
by side in equal columns, so each carries an advisory `maxLength` of 24.

`meditation.general` gains `upsell_web`, `upsell_app` and
`upsell_app_link` for the embedded player's message back to the full
site. `%{link}` is the link the sentence wraps, as
`errors.general.status_page_hint` already does. `upsell_web`'s link text
is the bare domain, a brand name rather than a translation, so it gets
no key.

`discover` declares a lone `general` sub-group where a tab with no
screen-reader copy has so far stayed flat (`navigation`, `footer`). The
nested form is what the ticket specifies and it is also the cheaper
shape: an `a11y` group added later costs nothing, while promoting a flat
`discover` column to `discover_general` would be a rename.

Only the new column needs DDL. The three upsell keys live inside the
existing `meditation_general` jsonb blob.

Closes #917

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

`translations-globals` asserts the wm-web tab labels and the ordered
leaf-group set with `toEqual`, so both went red on the new tab. They are
meant to: an exact set is what catches a sub-group dropped from the
schema, so they are extended rather than loosened.

`_meta.schema_version` in the seed file quotes three counts that were
hand-written and derived from nothing. A key added without touching that
line left a confidently wrong number, which is what happened to the
`13 tabs / 24 leaf groups / 181 keys` it carried. The new case derives
all three from the schema and compares. Confirmed red first, against a
leaf-group count off by one.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TivXo7AWF8YzA76JaL9W4h
Two review findings on the descriptions, which are the only context a
translator ever gets.

The three title keys told the translator to "keep it short" beside a
`maxLength` the admin row already renders as a live counter. The reason
the limit exists — three titles in equal columns — is the part they
cannot re-derive, so only that stays. Neither existing advisory limit in
this schema exhorts; the two that do are `strict`, where over-length
refuses the save.

`upsell_app_link` named what the link points at but dropped the
instruction its own precedent carries: `errors.general.status_page_link`
says "Translate as a noun phrase, not a sentence". The English "free
app" also sits after a possessive that lives in the other key, which
leaves an inflecting language no cue about case or gender.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TivXo7AWF8YzA76JaL9W4h
The sub-group rule read as "both `general` + `a11y`, or neither", and
`discover` is now a third shape the paragraph did not describe — a
contributor following the text would have made it flat. It says which to
prefer and why, so the schema and the rule stop disagreeing.

The coverage row still claimed twelve tabs. It was already a tab behind
before this change, from the `video` tab in #775.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TivXo7AWF8YzA76JaL9W4h
@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-925 October 11, 2026 20:02 Destroyed
@railway-app

railway-app Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

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

Service Status Web Updated
SahajCloud ✅ Success (View Logs) Web Oct 11, 2026 at 8:36 pm UTC
1 service not affected by this PR
  • mailpit

@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Oct 11, 2026
@sydevs-bot

sydevs-bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 no session running

recent dispatches
  • 20:22Z address-review · attempt 1 · session · done
  • 20:22Z address-review · attempt 1 · session
  • 20:15Z review-pr · attempt 1 · session · done
  • 20:15Z review-pr · attempt 1 · session

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

The diff is the size of #917 and no larger: eleven keys, a generated migration, a generated type block, and the data-driven seed. It adds no helper and no new mechanism — maxLength without strict is the platform's advisory path, and upsell_app + upsell_app_link copies the status_page_hint pair already next door. The snapshot carries exactly discover_general and version_discover_general, and down drops both.

One real finding, and it comes from the consumer. The three maxLength: 24 descriptions tell translators the titles sit in equal columns; DiscoverMeditation.tsx renders a wrapping centred flex row of intrinsically sized cards. That text is a translator's only context, so a wrong layout claim in it is a product defect, not a comment nit.

Findings

  • should-fix — translationsSchema.json:200 — "equal columns" is not what the consumer renders.
  • consider — tests/unit/wm-web-translations-seed.spec.ts:126 — 31 lines guard a count that has never drifted.
  • consider — src/globals/AGENTS.md:152 — "likely to grow one" is not a checkable rule.

What was checked

  • #917 against the diff. All four acceptance criteria met.
  • Consumer, WeMeditateWeb@main: DiscoverMeditation.tsx layout and its default-prop title/subtitle, and MeditationPlayer.tsx:817-838 — both sentences and the link text match the seed exactly.
  • translationsField.ts: maxLength reaches jsonSchema only when strict, so no Ajv keyword leaks.
  • Snapshot diffed against 20260929_173315: two columns, plus a new id. The zero prevId is this repo's norm — all 78 carry it.
  • Counts re-derived: 14 tabs, 25 leaf groups, 192 keys. main's were right too.
  • Only data.en.json exists under seeds/wm-web-translations/, so no registry needs the group.

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


Generated by Claude Code

Comment thread src/globals/AGENTS.md 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 Oct 11, 2026
The three title descriptions claimed the titles sit in equal columns.
`DiscoverMeditation.tsx` renders a wrapping, centred flex row of
intrinsically sized cards — no grid, no fixed widths — so a long title
widens its own card and can push the row to wrap.

That sentence is a translator's only context, so a wrong layout claim in
it is a product defect rather than a comment nit. The replacement says
what the layout does and why staying under the advisory limit matters.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FhEzb5tZVfhL9d12YQ8ykr
"Prefer the lone `general` where a tab is likely to grow one" asks the
next author to predict, and gives them nothing to check. It also weakens
the two sentences before it: the cost asymmetry already says to nest,
since promoting a flat tab to `<tab>_general` is a column rename while
adding `a11y` beside an existing `general` is a new column.

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

Copy link
Copy Markdown
Contributor Author

Addressed all three review threads. Pushed 5450bb7.

Adopted

  • Equal columns — 801a290. DiscoverMeditation.tsx:71 is a wrapping centred flex row of intrinsically sized cards, so the three title descriptions now say that instead. Regenerated src/payload-types.ts, which carries each one as JSDoc.
  • The lone-general preference — 5450bb7. Dropped the sentence; the cost asymmetry above it already says to nest.

Rebutted

  • The _meta count assertion — the counts have drifted. All ten seeds/sy-atlas-translations/data.*.json claim 11 tabs and 33 leaf groups against a schema with 12 and 34. Assertion stays.

Filed #926 — extend that assertion to the other two seeds, and correct the Atlas counts. Out of scope here.

Lean gate green, translations-globals 36 passed. PR body corrected where the first fix made it false.

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


Generated by Claude Code

@sydevs-bot sydevs-bot moved this from Revising to Approved in SYDevelopers Technical Roadmap Oct 12, 2026
@sydevs-bot
sydevs-bot added this pull request to the merge queue Oct 12, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 12, 2026
@sydevs-bot
sydevs-bot added this pull request to the merge queue Oct 12, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 12, 2026
@sydevs-bot
sydevs-bot added this pull request to the merge queue Oct 13, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 13, 2026
@sydevs-bot
sydevs-bot added this pull request to the merge queue Oct 13, 2026
Merged via the queue into main with commit 8fdadeb Oct 13, 2026
61 of 64 checks passed
@sydevs-bot
sydevs-bot deleted the claude/feat-917-wm-translation-keys branch October 13, 2026 05:29
@sydevs-bot sydevs-bot moved this from Approved to Done in SYDevelopers Technical Roadmap Oct 13, 2026
sydevs-bot added a commit to sydevs/WeMeditateWeb that referenced this pull request Oct 13, 2026

This branch was successfully deployed

No deployments
sahajcloud / SahajCloud-pr-925 — 5450bb7d Deployed Oct 11, 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(translations): add the keys WeMeditate Web still hardcodes

3 participants