Repository navigation
fix(i18n): the meditation player's upsell copy stays English - #232
Conversation
Both upsell sentences shipped as literal JSX, so every locale read English.
The three keys they need now exist and carry English values on production,
so the eslint-disable region that marked the gap can go.
Each sentence wraps its link, so neither can be assembled from parts. Both
render through t.rich with a %{link} placeholder, the shape ErrorFallback
already uses. The web arm's link text is the domain, which is a brand name
and not copy, so it stays English in a named constant.
Closes #178
Co-authored-by: sydevs-bot <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjWK2gxnsAdExBmBv4o
The domain was spelled three times: a constant that deduplicated nothing, plus both hrefs. Both links now compose from the constant. Its comment stated the lint mechanism eslint.config.js already owns. It now states the fact a reader needs instead: wemeditate.com is the legacy Rails app on another origin, which localizes its own slugs, so lib/urls.ts cannot spell these links and they stay on the English entry points. Drops the locale test's no-upsell case. It covers the untouched `upsell &&` guard rather than the translation wiring, and MeditationPlayer.test.tsx already owns the render contract. Co-authored-by: sydevs-bot <[email protected]> Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjWK2gxnsAdExBmBv4o
sydevs-bot
left a comment
There was a problem hiding this comment.
1 question for the reviewer, one per thread.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
wemeditate-design | 3c4b4ff | Commit Preview URL Branch Preview URL |
Nov 17 2026, 11:27 PM |
|
🤖 no session running recent dispatchesWritten by the sydevs dispatcher. Sessions never edit this comment. |
|
No fix pushed. The check waited out its 12-minute discovery and found no preview. Cloudflare's Evidence:
One correction to this PR's body: a zero-second check run is not evidence. The green builds on Reading the build log needs Cloudflare dashboard access, which this run has none of. 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
wemeditate-web | 3c4b4ff | Commit Preview URL Branch Preview URL |
Nov 17 2026, 11:27 PM |
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 Adversarial review
The diff is the ticket and no larger: two sentences and a link text through t.rich, the eslint-disable region gone, one locale test. The test file clones HeaderDropdown.locale.test.tsx, and %{link} reuses ErrorFallback's shape, so this adds no layer the repo lacked. Holding the keys as quoted literals is right — translation-keys.test.ts's CALL_PATTERN sees only those. Whether anything should set upsell is your call on the open thread; the copy is correct either way.
Findings
should-fix— The## Previewsection is stale. Both Workers deployed on1350180, the Cloudflare comment now carries branch previews, andSmoke (ladle)andWorkers Builds: wemeditate-designare green. The body sends you away from the one place this change is visible: the story.should-fix—wemeditate.commay be our own origin, not another's.MeditationPlayer.tsx:43, thread below.consider— MM:SS formatting is now a third copy:MeditationPlayer.tsx:55,AudioPlayer.tsx:80,Playlist.tsx:49. Outside the diff, so no thread.
What was checked
#178 against the diff. Read lib/i18n.ts (RICH_PLACEHOLDER, t.rich), ErrorFallback.tsx:84, translation-keys.test.ts, lib/urls.ts. All three keys are already populated on main, so none was hand-added. Ladder: the constant and the test file are the only new pieces. Whole-file pass over MeditationPlayer.tsx — no literal left and every label goes through t; only formatTime fell out. Drove the Ladle preview with Playwright: both sentences render from translations, no key path leaks, hrefs /meditations and /app.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
The constant's comment explained why the two upsell hrefs stay absolute and English, but named no trigger for revisiting it. A comment recording an accepted limit without one is the comment that rots. wemeditate.com is another origin today: a live read answers with `via: 2.0 heroku-router`, a `_wemeditate_session` cookie and Webpacker `/packs/` assets, so `Link` treats both hrefs as external and the legacy app resolves its own localized slugs. The repo's `ORIGIN` fixtures spell the same domain, so once this app serves it, `Link` passes an absolute same-origin URL through untouched (#124) and both links silently become unprefixed self-links for every non-English visitor. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXKDPjLZfsPMpWAzox
|
Review addressed. Head is now
MM:SS is a third copy — filed as #240. Three files, outside this diff, and The upsell wiring question stays open. It is a product call, not a fix. Lean gate on 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
The upsell prop had no caller, so the translated copy rendered only in Ladle. The reviewer chose option B on the open question thread: wire `upsell="web"` on the embed route rather than leave it unreachable or make the variant a SahajCloud field. The embed route is the one place the line belongs. It runs inside someone else's page, so the link is a visitor's only way back to the site; on a route of our own it would point at the page they are reading. The test renders the real template and player, not a stub, so deleting the player's upsell block fails it too. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjYzwqfXrgWbnanUEvS
|
Review addressed. Head is now B on the upsell question — built, resolved.
Added to #178's acceptance criteria as a review line, and the One thing for you: the SahajCloud frame editor previews this same route, so an editor placing frames now sees the line. Left visible, and raised on the thread. Lean gate on 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
Summary
useT(), so the player's message follows the viewer's locale.eslint-disable no-restricted-syntaxregion around the block is gone — the blocker it named is resolved.Change outline
Components — MeditationPlayer's upsell block
The sentence is the translated unit, not the words around the link. Each arm hands
t.richone%{link}node, the shapeErrorFallbackalready uses forerrors.general.status_page_hint.Each key is passed as a quoted literal on purpose —
tests/guards/translation-keys.test.tsmatches a literal first argument, so a computed key would drop both out of the guard that proves they resolve.Routes — the embed route asks for the line
upsellhad no caller, so the translated copy rendered only in Ladle.MeditationTemplatenowforwards the prop, and the embed route sets it:
The embed is the one route it belongs on: it runs inside someone else's page, so the link is the
visitor's one way back. On a route of ours it would point at the page they are already reading.
pages/meditations/[id]/embed/Page.test.tsxrenders the real template and player, not a stub, sodeleting the player's upsell block fails it too. Named without the
+for the reasonpages/map/Page.test.tsxrecords.Types — no change
The three keys were already in
server/payload-types.tsandlib/translations.en.json.pnpm sync:translationsagainst production reproduces the committed snapshot byte for byte, so nothing was hand-added.Preview
The story on the Ladle preview — the Web Upsell and App Upsell sections are this change.
Since
3c4b4ffit is also reachable on the site:/meditations/<id>/embedon the branch preview. The per-commit host is deliberately not quoted, because it freezes to one SHA.The earlier
Workers Builds: wemeditate-designfailure was not this change. The Ladle build could not load SWC on Workers Builds — filed as #233, fixed onmainby #236, which this branch has merged. Both Workers builds,Smoke (ladle)andSmoke (web)were green on1350180, andf93c0a1only changed a comment.3c4b4ffis the first commit since that both builds have to serve.Also verified against a local Ladle build driven through Playwright: both sections render "Find more meditations on wemeditate.com" →
https://wemeditate.com/meditationsand "Find interactive meditations with meditation music in our free app" →https://wemeditate.com/app, both opening in a new tab, with no React key warning in the console.Test results
.claude/skills/pr-prep/check.shon3c4b4ff— lint (0 errors),tsc --noEmit, 98 files / 959 testscomponents/organisms/MeditationPlayer/, 2 inpages/meditations/[id]/embed/upsell="web"from the route fails itpnpm ladle:build(exit 0) onf93c0a1.pnpm buildN/A — no build/server/Wrangler path touchedManual verification
/meditations/<id>/embedon the branch preview and confirm the line sits under the player, linking towemeditate.com/meditations.Smoke (web)already fetches that route, but asserts only that it renders bare./meditations/<id>still shows no upsell line.The locale assertion stays automated in
MeditationPlayer.locale.test.tsx.Notes for reviewer
The link destinations deliberately stay English and absolute. The copy is now locale-aware; the URL is not. That asymmetry is intentional and was checked against the live site rather than inferred:
wemeditate.comanswers withvia: 2.0 heroku-router, so it is the legacy Rails app on its own origin, not this Worker. It localizes its own slugs —/fr/méditations,/de/meditation,/it/meditazioni— a spellinglib/urls.tscannot derive, and/fr/meditations404s. Routing these throughlocaleHrefwould send a French reader to a dead page.The constant's comment records that, and
f93c0a1adds the trigger it was missing. The repo's ownORIGINfixtures spell this same domain, so once this app serveswemeditate.comthe asymmetry inverts:Linkpasses an absolute same-origin URL through untouched (#124), and both links become unprefixed self-links in every locale, silently. Theshortcut:line names that cutover as the point to route them throughlocaleHref.The frame editor previews the same route.
/meditations/<id>/embedis what SahajCloud's frame editor points at, so an editor placing frames now sees the upsell line too. Left visible: it is what a visitor sees, and hiding it would mean a second condition onpreviewingThisMeditation. Raised on the question thread for the reviewer to decide.Dismissed review findings:
t.richwith a looked-up key. Rejected: it makes the key an expression, andtranslation-keys.test.ts'sCALL_PATTERNonly sees a quoted literal, so both keys would silently lose their coverage.trackfixture duplicatesMeditationPlayer.test.tsx's. Kept: every.locale.test.tsxin the repo inlines its own props, and importing from a sibling test file would pull itsdescribeblocks in.Contract step skipped.
pnpm types:cmswas not run: the three fields are already inserver/payload-types.ts, and the only upstream drift is unrelated (transcriptionprovider/language), already carried by the open re-sync PR #230.Detail
Blockers verified by value, not by key name. The ticket warned that closing sydevs/SahajCloud#917 was not sufficient, because its migration declares the keys without filling them, and that a recheck must read the key values. A read of
GET /api/globals/wm-web-translations?locale=en&depth=0&select[meditation]=trueagainstcloud.sydevelopers.comreturned_status: publishedwith all three keys populated in English. sydevs/SahajCloud#918 is closed.Fixture pre-mortem.
MeditationPlayer.locale.test.tsx'sFRENCHfixture assumes%{link}is the placeholder spelling the accessor splits on, and that the three keys sit undermeditation.general. Both verified againstlib/i18n.ts(RICH_PLACEHOLDER) and the regeneratedlib/translations.en.json. The fixture spreadsEN_TRANSLATIONS, so it needs no cast and stays valid ifWebTranslationsgains a required branch.Why the domain is a constant rather than a literal.
wemeditate.comis a brand name carrying no translation key — the upstream description forupsell_websays the placeholder is "a link whose text is the domain wemeditate.com, which stays as it is." Holding it in an identifier also gives the domain one home: it was spelled three times in the first draft, and both hrefs now compose from the constant.Security review skipped — no changed path matches
securityReview.triggerPattern. Docs checked, nothing stale.Closes #178
🤖 Generated with Claude Code
https://claude.ai/code/session_01Mg9rjWK2gxnsAdExBmBv4o