Skip to content

feat(translations): ship the Atlas clock-label copy and two rewordings to production - #1095

Merged
Ardnived merged 3 commits into
mainfrom
feat/atlas-clock-copy
Nov 8, 2026
Merged

Ardnived merged 3 commits into
mainfrom
feat/atlas-clock-copy

Conversation

@Ardnived

@Ardnived Ardnived commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Ships four pieces of English Sahaj Atlas copy with the code, so production has them on deploy. Before this, they needed an admin to type them in.

Key English For
event.display.zone_time (new) %{city} time Names the clock a time is in: "8:00 pm Prague time" (Atlas bug 25)
calendar.times_note (new) Times are local to each class. Online classes show your time (%{zone}). Line under the calendar while online classes show (Atlas bug 25)
common.errors.captcha_blocked "The map can't load here right now, because its security check didn't respond. Try again later." Stops blaming "this page" (Atlas bug 1)
registration.form.privacy_policy "…in accordance with our <link>privacy policy</link>." sydevs/SahajAtlasWeb#371, already deployed, renders the span as a link (Atlas bug 28)

This replaces the admin edits that #1094 asked for.

How

  • Schema and seed: both new keys are added to translationsSchema.json, and all four English values are set in data.en.json. The privacy_policy description now tells translators about the <link> span.
  • Data migration 20261107_225000_atlas_clock_copy: it changes data only, and its .json is the previous snapshot with a new timestamp. migrate:create confirms there's no schema change, because both new keys live inside existing JSON columns.
    • It writes English only. A client read already fills any key a locale lacks with the English value.
    • up never overwrites an editor's copy: a new key is added only where English lacks it, and a rewording only where the stored value is still the seeded original.
    • It writes both the main row and the latest: true version row. A save loads from the version row, so without that the next save would drop the copy.
    • Its down is required, not optional: the old schema has no entry for the two new keys, and would refuse every save of the global while they are stored. So it removes them from every locale and every version row, whatever they hold. The two rewordings are the other case — the old schema declares both keys, so down reverts English alone, and only where the value is still up's.
  • Guide: the rule is written up in src/globals/AGENTS.md, with this migration as the worked example, and src/migrations/AGENTS.md points its own no-backfill default at that carve-out.

Checked

  • Lean gate passes: lint, format, typecheck, and 3136 unit tests.
  • tests/int/atlas-clock-copy.int.spec.ts passes all 7 cases. Each guard was watched failing against its defect: leaving out the version row loses the copy on the next save, dropping up's guards overwrites an editor's wording, and a value-guarded or English-only down leaves a reworded zone_time behind.
  • atlas-drop-time-in-place.int.spec.ts still passes now that its withSchema helper is shared from tests/utils.

After merge

  • Production picks the copy up when this deploys. The edge cache for the global lasts up to 10 minutes.
  • SahajAtlasWeb then runs pnpm sync:translations --write and wires zone_time and times_note for Atlas bug 25.
  • The other 9 locales keep their old wording of captcha_blocked and have no <link> span in privacy_policy, so the link doesn't show for them yet. Both are for translators.

🤖 Generated with Claude Code

…s to production

