Skip to content

feat(translations): add a name for the audio player's progress slider - #1241

Closed
sydevs-bot wants to merge 3 commits into
mainfrom
claude/feat-1222-wm-web-progress-key
Closed

sydevs-bot wants to merge 3 commits into
mainfrom
claude/feat-1222-wm-web-progress-key

Conversation

@sydevs-bot

@sydevs-bot sydevs-bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Declares, seeds and migrates one key, media.a11y.progress (English Playback position), so WeMeditate Web can name its audio player's seek slider.
  • Pins the a11y description convention in the seed spec — four files state it, all 60 keys honour it, nothing checked it.
  • Corrects the WeMeditate Web tab count in tests/COVERAGE.md, stale since chore(translations): drop WeMeditate Web's unused video tab #1217 dropped the video tab.

Change outline

The key is declared once, then has to reach three readers that each come at the schema differently: the admin field tree, the seed a fresh database loads, and the rows an existing database already holds.

Contract — the key, as each reader sees it

 src/globals/WeMeditateWebTranslations/translationsSchema.json
   media.a11y
     volume        "…Names the player's volume slider."
+    progress      "…Names the player's progress slider, which moves playback within the track."
                   # no maxLength, no plural: the string occupies no on-screen slot

 seeds/wm-web-translations/data.en.json          # a fresh database only
   media.a11y
     volume        "Volume"
+    progress      "Playback position"
+  _meta.schema_version   post-#1222 (13 tabs, 23 leaf groups, 157 declared keys)

 src/payload-types.ts                            # generated
   WmWebTranslationsMediaA11YStrings
+    progress?: string

Flow — the migration, which is what an existing database gets

media_a11y is an existing jsonb column, so the generator writes no DDL. The seed never reaches a database that already exists, and clientEnglishFallback fills a blank key from English, so English has to actually hold it.

 up()                                            src/migrations/20261120_223700_wm_web_progress_key.ts
   addKey('progress', 'Playback position')
     wm_web_translations_locales.media_a11y
       WHERE _locale = 'en'                      # English only
         AND jsonb_typeof(col) = 'object'        # a scalar column would become an array
         AND NOT col ? 'progress'                # never overwrite a word somebody chose
     _wm_web_translations_v_locales.version_media_a11y
       same, AND _parent_id IN (… WHERE latest)  # an update loads from the latest row

 down()
   dropKey('progress')
     both tables, every locale, every version row
     WHERE jsonb_typeof(col) = 'object' AND col ? 'progress'

down sweeps wider than up wrote on purpose: the previous schema declares no progress, and the group is additionalProperties: false, so a value left anywhere would refuse every later save of the global.

Behaviour — the convention check, inside an existing spec

 tests/unit/wm-web-translations-seed.spec.ts
   keys = declaredKeys()                         # already carries prop.description + dotted path
   …
   names every placeholder it uses in that key's description
+  opens every a11y description with the screen-reader sentence
+    filter path contains '.a11y.'               # 60 keys today
+    floor: the filtered set is non-empty
+    offenders: description not starting with the sentence

Preview

The diff touches no path under fixture.surfacePaths, and a global is a singleton with no fixture record to cite.

Contract impact

src/payload-types.ts gains progress?: string on WmWebTranslationsMediaA11YStrings. Both type consumers re-sync after this merges — sydevs/WeMeditateWeb and sydevs/SahajAtlasWeb — in the bot's contractSync PR.

The waiting consumer is sydevs/WeMeditateWeb#289, which carries the Blocked by: line pointing at #1222. Its pnpm types:cms and pnpm sync:translations both read SahajCloud main, never a branch, so this merges first.

Migration

  • New migration: src/migrations/20261120_223700_wm_web_progress_key.ts
  • Impact: no DDL. Writes one jsonb key into wm_web_translations_locales.media_a11y and the latest: true rows of _wm_web_translations_v_locales.version_media_a11y, English only, only where absent. The .json is 20261119_223756_merge_snapshot_heal.json re-stamped, which keeps the snapshot chain intact.
  • Reversible: yes — down drops the key from both tables, in every locale and every version row.

