Repository navigation
feat(translations): CMS-owned labels for the We Meditate video player - #775
Conversation
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
|
🚅 Deployed to the SahajCloud-pr-775 environment in sahajcloud
1 service not affected by this PR
|
|
🤖 no session running recent dispatchesWritten by the sydevs dispatcher. Sessions never edit this comment. |
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 Adversarial review
No larger than its ticket: 35 keys, no new tab, no migration. I re-measured the body's claims against @vidstack/[email protected]; all held, including the 5 words WMW#82 wrongly counted reachable. The video_ prefix and the general/a11y split are right calls.
Worth weighing: +35 keys is +26% on this bank (135 → 170) — 18 locales × 35 cells of translation, a third in the Caption Styles submenu, shown only when a video carries captions.
Findings
should-fix— six of the seven reused bank keys say "not shown on screen", yet Vidstack renders them as visible tooltips.consider— a key the CMS lacks renders as its key path, not Vidstack's English.
Checked: WMW#82, the body, the whole diff. src/globals/AGENTS.md (a11y wording, key naming, JSON-per-leaf-group: "no migration" is right); tests/unit/wm-web-translations-seed.spec.ts pins seed ↔ schema; consumer VideoPlayer.tsx:219 and lib/i18n.ts:202; the tarball's 56-word union, the 43 words the default layout uses, each button's aria-label vs its tooltip.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
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
|
Both adversarial-review threads addressed. Pushed 7611aa9.
Lean gate green. The three translations integration lanes pass, 52 tests. 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
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
Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SxXsSwv1xCqgGFpy2DG3Ca
|
Review addressed. Pushed e7c5bda.
Two consequences worth naming:
Lean gate green. The three translations integration lanes pass, 52 tests. Two exact-set pins in 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
Summary
videotab holding 41 keys, so the We Meditate video player's controls stop rendering Vidstack's built-in English.Changes
src/globals/WeMeditateWebTranslations/translationsSchema.json— a newvideotab between Media and Location, with 38 keys invideo.generaland 3 invideo.a11y.media's description goes back to naming the music player, cards, images and the embed popover.seeds/wm-web-translations/data.en.json— English for all 41, seeded as Vidstack's own phrasing so English output is unchanged.src/migrations/20260913_212558_wm_web_translations_video_tab.{ts,json}— the two new JSON columns, plus their_vtwins.tests/int/translations-globals.int.spec.ts— the tab list and the leaf-group list both pin an exact set, so both namevideonow.src/globals/AGENTS.md— the Web tab list names Video.src/payload-types.ts— regenerated.Preview
Contract impact
Two new generated interfaces,
WmWebTranslationsVideoGeneralStringsandWmWebTranslationsVideoA11YStrings. The twoMediainterfaces are back to their pre-PR shape.pnpm types:cmsagainstmain, so its half cannot start until this merges. Its map readsvideo.general.*andvideo.a11y.*, plus the one reusedmedia.a11y.volume.createTreturns the key path on a miss (WeMeditateWeb/lib/i18n.ts:202), and Vidstack's owni18n(translations, word) => translations?.[word] ?? wordnever fires on a non-empty string — so the settings menu would readvideo.general.settings. The order is therefore fixed: deploy this, runpnpm seed translationson production, thenpnpm sync:translationsin WeMeditateWeb. WMW#82 ships the map, so nothing reads these keys until it lands.mediatab.Test results
wm-web-translations-seed,translations-field,translations-globalsintegration lanes) — the seed spec writes all 41 keys to a real database, through the new columnsmigration-validator→ 4 pass, 1 warn (theDROP COLUMNindown, which is what makes it reversible)Manual verification
Notes for reviewer
Two judgement calls worth checking:
video_prefix with the move. The prefix existed to separate them from the music player's keys insidemedia; the tab does that now, so keeping it would repeat the tab name in all 41 keys.Off,AutoandColorread fine under a tab called Video.media.a11y.volumestays reused rather than copied intovideo.a11y. It names the volume slider for both players, the wording is identical, and a copy would ask 18 locales to translate one word twice. Say so if you would rather the tab be self-contained — it is one key.The
general/a11ysplit is unchanged and still measured per word: a word sits ina11yonly where the layout uses it as anaria-labeland never shows it. Three qualify —Fullscreen,PiPandSeek, which name the fullscreen button, the picture-in-picture button and the progress bar while their tooltips show different words.No review toolkit ran:
/pr-review-toolkit:review-pris not installed in this environment.Detail
Why nothing upstream could be reused.
@vidstack/[email protected]ships no locale data — the published tarball carries no locale, i18n or translation file, and its only JSON files arepackage.jsonandanalyze.json. The resolver isi18n(translations, word) => translations?.[word] ?? word, so the English phrase is both the key and the fallback for every missing word.The 1 already in the bank, down from 7.
media.a11y.volumealone.DefaultVolumeSliderpasses it asaria-labeland renders no tooltip, so the bank's "Not shown on screen; read by screen readers" holds for it.The other six failed that test and are now
video.general.play,pause,mute,unmute,enter_fullscreenandexit_fullscreen.DefaultPlayButton,DefaultMuteButtonandDefaultFullscreenButtoneach pass those words asDefaultTooltipcontent — visible text a viewer reads, whatever they also do as anaria-label. Reusingmedia.a11y.playwould have told a translator the opposite of the truth, andblocks.a11y.enter_fullscreennames the subtle-system diagram's button, in lowercase. WMW#82 resolved to reuse all seven without that measurement.The 14 left out, measured against the package rather than assumed.
Nine need a loader, a prop or a live stream this player does not configure:
AirPlay,Google Cast,Connected,Connecting,Disconnected(the last three are Cast connection states),Download,LIVE,Skip To Live,Chapters.Five the ticket had counted as reachable and are not.
LoopandPlaybackappear nowhere invidstack-default-components.js.Disabledappears only invidstack-plyr-layout.js, and this player does not use the Plyr layout.ReplayandContinueappear only inDefaultAudioTitle, part ofDefaultAudioLayout, while the site mountsDefaultVideoLayout(WeMeditateWeb/components/molecules/VideoPlayer/VideoPlayer.tsx:219). That takes the reachable set from 47 to 42, so 42 reachable words are 41 new keys plus the one reused.DefaultLayoutProps.translationsisPartial<>, so every omitted word keeps Vidstack's English. Enabling one of those features later adds its key then.One word cannot be typed at all. The audio-gain slider calls
useDefaultLayoutWord("Audio Boost"), and"Audio Boost"is not a member ofDefaultLayoutWord— the union hasAudioandBoostseparately. A typed map cannot carry it, so that slider keeps English whatever this PR does. Upstream bug, recorded rather than worked around.Why there is a migration now, and there was not before. Each leaf group is one localized JSON column. Keys inside
media_generalandmedia_a11ychanged only that column's JSON Schema; a new tab is two new columns, sovideo_generalandvideo_a11yneed DDL, in both the live table and its_vtwin.⚠ The generated delta carried four unrelated tables with it, and they were trimmed. #765's per-locale
_statusmove forpagesandapp-cardsshipped as20260911_235823, but the snapshot committed after it (20260912_031449) predates that state, so drizzle re-derives the same DDL on every migration generated since — the documented out-of-order snapshot trap. Replayed on production it fails on a column that already exists. The committed.jsonsnapshot does carry that state, so the next migration stops re-deriving it.Announcer labels need nothing extra.
DefaultVideoLayoutmountsDefaultAnnouncer, which renders<MediaAnnouncer translations={translations} />from the same layout context — so the 12MediaAnnouncerWordlabels, all of them already among the 56, are covered by the one prop the consumer passes.Part of sydevs/WeMeditateWeb#82. Does not close it — the consumer half follows once this merges.
🤖 Written by the sydevs autonomous loop — see what this is
🤖 Generated with Claude Code
https://claude.ai/code/session_01SxXsSwv1xCqgGFpy2DG3Ca