Skip to content

refactor(translations): no global declares a screen-reader-only string - #1246

Merged
Ardnived merged 6 commits into
mainfrom
claude/a11y-strings-leave-sahajcloud
Nov 22, 2026
Merged

Ardnived merged 6 commits into
mainfrom
claude/a11y-strings-leave-sahajcloud

Conversation

@Ardnived

@Ardnived Ardnived commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

⚠ Merge order: this goes first. sydevs/WeMeditateWeb#328 and sydevs/SahajAtlasWeb#456 follow, and neither carries code to set aside a SahajCloud copy: the server simply stops having these strings. Between this deploy and theirs, WeMeditate Web's aria-labels read as key paths (media.a11y.play) — the new site is not public yet — and the atlas widget falls back to its bundled English for the 13 keys.

Summary

  • wm-web-translations drops all ten a11y sub-groups (60 keys), and sy-atlas-translations drops 13 keys that are only ever spoken. Both sites now own these strings and machine-translate them, so translators no longer see them, and adding one no longer needs a schema change, migration and contract sync here.
  • tests/unit/translations-no-a11y.spec.ts holds that boundary for all three translations globals: no a11y group, and no key described as screen-reader-only. src/globals/AGENTS.md asks for that description, since it is the only one of the two checks that sees a spoken-only key under a group named for its view — the shape sy-atlas-translations had.
  • docs/rules/admin-ui.md no longer points a shorthand slug at the label override this diff removes.
  • SUBGROUP_PRESENTATION existed only to label a11y "Accessibility" and start it collapsed, so it goes too.

Change outline

Contract: the schemas, as each reader sees them

 src/globals/WeMeditateWebTranslations/translationsSchema.json
-  <tab>.a11y            ×10 (common, errors, article, meditation, lecture, map, forms, media, location, blocks)
 seeds/wm-web-translations/data.en.json
-  <tab>.a11y            ×10
~  _meta.schema_version  13 tabs, 13 leaf groups, 97 declared keys

 src/globals/SahajAtlasTranslations/translationsSchema.json   (+ the 10 seed locales)
-  calendar.{previous,next,pick_date}  common.chrome.{explore,loading}  common.settings.title
-  event.actions.{view_photo,pause_slideshow}  filters.chrome.remove  search.results.showing
-  search.nearby_prompt.dismiss  share.{share_on,copy_link}

 src/payload-types.ts   generated: the WmWebTranslations*A11YStrings interfaces and the 13 atlas properties removed

Flow: what an existing database gets

 20261121_035055_wm_web_drop_a11y_groups      generated DDL
   up    DROP COLUMN <tab>_a11y, version_<tab>_a11y         ×10 each
   down  ADD COLUMN … jsonb                                  (empty; values are not restored)

 20261121_035100_atlas_drop_a11y_keys         data only, snapshot re-stamped
   up    for each of the 13 (column, key):
           both tables, every locale, every version row
           SET col = col - key WHERE jsonb_typeof(col) = 'object' AND col ? key
   down  English back where absent: main en row + latest version row

The atlas groups keep their other keys, so their columns stay and only the keys are swept out. That sweep is required: each group is additionalProperties: false, so a key left behind in any row would refuse every later save of the global.

