Skip to content

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

Merged
sydevs-bot merged 4 commits into
mainfrom
claude/feat-wmw-82-vidstack-control-labels
Sep 14, 2026
Merged

sydevs-bot merged 4 commits into
mainfrom
claude/feat-wmw-82-vidstack-control-labels

Conversation

@sydevs-bot

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

Copy link
Copy Markdown
Contributor

Summary

  • Adds a video tab holding 41 keys, so the We Meditate video player's controls stop rendering Vidstack's built-in English.
  • Keys are ours, not Vidstack's: its keys are the English phrases themselves, so WeMeditateWeb owns a typed phrase-to-key map and this side owns the copy.
  • Leaves out 15 of Vidstack's 56 words: 1 the bank already renders, 14 this player cannot reach.

Changes

  • src/globals/WeMeditateWebTranslations/translationsSchema.json — a new video tab between Media and Location, with 38 keys in video.general and 3 in video.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 _v twins.
  • tests/int/translations-globals.int.spec.ts — the tab list and the leaf-group list both pin an exact set, so both name video now.
  • src/globals/AGENTS.md — the Web tab list names Video.
  • src/payload-types.ts — regenerated.

Preview

Contract impact

Two new generated interfaces, WmWebTranslationsVideoGeneralStrings and WmWebTranslationsVideoA11YStrings. The two Media interfaces are back to their pre-PR shape.

  • feat(i18n): CMS-owned labels for the Vidstack video controls WeMeditateWeb#82 is the consumer, and is blocked on this. It runs pnpm types:cms against main, so its half cannot start until this merges. Its map reads video.general.* and video.a11y.*, plus the one reused media.a11y.volume.
  • The production seed is what a viewer sees, not a snapshot chore. A key the CMS lacks does not fall back to Vidstack's English: createT returns the key path on a miss (WeMeditateWeb/lib/i18n.ts:202), and Vidstack's own i18n(translations, word) => translations?.[word] ?? word never fires on a non-empty string — so the settings menu would read video.general.settings. The order is therefore fixed: deploy this, run pnpm seed translations on production, then pnpm sync:translations in WeMeditateWeb. WMW#82 ships the map, so nothing reads these keys until it lands.
  • No other consumer reads the media tab.

Test results

  • Lean gate: ✓ lint, typecheck, typecheck:tests, 1924 unit tests
  • Targeted specs: 52 passed (wm-web-translations-seed, translations-field, translations-globals integration lanes) — the seed spec writes all 41 keys to a real database, through the new columns
  • Migration: migration-validator → 4 pass, 1 warn (the DROP COLUMN in down, which is what makes it reversible)
  • Build: N/A (Railway builds the preview)

Manual verification

  1. Open Translations → Video in the admin. 38 rows sit under Visible on screen, and Accessibility holds 3 more, still collapsed.
  2. Open Translations → Media. It holds only the music player, card, image and embed rows it held before this PR.

Notes for reviewer

Two judgement calls worth checking:

  • The keys dropped their video_ prefix with the move. The prefix existed to separate them from the music player's keys inside media; the tab does that now, so keeping it would repeat the tab name in all 41 keys. Off, Auto and Color read fine under a tab called Video.
  • media.a11y.volume stays reused rather than copied into video.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 / a11y split is unchanged and still measured per word: a word sits in a11y only where the layout uses it as an aria-label and never shows it. Three qualify — Fullscreen, PiP and Seek, 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-pr is 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 are package.json and analyze.json. The resolver is i18n(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.volume alone. DefaultVolumeSlider passes it as aria-label and 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_fullscreen and exit_fullscreen. DefaultPlayButton, DefaultMuteButton and DefaultFullscreenButton each pass those words as DefaultTooltip content — visible text a viewer reads, whatever they also do as an aria-label. Reusing media.a11y.play would have told a translator the opposite of the truth, and blocks.a11y.enter_fullscreen names 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. Loop and Playback appear nowhere in vidstack-default-components.js. Disabled appears only in vidstack-plyr-layout.js, and this player does not use the Plyr layout. Replay and Continue appear only in DefaultAudioTitle, part of DefaultAudioLayout, while the site mounts DefaultVideoLayout (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.translations is Partial<>, 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 of DefaultLayoutWord — the union has Audio and Boost separately. 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_general and media_a11y changed only that column's JSON Schema; a new tab is two new columns, so video_general and video_a11y need DDL, in both the live table and its _v twin.

⚠ The generated delta carried four unrelated tables with it, and they were trimmed. #765's per-locale _status move for pages and app-cards shipped as 20260911_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 .json snapshot does carry that state, so the next migration stops re-deriving it.

Announcer labels need nothing extra. DefaultVideoLayout mounts DefaultAnnouncer, which renders <MediaAnnouncer translations={translations} /> from the same layout context — so the 12 MediaAnnouncerWord labels, 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

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
@railway-app

railway-app Bot commented Sep 13, 2026 •

Copy link
Copy Markdown

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

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

@sydevs-bot

sydevs-bot commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 no session running

recent dispatches
  • 21:18Z address-review · attempt 1 · session · done
  • 21:18Z address-review · attempt 1 · session
  • 17:35Z address-review · attempt 1 · session · done
  • 17:35Z address-review · attempt 1 · session
  • 17:24Z adversarial-review · 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

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

Comment thread seeds/wm-web-translations/data.en.json 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 13, 2026
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
@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-775 September 13, 2026 17:41 Destroyed
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

Both adversarial-review threads addressed. Pushed 7611aa9.

  • Adopted (should-fix) — six words left the a11y bank for media.general: video_play, video_pause, video_mute, video_unmute, video_enter_fullscreen, video_exit_fullscreen. Vidstack renders each as visible tooltip text, so the bank's "not shown on screen" was wrong for them. Only media.a11y.volume is still reused. New keys: 41, up from 35.
  • Adopted (consider) — body only. Contract impact now states that a missing key renders its key path, not Vidstack's English, and pins the order: deploy, seed production, then sync.

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

@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Sep 13, 2026
@sydevs-bot
sydevs-bot marked this pull request as ready for review September 13, 2026 17:51
@sydevs-bot
sydevs-bot requested a review from Ardnived September 13, 2026 17:51
Comment thread seeds/wm-web-translations/data.en.json Resolved
@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 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
@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-775 September 13, 2026 21:30 Destroyed
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

Review addressed. Pushed e7c5bda.

  • Adopted (thread) — the 41 keys left media for their own video tab, between Media and Location. The video_ prefix went with them, since the tab disambiguates Off, Auto and Color now. media's description is back to what it said before this PR.

Two consequences worth naming:

Lean gate green. The three translations integration lanes pass, 52 tests. Two exact-set pins in translations-globals.int.spec.ts name the new tab.

🤖 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 13, 2026
@sydevs-bot
sydevs-bot merged commit 4847641 into main Sep 14, 2026
22 checks passed
@sydevs-bot
sydevs-bot deleted the claude/feat-wmw-82-vidstack-control-labels branch September 14, 2026 04:26
@sydevs-bot sydevs-bot moved this from Revising to Done in SYDevelopers Technical Roadmap Sep 14, 2026

This branch was successfully deployed

No deployments
sahajcloud / SahajCloud-pr-775 — e7c5bdaf Deployed Sep 13, 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.

3 participants