Skip to content

feat(time): name the clock each class time is in - #380

Merged
Ardnived merged 5 commits into
mainfrom
fix/clock-labels
Nov 10, 2026
Merged

Ardnived merged 5 commits into
mainfrom
fix/clock-labels

Conversation

@Ardnived

@Ardnived Ardnived commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes bug 25 from 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.

  • Online class: always names the clock. "Every Tuesday · 3 AM London time", with "Mon 8 PM Vancouver time" under "Hosted from Metro Vancouver".
  • In-person class: names the venue's clock only when the viewer's clock differs at that moment ("7:30 PM London time" seen from Prague, nothing in London). A schedule naming no timezone leaves the time unlabelled — scheduleTimeZone degrades a nullish or malformed firstDate_tz to UTC, and "UTC time" is no venue's clock.
  • Calendar: one line under the grid whenever the calendar holds an online class: "Times are local to each class. Online classes show your time (London)." It lives in CalendarGrid, with no store subscription.

The strings shipped in sydevs/SahajCloud#1095 and are live.

Snapshot changes to look at

pnpm sync:translations --write reads production, so the snapshot picks up more than the two new keys:

  • The two rewordings from feat(translations): ship the Atlas clock-label copy and two rewordings to production SahajCloud#1095. captcha_blocked also has a hardcoded fallback in Fallbacks.tsx, which moves with it.
  • Three registration strings an editor changed in the admin since the last sync, not two. followup ("Email confirmation sent") and online_notice ("The link to join this class online will be emailed to you.") are rewordings. privacy_policy is not: it gained a <link> span, so ConsentNote renders "privacy policy" as a real link to the policy. Main's snapshot had no span, so an English visitor read plain text until the CMS read landed, and whenever it failed.

Left out

The reference commit 1d58d7d also forced am/pm for every English visitor, including en-GB. That's a separate request from this bug, so it isn't here.

Checked

  • Full gate passes: lint, typecheck, 1969 unit tests, build, and size (embed 328.8 of 330 KiB).
  • Each new spec failed against its defect: in-person never named, always named, and both unnamed-timezone cases, which read "6:30 PM UTC time" and "Wed 5:30 PM UTC time" against the unfixed hook.
  • In a browser at 1280×800 in London time, against production data: the online list and an in-person class in another zone read as above, Balham Library has no label, and the calendar shows the note.

Notes for reviewer

The calendar note's focused-month gate is gone, so the note shows whenever the 12-month expansion holds an online entry. It was a false negative in Week view (a week straddling two months read only the earlier one) and in List view, which pages past the month it starts in. That cost one component file, one spec file and the first reactive read of useCalendarPosition.date, a field store.ts documents as read through getState alone.

🤖 Generated with Claude Code

Ardnived and others added 2 commits November 9, 2026 16:39
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]>
@Ardnived
Ardnived marked this pull request as ready for review November 9, 2026 23:40
@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 9, 2026
@sydevs-bot

sydevs-bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

🤖 no session running

recent dispatches
  • 23:52Z address-review · attempt 1 · session · done
  • 23:52Z address-review · attempt 1 · session
  • 23:43Z review-pr · attempt 1 · session · done
  • 23:43Z 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 9, 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 fix matches the bug, and the hook change is the right size: twelve lines, reusing zoneCity and sameWallClock. The calendar note is where the diff outgrows its problem — two new files and the first reactive read of a store field documented as non-reactive, all to decide whether one static sentence shows. Two things reach visitors that the body does not account for: a UTC fallback surfacing as "UTC time", and a third changed registration string. No contract surface moves, so docs/embedding.md is correctly untouched. No hunk reaches them, so no thread: use-event-display.ts:35-39 and :45 still describe these times as carrying no label, and the host's as "in Prague".