Migration

  • New migrations: src/migrations/20261121_035055_wm_web_drop_a11y_groups.{ts,json} (generated) and src/migrations/20261121_035100_atlas_drop_a11y_keys.{ts,json} (data only, whose .json is the first one's snapshot re-stamped).
  • ⚠ Data loss: the stored a11y values are discarded, in every locale. No consumer reads them after the two site PRs, and both sites ship their own translations.
  • Reversible in schema: the down migrations re-add the web columns empty and restore atlas English.
  • Probe: pnpm db:migrations:create probe --skip-empty < /dev/null wrote no files after both.

Contract impact

src/payload-types.ts loses the a11y interfaces and the 13 atlas properties. The bot's contractSync PRs in both consumers pick that up, and neither consumer breaks: WeMeditate Web mounts its own a11y type beside SahajCloud's, and every atlas key is optional in satisfies.

Test results

  • Lean gate: ✓ .claude/skills/pr-prep/check.sh: lint, format, typecheck, typecheck:tests, and 3852 unit tests in 286 files.
  • Targeted: ✓ tests/int/translations-globals.int.spec.ts, tests/int/wm-web-translations-seed.int.spec.ts and seeds/tests/atlas-translations-import.test.ts, 52 passed.
  • Atlas migration: run up then down against a throwaway Postgres holding en/de main rows, two version rows and a scalar column. up removed the keys from every row, kept their siblings and left the scalar alone. down restored English on the main en row and the latest version row only.
  • Watched failing first: translations-no-a11y.spec.ts fails both checks against main's web schema.

Manual verification

  1. Open the WeMeditate Web translations on the preview. No tab shows an Accessibility section.
  2. Save the Sahaj Atlas translations global. It saves, which proves the sweep left no undeclared key behind.

Notes for reviewer

🤖 Generated with Claude Code

Ardnived and others added 2 commits November 20, 2026 20:55
Screen-reader strings now live in the sites that render them, machine-
translated there: WeMeditate Web's lib/i18n/a11y/ and Sahaj Atlas's
src/config/a11y/. Both mount their own copy over anything this API still
serves, so the CMS copies are dead weight for translators.

- wm-web-translations drops its ten `a11y` sub-groups (60 keys). Generated
  DDL drops the twenty jsonb columns; the stored values go with them.
- sy-atlas-translations drops thirteen keys only ever spoken. Their groups
  keep other keys, so a data-only migration sweeps them out of every locale
  and version row, guarded against a scalar column; down restores English.
- The seeds, the generated types and the specs follow. SUBGROUP_PRESENTATION
  existed only to label and collapse `a11y`, so it goes too.
- translations-no-a11y.spec.ts holds the boundary for all three globals.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@railway-app

railway-app Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

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

Service Status Web Updated
SahajCloud 😴 Sleeping (View Logs) Web Nov 22, 2026 at 6:14 pm UTC
1 service not affected by this PR
  • mailpit

@sydevs-bot

sydevs-bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

🤖 no session running

recent dispatches
  • 04:33Z address-review · attempt 1 · session · done
  • 04:33Z address-review · attempt 1 · session
  • 04:22Z review-pr · attempt 1 · session · done
  • 04:22Z review-pr · attempt 1 · session

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

Ardnived added a commit that referenced this pull request Nov 21, 2026
… this PR

blocks.live_session.a11y_next_session is a string only a screen reader
speaks, and no translations global declares one any more (#1246): WeMeditate
Web carries it as blocks.a11y.next_session in its own a11y files
(sydevs/WeMeditateWeb#328). The schema, the seed, the copy migration and the
generated types drop it; the other seven keys are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ardnived added a commit that referenced this pull request Nov 21, 2026
…his PR

meditation.a11y.finder_region is a string only a screen reader speaks, and no
translations global declares one any more (#1246): WeMeditate Web carries it
in its own a11y files (sydevs/WeMeditateWeb#328). The schema, the seed, the
copy migration and the generated types drop it; the visible finder keys are
unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-1246 November 21, 2026 04:03 Destroyed
@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 21, 2026
@sydevs-bot sydevs-bot moved this from Pending to Working in SYDevelopers Technical Roadmap Nov 21, 2026

@sydevs-bot sydevs-bot left a comment

Copy link
Copy Markdown
Contributor

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 size of the problem and no larger: exactly 69 wm-web paths under a11y and exactly the 13 atlas keys leave the schemas, nothing else removed and nothing added, with the same 13 gone from each of the ten atlas seed locales. The premise holds — all 13 trace to an aria-label, an srLabel, a closeLabel or an sr-only live region in SahajAtlasWeb. Both migrations follow src/globals/AGENTS.md's retirement rules. The boundary this PR declares is weaker than the body claims, and that is the one finding worth acting on.

The merge-order note understates one step: WeMeditateWeb#328 is based on claude/reorg-layout, not main, so its deploy waits on that branch first.

Findings

  • should-fix — the new spec's screen-reader check matches a convention this same diff deletes, and never held sy-atlas-translations. tests/unit/translations-no-a11y.spec.ts:50
  • should-fix — docs/rules/admin-ui.md:206 still tells a reader a shorthand slug "needs its own label", with nothing left to give it one.
  • consider — the fourth hand copy of dropKey/addKey, against open #1242. src/migrations/20261121_035100_atlas_drop_a11y_keys.ts:49

What was checked

  • Schema key paths diffed as sets in both globals, and the ten seed diffs.
  • Each of the 13 atlas keys at its call site on SahajAtlasWeb main. search.results.showing reads as visible copy and is not — LoadMore.tsx:139 puts it in an sr-only role="status" region.
  • Migrations: all 8 atlas columns and their version_ twins present in the snapshot; up sweeps both tables and every version row, down restores English on the main row and latest only.
  • Every path the body names exists on the branch; the preview link is ON_HOST.
  • new-pieces.mjs returned NONE, so no streamliner ran. Ladder walked by hand: nothing new added.

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


Generated by Claude Code

Comment thread tests/unit/translations-no-a11y.spec.ts Resolved
Comment thread docs/rules/admin-ui.md 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 Nov 21, 2026
The new spec checks a description beginning "Not shown on screen", but the
rule asking an author to write it left with the a11y groups, so nothing
armed the check. The group-name check cannot see a spoken-only key under a
group named for its view, which is the shape the atlas schema had, so the
description check is the only one that catches it.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjVoonCEnRmLZif3QmR
The sentence told a reader a shorthand slug needs its own label, but the one
override it pointed at went with the a11y groups. A caller taking a label
still passes one; a translations sub-group takes none, so there the answer is
to name the slug in words.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjVoonCEnRmLZif3QmR
@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-1246 November 21, 2026 04:40 Destroyed
@sydevs-bot

Copy link
Copy Markdown
Contributor

Addressed the critic's three threads. Pushed a493855..31fd649.

Adopted

Rebutted

Body — the ⚠ merge-order note now names WeMeditateWeb#328's base, sydevs/WeMeditateWeb#327, which its deploy waits on.

No base merge needed. Lean gate green — lint, format, both typechecks, 3852 unit 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 Nov 21, 2026
@sydevs-bot sydevs-bot moved this from Working to Pending in SYDevelopers Technical Roadmap Nov 21, 2026

@sydevs-bot sydevs-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved for Ardnived, who wrote it: GitHub refuses an author's own approval. CI is green and the automated review has run. Enable auto-merge when you want it merged: the queue tests it against its base. 🤖 Written by the sydevs autonomous loop — see what this is

@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-1246 November 22, 2026 17:49 Destroyed
@Ardnived
Ardnived added this pull request to the merge queue Nov 22, 2026
Merged via the queue into main with commit debf409 Nov 22, 2026
10 checks passed
@Ardnived
Ardnived deleted the claude/a11y-strings-leave-sahajcloud branch November 22, 2026 18:20
sydevs-bot added a commit to sydevs/WeMeditateWeb that referenced this pull request Nov 22, 2026
@sydevs-bot sydevs-bot moved this from Awaiting to Done in SYDevelopers Technical Roadmap Nov 22, 2026
sydevs-bot added a commit to sydevs/SahajAtlasWeb that referenced this pull request Nov 22, 2026
sydevs-bot pushed a commit that referenced this pull request Nov 22, 2026
…ons-wisdom-sidetext

#1246 retired this global's ten a11y sub-groups, so the seed's `_meta` prose
and its quoted shape both moved under this branch. The conflict is `_meta`
alone: main's wording is the true one — no a11y key is declared here any more —
and the shape it quotes gains this branch's one key, 13 tabs, 13 leaf groups,
98 declared keys.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjYqULZrbvhm9F3pwHY
sydevs-bot pushed a commit that referenced this pull request Nov 22, 2026
#1246 retired every screen-reader-only group from `wm-web-translations`,
and its migration drops those jsonb columns. This branch's own a11y key
had already left it, so the two conflicts both resolve main's way:

- `data.en.json` keeps main's deleted `meditation.a11y` group deleted and
  its `_meta.source` prose, plus this branch's four `meditation.general`
  finder keys. `schema_version` is re-derived on the merged schema.
- `src/migrations/index.ts` takes main's two new entries; this branch's
  data-only migration writes `meditation_general` only, so it stays
  correct ahead of the a11y column drop.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjVaqvGwKPitKiowTG8
sydevs-bot pushed a commit that referenced this pull request Nov 22, 2026
…tdown-directory

main's #1246 withdrew every `a11y` group from the three translations globals, so
the four conflicts are all that collision with this branch's new
`blocks.live_session` group.

- `blocks.a11y` goes, `blocks.live_session` stays, in the schema's type, the
  seed file, the leaf-group spec and `src/payload-types.ts`. `pnpm
  generate:types` on the merged tree reproduces the hand resolution byte for
  byte.
- The collapsible spec takes main's shape — every sub-group opens, since
  SUBGROUP_PRESENTATION is gone — but not its `toBe('General')`: `blocks` now
  carries a second sub-group, which is what the leaf-group set already pins.
- `_meta.schema_version` is re-derived, not merged: 14 leaf groups and 104
  declared keys, as `translations-seed-meta.spec.ts` computes them.
- `src/migrations/index.ts` keeps both branches' migrations in timestamp order.

20261122_182623_merge_snapshot_heal_a11y_live_session heals the snapshot chain
again. main's two a11y drops carry later timestamps than this branch's
live-session migrations and their snapshots predate `blocks_live_session`, so
`migrate:create` on the merged tree re-emitted both of
20261119_230234_wm_web_live_session_keys' ADD COLUMNs — the #566 boot abort. Its
DDL is emptied and its snapshot kept, and a probe run now writes nothing.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjYK2WPg76HitzFZZHH
sydevs-bot pushed a commit that referenced this pull request Nov 22, 2026
Merging origin/main brought #1246, which deletes every a11y leaf group from
wm-web-translations. The spec seeded common.a11y, so its three table reads
hit a column that no longer exists and all seven cases failed on the merged
tree. common.general is the live sibling, and loading / show_more are both
declared, so the seed stays a write additionalProperties: false accepts.

Both guards were neutralised again on the new group and watched fail: the
write path lost two cases, the delete path two.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjWSq14etEawvvxGuCV
Ardnived added a commit that referenced this pull request Nov 26, 2026
The atlas share block's Copy link is now a named button rather than a copy
field, so its label is on-screen copy. #1246 retired `share.copy_link` as
screen-reader-only and swept it from every locale; this declares it again,
with its English as a schema default, so production fills it on boot.

Co-authored-by: Claude Opus 5.5 <[email protected]>

This branch was successfully deployed

No deployments
sahajcloud / SahajCloud-pr-1246 — 55202056 Deployed Nov 22, 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