Repository navigation
feat(translations): add a name for the audio player's progress slider - #1241
sydevs-bot wants to merge 3 commits into
Conversation
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
|
🚅 Deployed to the SahajCloud-pr-1241 environment in sahajcloud
1 service not affected by this PR
|
|
🤖 no session running recent dispatchesWritten by the sydevs dispatcher. Sessions never edit this comment. |
|
Not required, so not blocking: 🤖 sydevs dispatcher |
|
The Railway preview build failed, and its log cannot be read. This pass pushes nothing.
Without a log there is no cause to fix. Every required check on 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 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 creditsjsonb_typeofwith keeping a scalar out, but? keyalready 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_versionand the "thirteen tabs" edit both match. - The new
.jsonis byte-identical to20261119_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_a11yand_wm_web_translations_v.latestare all in it. - Read
wm-web-translations-seed.spec.tswhole: the new case reusesdeclaredKeys()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 nofixture.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
|
One thread, rebutted. Nothing pushed.
🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
|
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. |
Summary
media.a11y.progress(EnglishPlayback position), so WeMeditate Web can name its audio player's seek slider.a11ydescription convention in the seed spec — four files state it, all 60 keys honour it, nothing checked it.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?: stringFlow — the migration, which is what an existing database gets
media_a11yis an existingjsonbcolumn, so the generator writes no DDL. The seed never reaches a database that already exists, andclientEnglishFallbackfills 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'downsweeps wider thanupwrote on purpose: the previous schema declares noprogress, and the group isadditionalProperties: false, so a value left anywhere would refuse every later save of the global.Behaviour — the convention check, inside an existing spec
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.tsgainsprogress?: stringonWmWebTranslationsMediaA11YStrings. Both type consumers re-sync after this merges —sydevs/WeMeditateWebandsydevs/SahajAtlasWeb— in the bot'scontractSyncPR.The waiting consumer is sydevs/WeMeditateWeb#289, which carries the
Blocked by:line pointing at #1222. Itspnpm types:cmsandpnpm sync:translationsboth read SahajCloudmain, never a branch, so this merges first.Migration
src/migrations/20261120_223700_wm_web_progress_key.tswm_web_translations_locales.media_a11yand thelatest: truerows of_wm_web_translations_v_locales.version_media_a11y, English only, only where absent. The.jsonis20261119_223756_merge_snapshot_heal.jsonre-stamped, which keeps the snapshot chain intact.downdrops the key from both tables, in every locale and every version row.Test results
.claude/skills/pr-prep/check.sh— lint, format, typecheck, typecheck:tests, 3842 unit tests in 284 files, 127stests/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.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_a11yandversion_media_a11yare both already in it. That is the proof the key needs no DDL._metacount (156 against a derived 157), the absent seed value, and a description without the screen-reader sentence.Manual verification
Notes for reviewer
COVERAGE.mdtab count: stale one PR before this one. Each is its own commit.buildTranslationTabsruns insidepayload.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 plaindescriptionkeyword, which Ajv validates data against but never checks itself. Checkable rather than enforced matchesSUBGROUP_PRESENTATIONbeing the one presentational override.targets/latestOnly/addKey/dropKeyblock is now a fourth hand copy across this folder, and the copies have drifted over which guard is load-bearing —20261118_231500'sdropKeyguards on? keyalone and says?is what keeps a scalar out, while20261118_233000's and this one addjsonb_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 raisescannot delete from scalar, so? keyalone 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 undersrc/lib/translations/, and these four copies left alone._meta.sourceinto each key'sdescription. 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
upwrites English only.clientEnglishFallbackserves 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: trueversion 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.tswrites wm-web English wholesale, sopnpm seed translationsagainst 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 afillBlanksmode, 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, whichNOT col ? keydoes not. That is why the carve-out exists.Rejected: a
maxLength. Every othermedia.a11ykey 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 translationsagainst an isolated dev database, thenGET /api/globals/wm-web-translations?locale=enreturned"progress": "Playback position"undermedia.a11y. Two notes from that run, neither caused by this change: an isolated dev database starts with no manager, soscripts/create-manager.tshas to run before auto-login resolves anyone; anddev-server.sh teardowncould not drop the database afterwards, with two sessions still attached.The
COVERAGE.mddiff 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