Findings

  • should-fix — Fold TimesNote into CalendarView.tsx, its predicate into lib/shape/calendar.ts. TimesNote.tsx:23
  • should-fix — An in-person class with no valid firstDate_tz reads "7:30 PM UTC time". use-event-display.ts:241
  • should-fix — The month gate hides the note on a week straddling two months. TimesNote.tsx:14
  • should-fix — A third registration string changed, undisclosed, and now renders a link. translations.en.json:227
  • consider — The reactive date read contradicts src/config/store.ts:181. TimesNote.tsx:25

What was checked

Read whole on the branch, beyond the diff: lib/time.ts, lib/shape/calendar.ts, lib/shape/event.ts, config/store.ts, lib/shape/inline-link.ts.

The ladder found an existing home for both new pieces, named above. eventStartTime and eventTimeRange reach EventFacts and EventPinCard, which wrap rather than truncate. <link> reaches splitInlineLink, which supports it. TimesNote's DateTime.local() agrees with eventTimeZone's online branch. No preview link in the body. Profile read.

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


Generated by Claude Code

Comment thread src/views/CalendarView/TimesNote.tsx Resolved
Comment thread src/views/CalendarView/TimesNote.tsx Resolved
Comment thread src/views/CalendarView/TimesNote.tsx Resolved
Comment thread src/hooks/use-event-display.ts Resolved
Comment thread src/config/translations.en.json 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 9, 2026
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
`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
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
@sydevs-bot

Copy link
Copy Markdown
Contributor

Five threads, all adopted. Pushed as claude/relay-380-129d9c9.

The review body's stale JSDoc at use-event-display.ts:35-45 had no hunk to thread on, so a1b0d20 carries it.

Full gate green: 1969 unit tests, build, size (embed 328.8 of 330 KiB).

🤖 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 10, 2026
@sydevs-bot sydevs-bot moved this from Working to Awaiting in SYDevelopers Technical Roadmap Nov 10, 2026
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
sahajatlas-design 129d9c9 Nov 10 2026, 12:08 AM

@sydevs-bot
sydevs-bot enabled auto-merge November 10, 2026 00:10
@Ardnived
Ardnived disabled auto-merge November 10, 2026 16:18
@Ardnived
Ardnived merged commit cadeb9d into main Nov 10, 2026
11 checks passed
@Ardnived
Ardnived deleted the fix/clock-labels branch November 10, 2026 16:18
@sydevs-bot sydevs-bot moved this from Awaiting to Done in SYDevelopers Technical Roadmap Nov 10, 2026
antontcymbal added a commit that referenced this pull request Nov 10, 2026
Brings main's 14 commits (#363-#380) into the combined review build.
Non-obvious resolutions:

- Clock rule (#380): an in-person time names the venue's clock only
  when the viewer's differs, an online time always. Replaces the
  proposals' "every time names its clock". The calendar's TimesNote now
  says main's one sentence (calendar.times_note), only when an online
  class is listed, kept above the grid and the week list; its
  times_city/times_local/times_online keys are gone. Add-a-class Check
  still spells out the inferred clock once, now added there itself.
- Camera padding (#369): the proposals' useClassSheet stays and now
  reports the peek while the sheet is collapsed; main's useSheetCover,
  fitSheet marker and fit-snap rewrite are dropped for the proposals'
  own fit-snap.
- World view (#370): world copies back on with main's minZoom, per its
  Pacific-wrap fix, under the proposals' map controls.
- Place search (#371): the proposals' "search all countries" button
  stays; main's ?cc / browsed-country fallback, per-query release and
  "couldn't find that place" line are ported into it.
- Ancestry (#371): placedPathname/placePathsOf live once, in
  navigation.ts; DrawerStack's stack follows the region tree.
- Deep links to placeless events frame their region (#363), via
  useFrameEventOnTop, which skips contact-only listings.
- Kept proposal designs over main's: registration confirmation,
  Add to calendar list, consent link, GeolocationSuggestion placement,
  filter tags in ListToolbar, map control column. Main's failure copy
  (#365), autofill, by-request type label (#370) and dead-place header
  (#371) are ported in.
- streetAndCity: the proposals' version, now accent-blind as main's is.
- Width pin for the per-edit hook ratcheted 20 -> 21 (both sides added
  one spec).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ardnived added a commit that referenced this pull request Nov 26, 2026
…isitor's own format (#509)

* feat(dates): every date and time through one Intl formatter, in the visitor's own format

Dates and times now go through src/lib/time.ts in regionalLocale(locale):
the browser's first language decides, so an en-GB browser reads
"17:45–18:45" and "Wed 18 Nov", en-US "5:45 – 6:45 PM" and "Wed, Nov 18",
and a browser whose first language is another keeps that language's clock
on the English page (cs-CZ "17:45", a Brazilian browser on en-BR-u-hc-h23).

- Times use timeStyle 'short', so whole hours keep their minutes.
- A range that wraps past midnight and runs 12 hours or more writes both
  day periods ("5:00 PM – 12:00 PM", not "5:00 – 12:00 PM").
- A year joins a date only when it is not this year.
- Callers: useEventDisplay, the filter time labels, ActiveFilterPills,
  SearchFilters (weekdayNames instead of luxon's Info.weekdays), the
  registration dates, and the calendar header; the Schedule-X grid runs
  regional English as en-GB or en-US by date order (scheduleXLocale).
- Distances follow the same locale: miles for a UK or US region.
- src/AGENTS.md gains the "Dates and times" rule.

Main's #380 clock rule is unchanged.

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

* refactor: simplify per /simplify pass

- useLocale() returns formatLocale, so callers stop deriving regionalLocale
  themselves, and formatTimePeriods takes it like its siblings. The specs'
  useLocale mocks pin it, so they no longer read the machine's own locale
  (use-event-display.test.ts failed on an en-GB machine).
- formatTimeRange: the wrap-past-midnight join fires only when formatRange
  actually collapsed a day period, reading the separator off the same parts;
  a 24-hour locale keeps its own range and suffix ("17:00–12:00 Uhr").
- wallClock replaces events.ts's hourClock; formatDate drops its test-only
  `now` for luxon's Settings.now; usesMiles and dayFirst lose catches that
  guarded nothing; scheduleXLocale loses an unreachable row.
- Shorter comments and src/AGENTS.md rule; duplicate tests removed.

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

* fix(dates): a Portuguese browser keeps the calendar grid in Portuguese

The regional locale hands Schedule-X the browser's own Portuguese tag
(pt-PT, pt), which matched no entry and fell back to en-US. Key the
table by language so every Portuguese tag runs pt-BR, as main did.

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

* test(dates): state the rule in the spec comments, not who asked for it

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

* fix(dates): a webview with no navigator.languages formats in the page's locale

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

* docs(i18n): formatLocale formats, and is never a locale the widget fetches

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

* docs(changelog): link the date-format entry to #509

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

* refactor(calendar): Schedule-X's locale lives with the calendar shaping, not the formatters

scheduleXLocale is calendar configuration with one caller, so it moves from
lib/time.ts into lib/shape/calendar.ts beside the other Schedule-X helpers.

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

* docs(dates): the dates rule names the module, not its exports

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

* fix(a11y-gate): end the keyboard walk when Tab wraps back to the first stop

The walk presses Tab once per tabbable element, but a roving-tabindex
group (#501's weekday picker) is one Tab stop holding seven, so on
molecules--form-field the walk outlasted the page, wrapped to ff-name and
reported it as a backwards jump. main has failed the gate since #501
and #510 landed together.

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

* fix(a11y-gate): index the last stop so the walk typechecks

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

* fix(a11y-gate): an unstamped keyboard stop is not a jump to the top

A stop the page rendered after the audit carries no data-a11y-order, and
Number(null) is 0, so views--event-·-sticky-register failed tab-order at
random whenever the audit read the story before it finished rendering.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
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