Repository navigation
feat(translations): the atlas Back header's four strings - #1267
Conversation
The widget replaces each drawer's unexplained X with a Back control that names where it goes, and gives a phone's pulled-down panel a button to raise it again (sydevs/SahajAtlasWeb#476). Most of its new labels reuse `common.chrome.back_to`; these four cannot. `back_to_class` returns the registration and share pages to the class behind them. `back_to_world_map` returns a country page to the map of every country. `back_to_results_near` is a whole sentence, so a translator can reorder and decline the searched place. `show_more` raises the pulled-down panel. None takes a `maxLength`: Back truncates and the button grows. `back`, `back_to` and `close` each gained or lost a home in the widget, so their descriptions now say what they label — drawers carry no close control at all any more, and `back_to`'s `%{title}` is a place now that a class has its own key. Closes #1262 Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXrofnzumxCBkFtmRM
Each description keeps its where-it-appears and loses the mechanism a translator can see: the placement of the Back control, the page behind the registration sheet, and the absence of a close control on a drawer. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXrofnzumxCBkFtmRM
|
🚅 Deployed to the SahajCloud-pr-1267 environment in sahajcloud
1 service not affected by this PR
|
sydevs-bot
left a comment
There was a problem hiding this comment.
1 question for the reviewer, one per thread.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
|
🤖 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
The diff is the ticket and nothing else: 16 schema lines, 4 corpus lines, generated types. Both sides of the contract agree — all four key names and their English are byte-identical to nav-names.ts and shared.tsx on SahajAtlasWeb#476, and the three that cannot reuse back_to genuinely cannot. One should-fix, found from the consumer side: the two reworded descriptions still lead with a surface #476 deletes.
Findings
- should-fix —
translationsSchema.json:14and:18:backandback_tostill name the peek strip. Replacement copy on the thread.
Second opinions
- The
default-vs-corpus thread: I pick A, against what was built. Left open for you — it contradicts #1262's own criteria.
What was checked
new-pieces.mjs:NONE(all three files skipped), so no streamliner ran. Ladder walked per key:back_to_classandback_to_world_mapcannot beback_to+ a common noun (cs/ru/uk declension),back_to_results_nearneeds a second placeholder.show_moreagainstsearch.results.more(:321) andregistration.form.show_more_dates(:945) — three distinct affordances, andshared.tsx:185reads the new one.- Consumer:
origin/feat/nav-back-header—nav-names.ts:91,96,100,104,shared.tsx:185,config/translations.en.json. Its extrachrome.exploreandloadingare #1246's deliberate removals, already tracked there. - Preview: no
fixture.surfacePathspath is touched, so "No preview surface" holds, and there is no link to check. All six paths the body names exist on the branch. - The body's seed warning is accurate:
seeds/translations/import.ts:189-199protectsemailsandevent.titlealone._meta.schema_versioncorrectly unmoved — tabs and leaf groups do not change. - Reviewer profile read. No correctness, test or security point tripped over.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
…s-back-header-strings
SahajAtlasWeb#476 deletes `views/DrawerStack/strip-label.ts` whole, and
with it the named peek strip. There the only reader of either key is
`backLabel` (`views/nav-names.ts`), so leading with a surface the widget
no longer has misdescribes both strings to a translator, who sees the
description and nothing else.
`back_to` keeps "`%{title}` = the place it returns to", which is the half
#1262 changed and is more exact than "where it goes".
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjVYKry3sKbW2PRzEQ4
The same dead surface as the two Back keys, in six more descriptions and
the `common.chrome` group's own: SahajAtlasWeb#476 deletes `strip-label.ts`,
so no key is a peek-strip name any more.
Four of the six still name a Back target, read by `entryName`
(`views/nav-names.ts`) and interpolated into `back_to`, so they say that
instead — a translator needs the string to read inside "Back to %{title}".
`registration.form.title` and `share.title` are leaves nothing goes back
to, so the clause drops with nothing in its place.
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjVYKry3sKbW2PRzEQ4
Still waiting on you: the Lean gate green on the merged branch — lint, format, both typechecks, 292 files / 3894 tests — plus 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
…s-back-header-strings
The reviewer chose option A on the open question thread: the four new
`common.chrome` keys declare their English beside them, as `default`,
instead of living in `seeds/sy-atlas-translations/data.en.json`. Production
then fills them on the next boot through `reconcileEnglishDefaults`, rather
than waiting for a seed run that rewrites all ten atlas locales wholesale.
`tests/unit/atlas-translations-schema.spec.ts` gains the two halves of the
one-home rule `wm-web-translations-seed.spec.ts` already holds: the corpus
need not cover a key declaring a default, and must not carry one.
It also reads English from both homes. Without that, the first translator
to fill `back_to_results_near` would have failed "invents no placeholder
English lacks" — the key's `%{place}` has no corpus entry to be allowed by.
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjVaKvpkwXzKyJq3bLw
sydevs-bot pushed a commit after this approval, and the approval did not cover it. Review the new commits, then approve again.
Lean gate green — lint, format, both typechecks, 292 files / 3897 tests — plus 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
…s-back-header-strings #1268 landed the atlas inline embed's strings and dropped the `compact` tab, touching the same four files this branch does. - `common.chrome.close`: both sides reworded it. Took this branch's "the filters, which sit over the page they narrow" and main's removal of the compact dialog, which is the wording #1262 wrote down for whichever landed second. - `atlas-translations-schema.spec.ts`: both sides wrote the one-home rule. Took main's two cases, which name the exempt set from its own `defaultedKeys()` helper and put a floor under it. Kept this branch's `englishValues()`, which merges both homes so a schema-declared `%{place}` is not read as invented. - `src/globals/AGENTS.md`: both sides added the atlas spec to the one-home sentence. Kept main's wording plus this branch's one-home-of-two trap. - `src/payload-types.ts`: generated. `pnpm generate:types` leaves the resolution unchanged. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjWG8KpdZEJoRaX3pbS
|
Merged
Lean gate green (294 files, 3916 tests), plus The body's 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
Summary
common.chromekeys the widget's Back header needs, each with its English beside it as a schemadefault.back,back_toandclose, each of which gained or lost a home in the widget.Change outline
Contract —
sy-atlas-translations,common.chromeThe four keys the widget cannot build from
back_to, and the three descriptions whose homes moved. Each of the four declares its English as adefault, which is what reaches a database the key predates (#1218). NomaxLengthon any of them: Back truncates and the button grows.common.chrome src/globals/SahajAtlasTranslations/translationsSchema.json back # + the Back control where its target has no name back_to # + the Back control on every place and class page # %{title} is now the PLACE, not the view + back_to_class # registration and share, which open over the class + back_to_world_map # a country page -> the map of every country + back_to_results_near # a class opened from a search; %{place} = "Prague" + show_more # raises the panel a phone visitor pulled down close # - no longer on a drawer; the filters, the report # modal, the compact dialog, the feedback banner cancel widget_label all_classes_freeThree of the four cannot reuse
back_to:%{place}is a second placeholder in a sentence a translator reorders, andback_to_world_mapwould need%{title}to hold an article-bearing common noun, which breaks declension incs,ruanduk.back_to_classis the exception — see Notes.Descriptions — the peek strip is gone
SahajAtlasWeb#476 deletes
views/DrawerStack/strip-label.tswhole, so no key is a peek-strip name any more. Eight descriptions said one was, and thecommon.chromegroup's own.The four that still name a Back target are read by
entryName(views/nav-names.ts) and interpolated intoback_to, so a translator needs each to read inside "Back to %{title}". Registration and Share are leaves —entryNamereturns nothing for either — so their clause drops with nothing in its place.Types —
SyAtlasTranslationsCommonChromeStringsNo migration. The four keys land inside the existing
common_chromejsonb column, so there is no DDL and no key sweep.sy_atlas_translations_localesstays at 47 columns.Files — no seed change, one spec change
_meta.schema_versionneeds no edit: the atlas seeds quote tabs and leaf groups, and the diff adds neither.Preview
No preview surface — the diff touches
src/globals/andseeds/, neither of which is infixture.surfacePaths, and a global has no fixture record to link.Worth knowing before you open one anyway: a PR preview holds blank atlas copy.
src/fixture/loads collections only (FixtureSlug = Exclude<CollectionSlug, SystemSlug>), nothing under it callsupdateGlobal, andonInitrunsseedPreviewAdmin→reconcileEnglishDefaults→startFixtureLoadand nothing else. The four new rows render with their labels and descriptions and no values. That is true of every atlas key on a preview today, not something this PR changes.Contract impact
src/payload-types.tschanges, socontractSyncre-syncs WeMeditateWeb (types/payload/payload-types.ts) and SahajAtlasWeb (src/types/payload/payload-types.ts) in a bot PR after this merges.sydevs/SahajAtlasWeb#476 already hand-carries all four keys in its own English snapshot as a stand-in, and syncs from production once production holds them — #1262 says not to run
pnpm sync:translations --writethere from this ticket.Test results
.claude/skills/pr-prep/check.sh— lint, format:check, typecheck, typecheck:tests, test:unit (292 files, 3897 tests), on the branch withorigin/mainmerged inatlas-translations-schema,translations-seed-meta,translations-no-a11y,translations-english-defaults(92 passed)tests/int/translations-english-defaults.int.spec.tsandseeds/tests/atlas-translations-import.test.ts(14 passed)pnpm generate:types:src/payload-types.tsunchanged by this commit —defaultis held out of the emitted JSON Schema, so the four keys' optional-string types stand as they weretests/unit/atlas-translations-schema.spec.tsgains the two halves of the one-home rule, and now reads English from both of its homes. Each was watched failing against the real defect first:show_moreback intodata.en.jsonfails "data.en.json leaves out every key declaring a schema default".back_to_world_map'sdefaultfails "data.en.json covers every key seeded from this file".back_to_results_nearintocsfails "data.cs.json invents no placeholder English lacks" as soon as English is read from the corpus alone — its%{place}has no corpus entry to be allowed by. That is the first translator's commit, not a hypothetical, which is why the English map merges both homes.No key name is pinned on top: that would restate the schema, which
tests/AGENTS.mdrule 1 forbids.Manual verification
pnpm seed translationsagainst a dev server, thenGET /api/globals/sy-atlas-translations?locale=enreturned all four values and?locale=csomitted all four, the admin's Common → Chrome group rendered the four rows, and the seed published all ten locales (134 updates, 0 errors). The default route was not re-run by hand. Two integration specs cover it against a real database instead:tests/int/translations-english-defaults.int.spec.tsdrivesreconcileEnglishDefaultsoverTRANSLATIONS_TARGETS, which is the path the deploy takes, andseeds/tests/atlas-translations-import.test.tsdrives the importer over all ten atlas locales. Both green above.reconcileEnglishDefaultsruns fromonInitafter the migrations, so the deploy writes the four English values itself. It fills an absent key and nothing else, in English only, so no wording an operator has edited is touched and no other locale is written at all.pnpm seed translationsagainst production is no longer part of this change — and still not surgical, sinceseedAtlassends each wholedata.<locale>.jsontoupdateGlobaland a leaf group's jsonb column is replaced wholesale.Notes for reviewer
The
default-vs-corpus question is settled: A. The four keys declare their English in the schema, and no seed file carries it. That reverses what #1262's criteria asked for, so #1262 now carries the review line in its place.Dismissed review findings.
show_moreduplicatessearch.results.more's English verbatim ("Show more"). Kept. The two are different affordances — raising a collapsed phone panel against paging a results list — and feat(nav): Back says where it goes; a place with one class opens it SahajAtlasWeb#476 readscommon.chrome.show_moreinsrc/views/shared.tsxwhilesearch.results.morestays where it is.registration.form.show_more_datesis a third, already distinct by its noun. The cost is one translator row in ten files for a word already translated; flagging it in case you want the widget to reuse the existing key instead.back_to_classcould have beenback_towith the class title. Kept. The widget hand-addsback_to_classto its own snapshot, so it genuinely reads a separate key, and the registration and share sheets open over the class, which is still on screen — naming it again would be redundant whereback_to's%{title}is useful. The description now carries that reason, which is the half the first review was right about.back_to_world_mapis a third label for a viewcountries.titlealready names. Kept, for the declension reason above; the description ties it back to the country list so a translator meets the term once.Verified, not assumed.
FUNC_MAX_ARGSis moot —createStringsJsonFieldemits one JSON column per leaf group, not per key, socommon.chromegoing 6 → 10 keys adds zero columns (47, unchanged, against the cap of 100).reconcileEnglishDefaultsnow runs two statements for this global — one onsy_atlas_translations_locales, one on thelatestversion row — both againstcommon_chromealone, and both no-ops once the four keys are stored.defaultis held out of the emitted JSON Schema, so Ajv never writes it into a save.Detail
Why the descriptions read the way they do. A translator sees only the description, per row, in the admin, and it also lands in
src/payload-types.ts. The/simplifypass cut the mechanism each one could show rather than state — where on the page the Back control sits, that a drawer no longer carries a close control — and kept the one clause that answers "why is this its own key?" onback_to_class.back_to_results_nearkeeps "the spoken name of", which is load-bearing: the string is both seen and spoken, which is exactly why it belongs in this global rather than in the widget's ownsrc/config/a11y/.Review lenses run.
/simplify(reuse, simplification, efficiency, altitude) and/code-review high. Thepr-review-toolkitplugin is not installed in a routine.comment-lint.mjsagainstorigin/main: 1 changed file, no banned comment added. Security review skipped: no changed path matchessecurityReview.triggerPattern, and this repo sets nocontentPattern.Docs synced. No guide enumerates
common.chrome's keys. Two lines did go stale on thedefaultmove:src/globals/AGENTS.mdnamedwm-web-translations-seed.spec.tsas the one holder of the one-home rule, andtests/COVERAGE.mddescribed the atlas seed row as English covering every widget-facing key. Both now read true, and the AGENTS.md entry carries the one-home-of-two trap a corpus-only lookup walks into.Closes #1262