Repository navigation
feat(time): name the clock each class time is in - #380
Conversation
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]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 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
TimesNoteintoCalendarView.tsx, its predicate intolib/shape/calendar.ts.TimesNote.tsx:23 - should-fix — An in-person class with no valid
firstDate_tzreads "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
dateread contradictssrc/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
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
|
Five threads, all adopted. Pushed as
The review body's stale JSDoc at 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 |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
sahajatlas-design | 129d9c9 | Nov 10 2026, 12:08 AM |
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]>
…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]>
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.
scheduleTimeZonedegrades a nullish or malformedfirstDate_tzto UTC, and "UTC time" is no venue's clock.CalendarGrid, with no store subscription.The strings shipped in sydevs/SahajCloud#1095 and are live.
Snapshot changes to look at
pnpm sync:translations --writereads production, so the snapshot picks up more than the two new keys:captcha_blockedalso has a hardcoded fallback inFallbacks.tsx, which moves with it.followup("Email confirmation sent") andonline_notice("The link to join this class online will be emailed to you.") are rewordings.privacy_policyis not: it gained a<link>span, soConsentNoterenders "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
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 fieldstore.tsdocuments as read throughgetStatealone.🤖 Generated with Claude Code