Skip to content

feat(translations): add the Mapbox wordmark and attribution labels to sy-atlas-translations - #1036

Closed
sydevs-bot wants to merge 2 commits into
mainfrom
claude/feat-1032-mapbox-control-labels
Closed

sydevs-bot wants to merge 2 commits into
mainfrom
claude/feat-1032-mapbox-control-labels

Conversation

@sydevs-bot

@sydevs-bot sydevs-bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Declares common.map.mapbox_homepage and common.map.toggle_attribution, the two control labels fix(map): show the Mapbox logo and attribution SahajAtlasWeb#324 needs, and seeds their English defaults.
  • Necessary for that widget PR, not sufficient. A seed file is not production data, and the widget's snapshot reads what production serves — see Contract impact.

Change outline

Contract — the widget-facing key set

The one shape a consumer sees. Both keys override a string in mapbox-gl's own defaultLocale,
which is where these controls get their accessible name today. The English given is Mapbox's own,
so the seeded copy is a translation of a real string rather than an invention.

 sy-atlas-translations
 └── common                                  tab
     └── map                                 leaf group → jsonb sy_atlas_translations_locales.common_map
         find_my_location                    # GeolocateControl.FindMyLocation — already overridden
         location_not_available              # GeolocateControl.LocationNotAvailable — already overridden
+        mapbox_homepage                     overrides LogoControl.Title             ("Mapbox homepage")
+                                            "Label of the Mapbox wordmark, which links to mapbox.com."
+        toggle_attribution                  overrides AttributionControl.ToggleAttribution ("Toggle attribution")
+                                            "Label of the control that shows and hides the map's data credits."

No maxLength on either: neither is laid-out text. toggle_attribution renders as both
aria-label and title; mapbox_homepage as aria-label alone — LogoControl sets no title
in mapbox-gl 3.33.0, despite what its key is called. The group's own description already reads
"Labels on the map's own controls", so it needed no widening. No migration — a leaf group is one
jsonb column, so only that column's generated JSON Schema moves.

The seeded English departs from Mapbox once, deliberately: toggle_attribution is Map data credits, not Toggle attribution. The control opens the "© Mapbox © OpenStreetMap" line, so
Mapbox's own wording names the mechanism rather than what a visitor gets.

Types — the generated interface

 interface SyAtlasTranslationsCommonMapStrings {   src/payload-types.ts
   find_my_location?: string;
   location_not_available?: string;
+  mapbox_homepage?: string;
+  toggle_attribution?: string;
 }

Files — where the keys are declared and seeded

 src/globals/SahajAtlasTranslations/
 └── translationsSchema.json      # declares both keys, their type and their descriptions
 seeds/sy-atlas-translations/
 ├── data.en.json                 # the two seed defaults, reworded by a manager
 └── data.{cs,de,es,fr,hu,nl,pt-BR,ru,uk}.json   # untouched: omitted, never blank

Preview

Data: not seeded. previewUrl.seed is unset for this repo, so a fresh preview carries no
translation values. Both rows render with an empty input either way, which is what this change
adds — the fields and their descriptions, not values.

Sign in with PREVIEW_ADMIN_EMAIL at /admin/login.

Contract impact

src/payload-types.ts is a contractSync source for WeMeditateWeb and SahajAtlasWeb.
Both copies re-sync in a bot PR after this merges; neither needs work here.

Merging this does not unblock sydevs/SahajAtlasWeb#324 on its own, for the same reason
#1025 records for event.display.room: nothing in the deploy writes a seed file,
and scripts/sync-translations.mjs in the widget repo snapshots what production serves.
English has no fallback source of its own — clientEnglishFallback skips the default locale — so
translations.en.json there gains neither key until the copy exists on the live global.

#1025 holds that decision (its Question 1: run the production seed, or have a
manager type it). Whichever answer it takes covers these two keys as well — they are in the
same data.en.json and the same global. No second ticket is filed for them; answering #1025 once
is the cheaper path, and splitting it would ask the same question twice.