Test results

  • Lean gate: ✓ .claude/skills/pr-prep/check.sh — lint, format, typecheck, typecheck:tests, 3842 unit tests in 284 files, 127s
  • Targeted specs: ✓ tests/int/wm-web-translations-seed.int.spec.ts + tests/int/translations-globals.int.spec.ts, 43 passed. The first runs the real importer against a database, which is what proves Payload's per-column JSON Schema accepts the new key.
  • Contract step: ✓ timeout 300 pnpm db:migrations:create wm_web_progress_key --skip-empty < /dev/null — exit 0, no file written. Disambiguated against the newest committed snapshot rather than inferred from the empty result: media_a11y and version_media_a11y are both already in it. That is the proof the key needs no DDL.
  • Build: N/A — Railway builds the preview.
  • Each new assertion was watched failing first: the stale _meta count (156 against a derived 157), the absent seed value, and a description without the screen-reader sentence.

Manual verification

  1. Open the preview link and confirm a Playback position row sits under Media → Accessibility, below Volume.
  2. Save the global, to confirm the key is accepted on write and not only on seed.

Notes for reviewer

  • Two commits are not on the ticket. The convention check: the ticket's first acceptance criterion is a prose rule nothing could check, so a key added without the sentence would ship and read as ordinary copy in the admin. The COVERAGE.md tab count: stale one PR before this one. Each is its own commit.
  • The convention check is a spec, not a gate, deliberately. buildTranslationTabs runs inside payload.config.ts, so a throw there turns a mis-worded translator hint into a dead admin panel and a failed deploy — and the description reaches the column's JSON Schema as a plain description keyword, which Ajv validates data against but never checks itself. Checkable rather than enforced matches SUBGROUP_PRESENTATION being the one presentational override.
  • One finding filed rather than fixed here. The targets/latestOnly/addKey/dropKey block is now a fourth hand copy across this folder, and the copies have drifted over which guard is load-bearing — 20261118_231500's dropKey guards on ? key alone and says ? is what keeps a scalar out, while 20261118_233000's and this one add jsonb_typeof = 'object' and say that clause is. Measured on PG 16.15, the second story is the right one: '"progress"'::jsonb ? 'progress' is true, and - then raises cannot delete from scalar, so ? key alone does not keep a scalar out. refactor(migrations): settle one home for the English-key backfill SQL #1242 holds that finding, with decision 1A — one helper under src/lib/translations/, and these four copies left alone.
  • Dismissed: a review pass suggested moving per-key provenance out of _meta.source into each key's description. Declined — feat(translations): add common.a11y.menu for WeMeditate Web #1216 set the convention of appending a sentence there for a key that replaces no literal, and this file is the only place that record exists.
Detail

Why up writes English only. clientEnglishFallback serves English for a key a locale leaves blank, so the one English value covers every locale, and writing a locale's column would put English words in it. A translator fills the rest in the admin.

Why both tables. A global's update loads the document it is about to change from the latest: true version row, so a key written only to the main row comes back missing on the next save.

Considered and declined: making the seed do this instead. seeds/translations/import.ts writes wm-web English wholesale, so pnpm seed translations against production would overwrite any English wording an editor has since changed — the migration's "only where English lacks the key" is strictly narrower. The importer does hold a fillBlanks mode, used for the two Atlas groups that carry live data, and giving the wm-web path that mode would retire this migration genre; it also costs a signed-in run per deploy and would revive a key an editor deliberately blanked, which NOT col ? key does not. That is why the carve-out exists.

Rejected: a maxLength. Every other media.a11y key goes without one, the string renders in no on-screen slot, and the slider's own value carries the position.

Verified locally, end to end. pnpm seed translations against an isolated dev database, then GET /api/globals/wm-web-translations?locale=en returned "progress": "Playback position" under media.a11y. Two notes from that run, neither caused by this change: an isolated dev database starts with no manager, so scripts/create-manager.ts has to run before auto-login resolves anyone; and dev-server.sh teardown could not drop the database afterwards, with two sessions still attached.