Two new sy-atlas-translations keys for the widget's clock labels
(sydevs/SahajAtlasWeb bug #25 of the 6 Nov sweep):

- `event.display.zone_time` — "%{city} time", after a time, naming the
  clock it is in ("8:00 pm Prague time").
- `calendar.times_note` — "Times are local to each class. Online classes
  show your time (%{zone})." under the calendar while online classes show.

And two rewordings the widget is ready for:

- `common.errors.captcha_blocked` stops blaming "this page".
- `registration.form.privacy_policy` marks its link as
  `<link>privacy policy</link>`, which sydevs/SahajAtlasWeb#371 renders
  as a link (deployed); unmarked copy stays plain text.

A data migration writes the English values, so production has them on
deploy rather than by hand in the admin. It never overwrites an editor's
copy: a key lands only where English lacks it, and a rewording only where
the stored value is still the seeded original. Main and latest version
rows are both written, so the next save keeps them. `down` removes the
two keys, since the old schema refuses a save that stores them.

The int spec was watched failing against both defects it guards: with
the version row left out, the copy is lost on the next save; without the
guards, an editor's wording is overwritten. `withSchema` moves to
tests/utils for its second caller.

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

railway-app Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

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

Service Status Web Updated
SahajCloud ✅ Success (View Logs) Web Nov 7, 2026 at 10:48 pm UTC
1 service not affected by this PR
  • mailpit

@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-1095 November 7, 2026 21:53 Destroyed
@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 7, 2026
@sydevs-bot

sydevs-bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

🤖 no session running

recent dispatches
  • 22:19Z address-review · attempt 1 · session · done
  • 22:19Z address-review · attempt 1 · session
  • 22:09Z review-pr · attempt 1 · session · done
  • 22:09Z review-pr · attempt 1 · session

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

@sydevs-bot sydevs-bot moved this from Awaiting to Working in SYDevelopers Technical Roadmap Nov 7, 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

Four English strings, one guarded data migration, and the rule written down once. #1094 asked for two of them as an admin edit; shipping them with the code is the better call, and the two clock keys join it by area, files and verification step, so no part of this is smuggled scope. The guards could fail silently, so I read production's live English: all four match the migration's from values exactly, so every statement fires. down's one guard is the only thing I would change.

The body writes bug #25, bug #1, bug #28. GitHub renders those report numbers as links to SahajCloud #25, #1 and #28; #1094 wrote them as "Atlas bug 1", with no #.

Findings

  • should-fix — down keeps an editor-edited zone_time, re-arming the unsavable-global failure down exists to prevent. src/migrations/20261107_225000_atlas_clock_copy.ts:86
  • consider — the new rule's default contradicts src/migrations/AGENTS.md, with no cross-reference. src/globals/AGENTS.md:342

What was checked

  • Production, read-only. GET /api/globals/sy-atlas-translations?locale=en&depth=0: captcha_blocked and privacy_policy are byte-exact matches for CAPTCHA_BEFORE / PRIVACY_BEFORE; zone_time and calendar.times_note are absent.
  • Schema. _sy_atlas_translations_v.latest and all eight *_locales columns the migration names exist in the committed snapshot, which is identical to 20261105_201411_atlas_digests_and_homes.json.
  • Ladder. tests/utils/withSchema.ts (two callers) matches tests/utils/'s shape. No migration here uses Payload's local API; 104 use db.execute.
  • Consumer side. splitInlineLink is on SahajAtlasWeb main, so the <link> span renders as a link, not literal markers — #1094's one ⚠. types:cms leaves translations.en.json alone, so the contract sync cannot red the consumer.

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


Generated by Claude Code

Comment thread src/globals/AGENTS.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 7, 2026
…ver they hold

Review: `down` kept an editor's `zone_time`, so a rolled-back deploy left a
key the previous schema cannot store, and the global refused every save —
the failure `down` exists to prevent. It now removes both new keys from
every locale and every version row unconditionally, guarded only by `?`
against a scalar column. The two rewordings stay guarded both ways.

The spec seeds a French `zone_time` and an edited English one; it failed
against an English-only, value-guarded `down` before this change.

The globals guide now says how this migration relates to
src/migrations/AGENTS.md's caution about augmenting generated migrations.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-1095 November 7, 2026 22:21 Destroyed
@sydevs-bot

Copy link
Copy Markdown
Contributor

Both critic threads adopted, pushed to claude/relay-1095-78494bd.

Lean gate green. atlas-clock-copy.int.spec.ts is 7 cases; both new ones were watched failing first. No changed path matches securityReview.triggerPattern.

Anomaly: the PR body changed at 22:24Z, mid-run, already describing this wider down. I read it as the spec and matched it. Refreshed it for the 7th case and for up's scope.

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

Copy link
Copy Markdown
Contributor

I could not merge the relay here, so this is the step left for you.

  • merge the relay — GitHub said: claude/relay-1095-78494bd conflicts with feat/atlas-clock-copy: Merge conflict - https://docs.github.com/rest/branches/branches#merge-a-branch

🤖 sydevs dispatcher

@sydevs-bot sydevs-bot moved this from Working to Awaiting in SYDevelopers Technical Roadmap Nov 7, 2026
The address-review session fixed the same finding in parallel on
claude/relay-1095-78494bd, which could not merge over bfa2e5d. Its version
is the stricter one, so it replaces mine: `dropKey` also checks
`jsonb_typeof` (a scalar string equal to the key answers true to `?`, and
`-` on it would abort the rollback), the down cases are split by what each
proves, and src/migrations/AGENTS.md points at the carve-out from its side.

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

Ardnived commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

Took claude/relay-1095-78494bd as a whole in 3f65fb2. It fixed the same down finding as bfa2e5d, but its version is stricter: it adds the jsonb_typeof guard, splits the down cases, and adds the pointer from src/migrations/AGENTS.md. The relay is now redundant.

@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-1095 November 7, 2026 22:45 Destroyed
@sydevs-bot
sydevs-bot enabled auto-merge November 7, 2026 23:01
@Ardnived
Ardnived disabled auto-merge November 8, 2026 21:53
@Ardnived
Ardnived merged commit 384b078 into main Nov 8, 2026
9 checks passed
@Ardnived
Ardnived deleted the feat/atlas-clock-copy branch November 8, 2026 21:53
@sydevs-bot sydevs-bot moved this from Awaiting to Done in SYDevelopers Technical Roadmap Nov 8, 2026
Ardnived added a commit to sydevs/SahajAtlasWeb that referenced this pull request Nov 10, 2026
* feat(time): name the clock each class time is in

Bug 25 of the 6 Nov sweep: an online card showed the visitor's time, then
the host's with no label, and the two could fall on different days.

Each time now names its clock by the zone's own city: an online class
always ("3 AM London time", with "Mon 8 PM Toronto time" under it), and
an in-person class only when the viewer's clock differs at that moment.
The calendar says the same in one line under the grid, while the month in
focus holds an online class.

The two keys shipped in sydevs/SahajCloud#1095. The synced snapshot also
carries that PR's two rewordings, so the security-check fallback text
moves with it, and two registration strings an editor changed since the
last sync.

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

* docs(changelog): class times say whose clock they are

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

* fix(calendar): fold the times note in and drop its month gate

The note is one sentence, so a component file, a spec file and a reactive
store read cost more than it does. It now sits in `CalendarGrid` beside the
grid it annotates.

The focused-month gate also hid it where it was needed. A week straddling two
months read only the earlier one, so an online class on the 1st at 01:00 sat
on the grid with nothing to explain it, and the list view pages past its own
month. Any online entry in the 12-month expansion shows the note instead,
which drops the subscription to `date` — a field `store.ts` documents as read
through `getState` alone.

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

* fix(time): say nothing when a schedule names no timezone

`scheduleTimeZone` degrades a missing or malformed `firstDate_tz` to UTC, and
`firstDate_tz` is nullish in this repo's own types. Naming the clock then read
"7:30 PM UTC time" to every viewer off UTC, and UTC is our placeholder for
absent data rather than a clock the venue keeps. `scheduleNamesZone` tells the
two apart, so an in-person time and an online host's subtext fall back to the
unlabelled form they had before.

An online class's own time is the VIEWER's zone, which is real whatever the
schedule carries, so it stays named.

The JSDoc on `eventStartTime`, `eventTimeRange` and `whereSubtext` still
described the unlabelled strings, and the host's as "in Prague".

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

* docs(changelog): match the entry to what the two fixes changed

The note's visibility is no longer the focused month, and an unnamed
timezone now leaves a time unlabelled.

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

---------

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

This branch was successfully deployed

No deployments
sahajcloud / SahajCloud-pr-1095 — 3f65fb23 Deployed Nov 7, 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.

2 participants