Test results

  • Lean gate: ✓ .claude/skills/pr-prep/check.sh — lint, format, typecheck (src + tests), 226 unit files / 2902 tests
  • Targeted specs: 77 passed — tests/int/translations-globals.int.spec.ts (36), tests/int/translations-field.int.spec.ts (26), tests/int/globals-client-reads.int.spec.ts (15)
  • Build: N/A — Railway builds it on this preview

The count assertion was watched failing at 260 before 258 was bumped, as the ticket asks. The
ticket predicted 259 from a count of 257; 258 is what main actually carries since #1020
merged, so the number was read off the failure rather than taken from the body.

Manual verification

  1. Open the preview link, Common tab → Map. Both rows are present, editable, and show their
    descriptions.
  2. Enter the production copy on the live global once this deploys, by whichever route
    chore(translations): enter the production English copy for event.display.room #1025 settles. The global is drafts: { localizeStatus: true }, so a locale
    serves a key only after that locale is published. This PR ships the schema and the seed, not
    the copy.

Notes for reviewer

All four acceptance criteria were checked against a running server, not inferred — including the
locale=de client read, which #1020 could not reach. See Detail for how.

/code-review high reported no findings, having fetched mapbox-gl's own defaultLocale to
confirm that LogoControl.Title is "Mapbox homepage" and AttributionControl.ToggleAttribution
is "Toggle attribution", and that LogoControl's anchor points at https://www.mapbox.com/.
/simplify found nothing to act on: the branch adds no code — JSON data, one numeric constant,
and generated output. comment-lint.mjs: no banned comment added. Security review skipped: no
path matches securityReview.triggerPattern, and this repo sets no contentPattern. Docs
checked, nothing stale — no Markdown file names a key in this group or the leaf-group count.

#1033 overlaps this PR by more than the key count. It adds location_failed to this same
common.map group, for #1031, and it also rewrites the group's own description and
location_not_available's — inside the same object this PR inserts two keys into. So whichever
merges second owes a hand-resolved conflict in translationsSchema.json and data.en.json, not
only a new number. Nothing else is shared.

The naming of toggle_attribution was raised and settled (thread on translationsSchema.json).
A key here names its slot, not its copy: 195 of the 263 seeded English strings differ from
toWords(key). A copy-derived name would be the one to go stale when a manager rewords the string,
which #1025 expects.

Detail

How acceptance criterion 3 was checked, and the trap in the way. "The same read at
locale=de, authenticated as a clients API key, returns the English strings." A plain REST read
against a local dev server answers this wrongly and silently: admin.autoLogin
(src/payload.config.ts:172) authenticates the request as the admin manager, which outranks the
API key, and clientEnglishFallback then correctly skips a manager read. The response is a 200
carrying German's own two keys and no merge — indistinguishable from a broken fallback. Six
pre-existing keys (event.display.room, event.display.unverified_note,
event.display.unverified_title, registration.form.subscribe, registration.form.title,
share.title) read as missing the same way, which is what ruled the change out as the cause.

Sending DisableAutologin: true beside the API key is what makes the read a real client read —
the header scripts/redeem-signin-link.ts:73 uses for the same reason. The request then hits the
client gate (400 without depth), and with depth=0 returns:

{"common":{"map":{
  "find_my_location":"Meinen Standort finden",
  "location_not_available":"Standort nicht verfügbar",
  "mapbox_homepage":"Mapbox homepage",
  "toggle_attribution":"Map data credits"}}}

Both English, neither blank. locale=en returns all four of its own. The admin page was fetched
too: /admin/globals/sy-atlas-translations carries both field names and both descriptions.

Which attribute each key actually lands on, read off mapbox-gl 3.33.0's own source rather than
inferred from the key names. LogoControl.onAdd calls setAttribute('aria-label', …) on its
anchor and sets no title. AttributionControl.onAdd reads the string once and uses it twice —
aria-label on the compact button, title on the icon span inside it. Neither is laid-out text,
so the maxLength answer is the same for both.

No migration, verified rather than assumed. pnpm db:migrations:create … --skip-empty emitted
no file.