The COVERAGE.md diff is 13 lines for two edits. Prettier re-pads the whole table's column widths when any cell's width changes.

Closes #1222

🤖 Generated with Claude Code

https://claude.ai/code/session_01Mg9rjWFqDQB1ktoGWtxnBY

WeMeditate Web's audio player draws its seek slider with no accessible name,
which axe reports as `label` on the live `/music-for-meditation` page
(sydevs/WeMeditateWeb#289, #1222). Every word that site
renders — an `aria-label` included — comes from this repo's translations
global, so the key lands here first.

One key, `media.a11y.progress`, English `Playback position`. No `maxLength`
and no placeholder: the string occupies no on-screen slot, and the slider's
own value carries the position. `media.a11y.volume` already names the volume
slider in the same component, so this is the last unnamed control there.

`timeout 300 pnpm db:migrations:create wm_web_progress_key --skip-empty`
writes no file: a leaf group is one jsonb column and `media_a11y` already
exists. But the seed reaches only a fresh database, and a key English does not
hold reaches no locale, since `clientEnglishFallback` fills a blank key from
English — so the value ships as a data-only migration, following
20261118_233000_wm_web_menu_key.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjWFqDQB1ktoGWtxnBY
`src/globals/AGENTS.md` requires an `a11y` key's description to open with
"Not shown on screen; read by screen readers." — the only cue a translator has
that the string is invisible, and what sets the register they write in. Four
files repeat the rule and all 60 keys honour it, but nothing checked it, so a
key added without the sentence ships and reads as ordinary copy in the admin.

It goes in the seed spec because that file already resolves every declared key
to its dotted path and its description, through the shared walker, and already
holds a description convention — the `%{placeholder}` case. A spec of its own
would have been a second walk with its own narrower nesting assumption.

Enforcing this in `buildTranslationTabs` instead would be the wrong depth
twice over: it runs inside `payload.config.ts`, so a throw turns a mis-worded
translator hint into a dead admin panel, and the description reaches the
column's JSON Schema as a plain `description` keyword, which Ajv never checks.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjWFqDQB1ktoGWtxnBY
The coverage map claimed fourteen tabs for `wemeditate-web/translations`.
#1217 dropped the unused video tab, leaving thirteen, and the map was not
updated with it.

The seed row also now names the a11y description case, since that row is what
says which schema claims the spec holds. The rest of the table's diff is
Prettier re-padding the column widths.

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

railway-app Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

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

Service Status Web Updated
SahajCloud ❌ Build Failed (View Logs) Web Nov 20, 2026 at 11:23 pm UTC
1 service not affected by this PR
  • mailpit

@sydevs-bot

sydevs-bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 no session running
CI re-run 1 on 08daa33 — infrastructure, not the change

recent dispatches
  • 23:46Z address-review · attempt 1 · session · done
  • 23:46Z address-review · attempt 1 · session
  • 23:39Z review-pr · attempt 1 · session · done
  • 23:39Z review-pr · attempt 1 · session
  • 23:35Z fix-ci · attempt 1 · session · done

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

@sydevs-bot

Copy link
Copy Markdown
Contributor Author

Not required, so not blocking: sahajcloud - SahajCloud failed. A preview link in the body may not open until it passes.

🤖 sydevs dispatcher

@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 20, 2026
@sydevs-bot sydevs-bot moved this from Pending to Working in SYDevelopers Technical Roadmap Nov 20, 2026
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

The Railway preview build failed, and its log cannot be read. This pass pushes nothing.

  • Failed deployment: [ˋsahajcloud - SahajCloudˋ](https://railway.com/project/bdff2c72-5af2-4da3-9e2c-913f5e9d1b0f/service/1edee955-6c1f-4d8e-9cef-41737f981187?id=a6e46d7d-7c53-496f-a4ce-3a16a56e2d11&environmentId=1f32b103-869a-4936-af6d-12d8334590f2) — "Deployment failed", 23:23:52Z
  • RAILWAY_TOKEN is set, but Railway's GraphQL API answers Not Authorized. buildLogs, deploymentLogs and a bare me { id } all return it.

Without a log there is no cause to fix. Every required check on 08daa33 is green, so the red status is the preview alone. Open the deployment link to read the build output.

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


Generated by Claude Code

@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 Nov 20, 2026

@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 ticket's four steps and nothing more. Both extra commits join: the spec case checks the ticket's own first acceptance criterion, which was prose nothing could verify, and the COVERAGE.md row it edits is the one describing that spec.

The migration is a fourth hand copy of the targets/addKey/dropKey block. #1242 already holds that aggregate question — rightly, since a shared helper would make a migration import a mutable module for the first time in this folder.

The contract holds end to end. WeMeditateWeb/lib/translations.en.json carries media.a11y.volume and no progress, so sydevs/WeMeditateWeb#289 gets the key through sync:translations once this is on main.

Findings

  • consider — migration .ts:55: dropKey's JSDoc credits jsonb_typeof with keeping a scalar out, but ? key already does; the typeof clause excludes an array. Inline.

What was checked

  • Profile read. #1222's five acceptance criteria all met.
  • Derived from the branch's schema: 13 tabs, 23 leaf groups, 157 keys, 60 .a11y. keys, every description opening with the convention sentence. _meta.schema_version and the "thirteen tabs" edit both match.
  • The new .json is byte-identical to 20261119_223756_merge_snapshot_heal.json, which is what a data-only migration asks for and what the three prior copies did. media_a11y, version_media_a11y and _wm_web_translations_v.latest are all in it.
  • Read wm-web-translations-seed.spec.ts whole: the new case reuses declaredKeys() and adds no helper. Both sibling translations schemas declare zero .a11y. keys, so no sibling is left outside.
  • Every path the body names exists on the branch. The preview link is ON_HOST; the diff touches no fixture.surfacePaths. The Railway preview build failed, so neither manual step can run from that link yet.

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


Generated by Claude Code

@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 Nov 20, 2026
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

One thread, rebutted. Nothing pushed.

  • The dropKey guard thread — rebutted and resolved. Measured on PG 16.15: '"progress"'::jsonb ? 'progress' is true, and - 'progress' then raises cannot delete from scalar. A string scalar equal to the key passes ?, so the JSDoc credits the right clause. The array case the review names is real, and additional rather than unique.
  • No commit: refactor(migrations): settle one home for the English-key backfill SQL #1242 already holds this measurement, and decision 1A freezes these four copies and corrects src/globals/AGENTS.md there.
  • The body's "Both are correct SQL" note was false. It now carries the measurement.
  • Merged origin/main cleanly, and kept it local — a clean merge alone re-runs CI and answers nobody.

🤖 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 Nov 20, 2026
@sydevs-bot
sydevs-bot marked this pull request as ready for review November 20, 2026 23:55
@sydevs-bot
sydevs-bot requested a review from Ardnived November 20, 2026 23:55
@sydevs-bot
sydevs-bot enabled auto-merge November 20, 2026 23:55
@sydevs-bot sydevs-bot moved this from Working to Awaiting in SYDevelopers Technical Roadmap Nov 20, 2026
@Ardnived

Copy link
Copy Markdown
Contributor

Closing: superseded by a new approach to screen-reader strings. They no longer live in SahajCloud; each site owns its own, machine-translated, in its repo. media.a11y.progress ("Playback position") now ships in sydevs/WeMeditateWeb#328 with all 17 translations, and #1246 removes every remaining a11y group from the translations globals. WeMeditateWeb#289 can read the key once #328 merges, with no SahajCloud step.

@Ardnived Ardnived closed this Nov 21, 2026
auto-merge was automatically disabled November 21, 2026 04:02

Pull request was closed

@sydevs-bot sydevs-bot moved this from Awaiting to Done in SYDevelopers Technical Roadmap Nov 21, 2026

This branch had an error being deployed

1 failed deployment
sahajcloud / SahajCloud-pr-1241 — 08daa336 Deployed Nov 20, 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 a name for the audio player's progress slider

3 participants