Repository navigation
feat(components): count down to a live class and place the directory - #321
sydevs-bot wants to merge 22 commits into
Conversation
The `splash` block's `countdown` layout now fills the hero's content slot with a session panel fed by the producer's new `SplashBlock.event`, and a new `class-directory` block puts the Sahaj Atlas on any page in the page's own language. `lib/live-session.ts` owns the whole derivation, pure and env-free, so the Worker and the browser answer the same question. The producer sends ten future instants; the browser re-picks on every tick, which is what makes the panel change state within a minute of a session starting and roll on to the next one after it ends, with no second read. No date library: `Intl` answers every question asked, and five candidates weighed 19-22 kB gzip on a path every page pays. `Countdown`'s four defects go with it: a days cell so six days out no longer renders as 167 hours, `aria-hidden` digits beside one polite sentence, a cadence that only reaches seconds inside the final hour and never under reduced motion, and a seed the server computes instead of a `Date.now()` read during render. `atlasEmbedSrc` now emits only what differs from the widget's own defaults, so `/map`'s URL is unchanged byte for byte and a content page sends neither `routing` nor `atlas`. `server/payload-types.ts` is hand-copied from the producer's branch while the set is in flight; `pnpm types:cms` reads SahajCloud's main, which does not yet carry these shapes. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXn4RBaJeRyDDKDsNW
…must not touch `lib/live-session.test.ts` runs the derivation over the English `Europe/London` class across the BST-to-GMT boundary: the local clock time holds, the zone label changes, and the ninety-minute window survives the transition. `Europe/Moscow` cannot stand in — it has had no DST since 2014. The converter spec covers each degrade path on the SSR string — no class, a bare id, a class that stopped being online, a dormant one, and no dates left — and pins that a second directory on a page renders nothing, including behind a countdown that already fell back to one. `Countdown` is pinned twice: the markup contract in the node lane, and hydration, the reduced-motion cadence and the per-second one in jsdom. The clock-free render is asserted by spying on `Date.now`, which is the defect itself rather than a symptom of it. The head spec pins that `?atlas=` changes neither the canonical nor the hreflang cluster, and that neither new block imports a head helper. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXn4RBaJeRyDDKDsNW
A class that is unpublished, removed or no longer online is a data gap an editor has to fix, so it reaches Sentry at `warning`. A block nobody has pointed anywhere yet is not, and neither is a class that still resolves. The volume bound is asserted rather than described: three renders of the same gap send one event and three console warnings, and a different page reports at once. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXn4RBaJeRyDDKDsNW
…zone `LiveSession` set `now` once at mount, so the panel never went live and never rolled on: the digits ran to 00:00:00 and stayed on "Next session" forever, with no join action and no way in but a reload. The clock moves into the molecule, on the cadence `sessionTickMs` allows, and `Countdown` becomes presentational — no timer, no `targetDate`, no hydration seed. The atom's `onComplete` goes with it: nothing passed one, and it only existed to tell the molecule something the molecule now knows. Four more defects, each measured: - `Intl` throws on a zone it does not know, and `sessionLineParts` runs on the server-render path, so one class with an unusable `firstDate_tz` was a 500 rather than a degraded block. The zone is validated once, at the boundary. - `endTime` is a wall clock in the class's own zone, so derived against the `UTC` fallback it made a 19:00 New York class read as twenty hours long. With no zone stated the window is the hour. - Adding the wall-clock difference as elapsed milliseconds ended a two-hour class one real hour in on the day the clocks change. The candidate end is now corrected by the drift its own zone reports. - `upcomingDates` is sorted rather than trusted to arrive so. The seconds cell is drawn only while the panel redraws every second, so a session three hours out no longer shows a figure that is wrong 59 seconds in every 60. The schedule line carries `suppressHydrationWarning`: it is built from CLDR data on two independent ICU builds, and a release that moves a zone's long name differs by an invisible character. `reportOnce` is the one home for the per-isolate warning bound, which `getWebConfig` now shares, and the gap walk reads the root's own children instead of recursing a whole depth-3 document on every page render. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXn4RBaJeRyDDKDsNW
|
🤖 no session running recent dispatchesWritten by the sydevs dispatcher. Sessions never edit this comment. |
Two prose conflicts, both of them two sides adding to one list. `components/AGENTS.md`'s no-JavaScript table: keep main's `SubtleSystem` row and this branch's `ClassDirectory` row. Five components defer, so main's count stands; `ClassDirectory` server-renders, so it goes last and the closing sentence exempts the first five rather than all six. `server/AGENTS.md`'s volume bound: both sides built a once-per-isolate memo while the other was in flight — `warnOnce` in `error-utils.ts`, which sends the warning itself, and `report-once.ts`, which takes the report to send. Both ship and both are named, because neither side's callers were changed to the other's and folding one in is the reviewer's call. Asked on the line. `server/api-routes.ts` pointed at `reportedConfigGaps` for that bound. This branch replaced that memo with `reportOnce`, so the reference is repointed. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjYixfQfN1AotREedYE
|
Merged
Gate green after the merge: lint, 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
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
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 Adversarial review
The diff matches #309 closely: every piece traces to a criterion, and the three biggest calls — all ten instants to the browser, no date library, nothing cached here — are each argued from a measured fact. Scope is honest.
Two shape findings. The diff builds report-once.ts as the one home for a per-isolate Sentry bound, moves getWebConfig onto it, then leaves api-routes.ts's identical copy outside while editing that file's comment to cite the new helper. And ClassDirectoryBlockFields re-declares a type the producer now generates. The one-widget invariant also has a hole the converter can close with what it holds.
Findings
- should-fix — the third copy of the bound stays, its comment naming a helper it never calls (
server/api-routes.ts:215). - should-fix —
ClassDirectoryBlockFieldsre-declares the generatedClassDirectoryBlock(lib/content-blocks.ts:120). - should-fix —
aria-labelon a custom element is dropped (ClassDirectory.tsx:63). - consider — two gapped
countdownsplashes render two widgets (blockConverters.tsx:345). - consider — the docblock documents
primarySubtag(ClassDirectory.tsx:36).
What was checked
Read whole on the branch: lib/live-session.ts, LiveSession.tsx, Countdown.tsx, ClassDirectory.tsx, server/{live-session,report-once}.ts, plus the other nine diffs.
Ladder: reportOnce had two siblings, one left behind; ClassDirectoryBlock is generated; atlasRouteFor reuses refId/refSlug; sessionEnd mirrors the producer's rule.
Consumer side: sydevs/SahajCloud#1232 — block slug, opensAt's union, both defaults and the eight blocks.live_session keys match, and all twelve resolve in lib/translations.en.json. Both first renders take now === null. Every path the body names exists on the branch; it cites no preview link.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
…session # Conflicts: # components/organisms/RichText/blockConverters.tsx # lib/content-blocks.ts
server/api-routes.ts kept a third copy of the per-isolate Sentry bound while its comment named reportOnce as what states that bound. The proxy is now the memo's source, so one proxy's 400 churn cannot re-arm the other's. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVGeYHrHtRicZPyv8d
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
wemeditate-web | 35e12df | Commit Preview URL Branch Preview URL |
Nov 22 2026, 11:42 PM |
primarySubtag sat between the docblock and ClassDirectory, so the block documented the arrow function and the component had none. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVGeYHrHtRicZPyv8d
A custom element carries no implicit role, so the aria-label on <sahaj-atlas> landed on a generic element and assistive tech dropped it. axe does not flag a name on a generic element, so the a11y gate passed over it. An explicit role="region" is what makes the name real. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVGeYHrHtRicZPyv8d
hasDirectoryBlock looked only for class-directory siblings, so two countdown splashes that both fell back drew two <sahaj-atlas> elements, and a second one shows nothing. A fallback now also stands down behind an earlier countdown that falls back itself; one that renders no widget — a live class, or no background image — stands out of the way. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVGeYHrHtRicZPyv8d
|
Merged
Waiting on you: fold Gate green on the merge: lint, 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
#328 moved every screen-reader string out of the SahajCloud-owned global into lib/i18n/a11y/, mounted at <tab>.a11y. It carries this branch's blocks.a11y.next_session already, in context.json and all 20 locale files, so the countdown's spoken sentence keeps its reader unchanged. lib/i18n/translations.en.json takes main's side: the whole blocks.a11y group goes, because that file is now the SahajCloud mirror alone. The branch's own general.days and live_session keys auto-merged and stay. types/payload/payload-types.ts drops the blocks.a11y.next_session declaration this branch added. SahajCloud declares no a11y key, so a string this repo owns must not be typed as one the CMS sends. The ten a11y interfaces main's copy still carries are main's drift, left alone. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjYr4Ykq7Pr8yom83KQ
|
Merged Nothing was lost. #328 already carries this branch's One change outside the hunk: Lean gate green: lint, ⚠ The body's "Three upstream PRs hold 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
|
Nothing to fix. The contract check is the only failure, and it is correct. Its diff grew from 76 lines to 412. The 336 new ones are the ten The original 76 stand, and both blockers are still open:
I left the Lean gate green on 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
main's #329 re-ran `pnpm types:cms` against SahajCloud main (#1246), which dropped the ten a11y interfaces and the video tab. This branch's hand copy of the contract still carried them, so every one of those groups conflicted. Resolved to main's generated output plus only the shapes this branch's code needs from the unmerged sydevs/SahajCloud#1232: `blocks.live_session`, `blocks.general.days`, `SplashBlock.event` and `ClassDirectoryBlock`. The a11y groups stay dropped — #328 moved those strings into lib/i18n/a11y/, so nothing here reads them from the CMS. `wisdom_sidetext` is re-typed because its own `shortcut:` marker says a contract sync drops it until sydevs/SahajCloud#1218 lands. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVeQVCd9NZbNZ37XVL
|
Merged
The body's "336 deleted lines are Lean gate green: lint, 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
|
CI is still red after 3 fix attempts (failing: Lint, Typecheck & Unit). I have stopped retrying. A mention or a push from you starts me again. 🤖 sydevs dispatcher |
`main`'s #331 re-synced `general.wisdom_sidetext` from the merged sydevs/SahajCloud#1218, so the hand-typed entry this branch carried for it is now generated upstream. Took main's generated form and dropped the `shortcut:` marker beside it: its stated trigger — that PR landing — has fired. `general.days` stays hand-typed. sydevs/SahajCloud#1232 is still open, so no sync produces it yet. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVAbAXn1pRFG9aD4vB
|
Merged
The body's reviewer note saying Lean gate green on the merge: lint, 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
|
CI is still red after 3 fix attempts (failing: Lint, Typecheck & Unit). I have stopped retrying. A mention or a push from you starts me again. 🤖 sydevs dispatcher |
Summary
splashcountdownlayout as a live-session panel, and places the class directory on any page as aclass-directoryblock.Countdownatom, which no page had ever rendered: no days unit, nothing for assistive tech, no reduced-motion gate, and a hydration mismatch.getWebConfigand both API proxies now share (joined: this PR is the second reporter that needed it).mainlanded a second memo,warnOnce, while this was in flight; the reviewer chose to fold the two together, sowarnOnceis that home andserver/report-once.tsis gone.videotranslation types this copy still carried after chore(translations): drop WeMeditate Web's unused video tab SahajCloud#1217 removed them upstream (joined: unread drift in the one file this PR's red check measures in full).Change outline
Components — one clock, in the molecule that decides what the panel says
Splashhas always had the content slot; the block never had a session to fill it with.Behaviour — the derivation both sides share
One pure, env-free module, so the Worker and the browser cannot answer differently. Nothing in it reads the clock: every function takes
now.lib/content/live-session.ts (new) readSessionClass(event) absent / a bare id / not online / inactive → a gap, each named starts sorted, not trusted to arrive so firstDate_tz validated once — Intl throws on a zone it does not know no zone stated → endTime dropped, because it is a wall clock in that zone sessionAt(schedule, now) the first session whose end is still ahead; live once its start has passed the end is endTime on the start's own day in the class's zone, corrected by the drift its zone reports, so a transition inside a session does not move the end by an hour; else start + 60 min sessionLineParts / relativeToStart / sessionTickMs Intl only, memoized — the weekday, the time, timeZoneName long, "in 2 days" whole minutes until the final hour, then seconds; a minute under reduced motionContract — the loader URL, and what the page read asks for
Only a parameter that differs from the widget's own default is emitted, so
/map's URL is byte-identical.atlasEmbedSrc({ key, atlasRoute?, routing?, map?, langs?, format? }) lib/atlas/embed.ts key - routing=path always + routing=path only when asked # `query` is the widget's default - atlas=<route> always, required + atlas=<route> only when given # a block with no `opensAt` names none + map=false only when the map is off + langs=<code> one code, the page locale's primary subtag + format=online only when askedscheduleis selected whole and must stay so:schedule.upcomingDatesis a virtual field whose hook reads the stored recurrence columns and declares none of them as inputs, so a narrowed sub-path select strips what it reads and every class comes back with no dates.Flow — reporting a class that has gone unreadable
What renders is decided in the converter, so it holds in SSR, in a client-side navigation and in the live preview. Reporting is server-only.
Preview
Branch alias: https://claude-feat-309-live-session-wemeditate-web.contact-c66.workers.dev. No page carries either block yet, so these are the routes the diff changes rather than the change on screen:
/map— the loader URLatlasEmbedSrcnow composes from parts. It must be byte-identical to before:routing=pathand oneatlas=and nothing else./— an ordinary content page, which now walks its own blocks for a countdown gap on every render.Once an editor places a block, these are the three checks worth running on it:
countdownsplash —curlit and confirm the HTML already holds the schedule line, the zone label and the join link with no JavaScript, then open it and confirm the countdown ticks, shows days past 24 h, and flips to the join state at the start instant.class-directoryblocks, or two gappedcountdownsplashes — exactly one<sahaj-atlas>and oneauto.jsin the HTML, its query string carrying the expectedlangs,mapandformat, and the element carrying a pixelheight.?atlas=/gb/london— diff the<head>: the canonical and everyhreflangmust be identical.⚠ What no preview can show. Every atlas read is refused off a domain listed on the client record, so a Cloudflare preview never mounts the live widget. The mount, the home-region
?atlas=rewrite, the language cog's?locale=, and Back stepping through in-embed navigation are an attended check on a listed host.Test results
.claude/skills/pr-prep/check.sh— lint,tsc --noEmit, andpnpm test:run(1748 tests, on the currentmain).--full, becauseserver/is touched: the same pluspnpm build.lib/content/live-session.test.ts(24, including theEurope/LondonBST→GMT fixture and theAmerica/New_Yorkfall-back that falls inside a session),lib/atlas/embed.test.ts(16, with/map's URL pinned byte for byte),components/atoms/Countdown(6),components/molecules/LiveSession(5, hydration and both cadences in jsdom, plus the roll-over through live to the next session),components/organisms/RichText/blockConverters.test.tsx(45),server/live-session.test.ts(7),lib/seo/head.test.tsx(10),tests/a11y/page-types.test.tsx(18, with a newlivetarget carrying both blocks),tests/guards— all green.Manual verification
?locale=and that the choice travels in a copied link while the page stays in its own language.popstateinteraction.Notes for reviewer
types/payload/payload-types.tshere is a hand copy of that branch'ssrc/payload-types.ts, andlib/i18n/translations.en.jsonis hand-written to the eight keys that PR declares. Both are normally generated;pnpm types:cmsreads SahajCloud'smain, which does not carry these shapes yet, andpnpm sync:translationsreads the live CMS, which does not carry the copy yet. The contract sync restores the first on merge; the second needspnpm sync:translationsre-run by hand.main's refactor(types): read the content block types from SahajCloud's generated schema #294 landed under this branch, and the hand-written block interfaces went with it.ClassDirectoryBlockFieldsandClassDirectoryTargetare gone: the converter casts to the generatedClassDirectoryBlock, which carriesopensAt's polymorphic union field for field. That is the merge resolution, not a second decision.Lint, Typecheck & Unitred, and nothing in this repo clears it. The contract check measures a touched copy against its source in full, by file and not by hunk, so every line oftypes/payload/payload-types.tsthat SahajCloud'smaindoes not yet produce is reported as this PR's. Of the 76 linespnpm types:cmsdeletes here,blocks.live_session.*,general.days,SplashBlock.eventandClassDirectoryBlockwait on feat(richEditor): give the countdown a class and add a directory block SahajCloud#1232, andgeneral.wisdom_sidetext, which carries ashortcut:marker, waits on feat(translations): declare a key's English in the schema, reconciled on boot SahajCloud#1218. refactor(i18n): screen-reader strings live in the repo, machine-translated #328 is merged, soblocks.a11y.next_sessionis gone from both hand copies. The check runs ahead of lint,tscand the tests, which is why CI reports nothing about the code itself.main's drift, not this branch's. refactor(translations): no global declares a screen-reader-only string SahajCloud#1246 dropped the tena11ysub-groups upstream at 2026-11-22T18:08Z, andmain's own copy of this file still carries them; the contract sync has not landed that yet. It is measured here only because this PR touches the file. No module names anA11YStringstype andWEB_TRANSLATIONS_SELECTlists tabs only, so the sync lands clean.min-width: 360pxblock inside the padded content container overflows a 360px-wide viewport — the commonest small phone — which is a horizontal page scroll and fails WCAG 2.1 SC 1.4.10. The element takesw-fulland an explicith-[560px]instead, and below the widget's own 360×420 floor it degrades to a card that opens the full interface, which is its documented behaviour. Say if you would rather have the floor./maprenders its ownAtlasContentinside the element; this block fetches no atlas document, so a visitor without JavaScript, one the loader cannot reach, and a deployment with noPUBLIC__SAHAJ_ATLAS_KEYall get a sized, labelled, empty region. It is now a row incomponents/AGENTS.md's own register of such holes. Real fallback content needs a SahajCloud-owned string and a read this block does not make.LiveSessioncarries oneeslint-disableforset-state-in-effect, with the reason at the site. The visitor's clock does not exist until the browser runs, and reading it during render is the hydration mismatch this PR fixes.ClassDirectorywithpages/map/+Page.tsxwas declined: the map page ownsuseAtlasHead, its own SSR children and anh-fullinsideLayoutMap, so sharing would mean a parameter per difference, and the part that genuinely is shared —atlasEmbedSrc— already is. AuseReducedMotionhook was declined now that the listener is gone and one site remains. A second zone guard insidesessionLinePartswas declined: the invariant is held once, atreadSessionClass, which is the only producer of the zones it is handed.Detail
No date library. Five were weighed at 19–22 kB gzip on a path every page pays, and
Temporalis not Baseline.Intlanswers every question asked here, and its formatters are memoized because constructing one resolves locale data —sessionAtasks the same zone question of up to ten instants, and the panel re-renders every second inside the final hour.All ten instants go to the browser. The producer computes them — six months out, exclusions applied, DST resolved upstream — and the molecule re-picks on every tick. That is what makes "the page shows the right state within a minute of a session starting, even if the page was prepared minutes earlier" and "after a session ends it counts down to the next one by itself" true with no second read. An earlier draft set the clock once at mount, and the panel then ran its digits to zero and stayed on "Next session" forever, with no join action and no way in but a reload; the
LiveSessionjsdom spec is what now holds it."Within ten minutes" costs nothing here. It is the Cloudflare edge's 600s cache in front of SahajCloud (
server/CACHING.md). Nothing in this repo caches a read, and a cache added insidelib/content/live-session.tswould sit behind that one and make the wait unbounded. The module's docblock says so.The schedule line carries
suppressHydrationWarning. It is built from CLDR data on two independent ICU builds — the Worker's and the visitor's browser — and a release that moves a zone's long name, or the space befoream, differs by an invisible character that React would throw the whole subtree's markup away over. The browser replaces that line with the visitor's own clock a tick later anyway.One widget per page, decided in the converter. A second
<sahaj-atlas>shows nothing, and any number of blocks can ask for one. Aclass-directoryblock an editor placed on purpose always wins, wherever it sits; among equals the first draws, so a second directory and a second gapped countdown both stand down — and no block has to re-derive another block's render decision. A countdown that renders no widget at all, because its class resolves or it has no background image, stands out of the way rather than suppressing a later one. The sibling list is the page:pageBlocksis attached to one rich-text field upstream and no page block carries a rich-text field of its own.Closes #309
https://claude.ai/code/session_01Mg9rjVGeYHrHtRicZPyv8d