No new test, as the ticket's first criterion requires. tests/unit/atlas-translations-schema.spec.ts
already pins every property this change has: the key count, a non-blank description per key, an
English seed value for every declared key, that a seed writes only declared keys, and that no
other locale invents a placeholder English lacks. The count case was watched red on the schema
edit and green on the bump. mergeEnglish's "fills a key the locale omits entirely" case
(tests/unit/client-english-fallback.spec.ts) is the pin for the fallback these keys rely on, and
it was re-run against the real seeded data and the real lookups before the REST check above.

The override is construction-only, inherited from how Mapbox works rather than from this
change: locale is read once when the map is built and there is no setLocale, so a mid-session
language switch will not relabel either control. The geolocate labels already have that
limitation, documented in docs/rules/mapbox.md in the widget repo. Worth knowing, not a blocker.

Closes #1032

🤖 Generated with Claude Code

https://claude.ai/code/session_014rSJxsCbdTj8Jh8M1R6KAb

…tions

sydevs/SahajAtlasWeb#324 makes the Mapbox wordmark and an attribution
control visible on the map. Both take their accessible name from
mapbox-gl's own `defaultLocale`, and the widget can override that name —
it already does for the geolocate control — but only with copy from this
global. No key held either string, so on every non-English embed those
two controls read English while the rest of the interface is translated.

`mapbox_homepage` overrides `LogoControl.Title` and keeps Mapbox's own
`Mapbox homepage`: the wordmark is a link to mapbox.com, so naming the
destination is what the control does. `toggle_attribution` overrides
`AttributionControl.ToggleAttribution`, whose English `Toggle
attribution` names the mechanism rather than what a visitor gets, so the
seeded English is `Map data credits`.

Neither takes a `maxLength` — both render as `aria-label` and `title`,
never as laid-out text. The `common.map` group's own description already
reads "Labels on the map's own controls", so it needed no widening.

English alone is seeded. Each locale file's `_meta.omitted_keys` states
that an untranslated key is omitted rather than blank, and the client
read's English merge (#705) serves English for it. The seeded English is
a default a manager can reword on the production global.

The key count assertion moves 258 -> 260, read off the failure rather
than the ticket, which predates #1020. `leafGroups` stays 43, since no
group is added.

No migration: a leaf group is one `jsonb` column, so only that column's
generated JSON Schema changes. `pnpm db:migrations:create --skip-empty`
emitted nothing, which is the check.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014rSJxsCbdTj8Jh8M1R6KAb
@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-1036 October 25, 2026 21:34 Destroyed
@railway-app

railway-app Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

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

Service Status Web Updated
SahajCloud ✅ Success (View Logs) Web Oct 26, 2026 at 11:45 pm UTC
1 service not affected by this PR
  • mailpit

@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Oct 25, 2026
@sydevs-bot

sydevs-bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 no session running

recent dispatches
  • 23:33Z resolve-conflicts · attempt 1 · session · done
  • 23:33Z resolve-conflicts · attempt 1 · session
  • 21:58Z address-review · attempt 1 · session · done
  • 21:58Z address-review · attempt 1 · session
  • 21:49Z review-pr · 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

Four files, 21 lines, each named in #1032's approach — no abstraction, no knob, no refactor. The shape is right, and the "necessary but not sufficient" framing answers the obvious question before it is asked: the schema must exist before the widget can t() either key, and the copy is #1025's to settle.

Two notes, neither a finding. The body says both keys render as aria-label and title; in mapbox-gl 3.33.0 only AttributionControl.ToggleAttribution does both — LogoControl.Title sets aria-label alone, despite its name. Same answer on maxLength, so nothing changes. And #1033 edits the same three files: whichever merges second owes a hand-resolved conflict in common.map, not only a new count.

Findings

  • consider — toggle_attribution names the mechanism its own copy rejects, and breaks its sibling's convention. Inline thread on translationsSchema.json:239.

What was checked

  • The diff whole against #1032's four steps, plus translationsField.ts and TranslationsRowField.tsx for how a key becomes an admin row.
  • The count derived independently from the branch schema: 260 keys, 43 leaf groups, 13 tabs. Merge-base is origin/main, so 258 is current and 260 right. The ten seed _meta.schema_version lines quote no key count, so none was owed an edit. Every other assertion in that spec re-checked by hand — English covers both keys, no other locale holds them, no invented placeholder, no blank description.
  • Upstream: fetched mapbox-gl 3.33.0's defaultLocale. Both override keys exist, with exactly the English the ticket quotes.
  • Consumer side: Map.tsx's mapLocale carries the two geolocate overrides only, so #324 adds entries rather than changing shape.
  • Preview: the admin URL answers 200, but sign-in needs PREVIEW_ADMIN_EMAIL, absent here, so neither row was seen rendered.

🤖 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 Oct 25, 2026
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

One thread, rebutted. No commit, so the head stays c52c340.

Base — the branch is already at origin/main (21c8a91). No merge was needed.

Rebutted — toggle_attribution names the mechanism. A key here names its slot, not its copy: 195 of the 263 seeded English strings differ from toWords(key). A copy-derived name is the one that goes stale when a manager rewords the string, which #1025 expects. #1032 specifies both names. Thread resolved.

Body refreshed, for two claims that were already wrong:

  • "both render as aria-label and title" — only toggle_attribution does. LogoControl sets aria-label alone in mapbox-gl 3.33.0, read off its source. The maxLength answer is unchanged.
  • "Neither otherwise touches the other" of feat(translations): add the geolocate-failure message to sy-atlas-translations #1033 — it also rewrites the group description and location_not_available's, in the same object. The second merge owes a hand-resolved conflict, not just a count.

🤖 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 Oct 25, 2026
@sydevs-bot
sydevs-bot marked this pull request as ready for review October 25, 2026 22:05
@sydevs-bot
sydevs-bot requested a review from Ardnived October 25, 2026 22:05
@sydevs-bot
sydevs-bot enabled auto-merge October 25, 2026 22:05
@sydevs-bot sydevs-bot added bot:working Lock: a cloud session is running on this item. Removed when it ends. and removed awaiting labels Oct 26, 2026
#1033 landed location_failed in the same common.map object this branch adds
mapbox_homepage and toggle_attribution to, and reworded both the group's own
description and location_not_available's.

Both sides kept, everywhere: main's reworded descriptions, this branch's two
keys, all three seed strings. The declared-key count assertion goes to 261 —
258 before either PR, one from #1033, two here — read off the spec run, not
computed. src/payload-types.ts auto-merged, and generate:types reproduces it
with no drift.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HCtN4KyjT7zuHFmFGB1Ep7
@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-1036 October 26, 2026 23:39 Destroyed
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

Merged main in and resolved the three common.map conflicts #1033 predicted. Both sides kept everywhere: main's reworded group and location_not_available descriptions, this branch's mapbox_homepage and toggle_attribution, and all three seed strings.

The declared-key count is now 261 — 258 before either PR, one from #1033, two here. Read off the failing assertion, not computed.

src/payload-types.ts auto-merged; pnpm generate:types reproduces it with no drift. Lean gate green (228 files / 2918 tests), plus 77 passing in translations-globals, translations-field and globals-client-reads.

🤖 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 Oct 26, 2026
@Ardnived

Copy link
Copy Markdown
Contributor

Closing as won't-do. These keys aren't the attribution text (that comes from the map style); they're the screen-reader labels on the Mapbox wordmark and attribution toggle, which exist for Mapbox's terms rather than as a feature. Not worth two schema keys, nine translations, and the #1025 dependency. Mapbox's English defaults stay; sydevs/SahajAtlasWeb#330 records the decision in Map.tsx.

@Ardnived Ardnived closed this Oct 27, 2026
auto-merge was automatically disabled October 27, 2026 00:34

Pull request was closed

@Ardnived
Ardnived deleted the claude/feat-1032-mapbox-control-labels branch October 27, 2026 00:34

This branch was successfully deployed

No deployments
sahajcloud / SahajCloud-pr-1036 — 044ccaf6 Deployed Oct 26, 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 the Mapbox wordmark and attribution labels to sy-atlas-translations

3 participants